add test22 module
diff --git a/pom.xml b/pom.xml
index 5661a7f..619336d 100644
--- a/pom.xml
+++ b/pom.xml
@@ -45,6 +45,7 @@
<modules>
<module>test12</module>
<module>test20</module>
+ <module>test22</module>
</modules>
<!--
<repositories>
diff --git a/test22/pom.xml b/test22/pom.xml
new file mode 100644
index 0000000..9ac2bbd
--- /dev/null
+++ b/test22/pom.xml
@@ -0,0 +1,260 @@
+<!--
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to you under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * $Id: pom.xml 1326869 2012-04-17 01:30:30Z lu4242 $
+ */
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.apache.myfaces.test</groupId>
+ <artifactId>myfaces-test-project</artifactId>
+ <version>1.0.5-SNAPSHOT</version>
+ </parent>
+
+ <artifactId>myfaces-test22</artifactId>
+ <packaging>jar</packaging>
+ <name>Myfaces Test Framework for JSF 2.2</name>
+
+ <dependencies>
+
+ <!-- Required only for using the org.apache.shale.test.config package -->
+ <dependency>
+ <groupId>commons-digester</groupId>
+ <artifactId>commons-digester</artifactId>
+ <version>1.8</version>
+ <optional>true</optional>
+ </dependency>
+
+ <dependency>
+ <groupId>net.sourceforge.htmlunit</groupId>
+ <artifactId>htmlunit</artifactId>
+ <version>1.14</version>
+ <optional>true</optional>
+ </dependency>
+
+ <dependency>
+ <groupId>jmock</groupId>
+ <artifactId>jmock</artifactId>
+ <version>1.0.1</version>
+ <optional>true</optional>
+ </dependency>
+
+ <dependency>
+ <groupId>jmock</groupId>
+ <artifactId>jmock-cglib</artifactId>
+ <version>1.0.1</version>
+ <optional>true</optional>
+ </dependency>
+
+ <!-- For the "org.apache.shale.test.cargo" package, we need to have -->
+ <!-- JUnit as a compile time dependency, not just scope="test". -->
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>4.5</version>
+ <scope>compile</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.codehaus.cargo</groupId>
+ <artifactId>cargo-core-uberjar</artifactId>
+ <version>0.8</version>
+ <optional>true</optional>
+ </dependency>
+
+ <dependency>
+ <groupId>org.codehaus.cargo</groupId>
+ <artifactId>cargo-ant</artifactId>
+ <version>0.8</version>
+ <optional>true</optional>
+ </dependency>
+
+ <dependency>
+ <groupId>javax.portlet</groupId>
+ <artifactId>portlet-api</artifactId>
+ <version>1.0</version>
+ <scope>provided</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.myfaces.core</groupId>
+ <artifactId>myfaces-api</artifactId>
+ <version>${jsf-myfaces.version}</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.myfaces.core</groupId>
+ <artifactId>myfaces-impl</artifactId>
+ <version>${jsf-myfaces.version}</version>
+ <scope>test</scope>
+ </dependency>
+ <!-- Servlet 2.5 -->
+ <dependency>
+ <groupId>org.apache.geronimo.specs</groupId>
+ <artifactId>geronimo-servlet_2.5_spec</artifactId>
+ <version>1.2</version>
+ <scope>provided</scope>
+ </dependency>
+ <!-- JSP 2.1 -->
+ <dependency>
+ <groupId>org.apache.geronimo.specs</groupId>
+ <artifactId>geronimo-jsp_2.1_spec</artifactId>
+ <version>1.0.1</version>
+ <scope>provided</scope>
+ </dependency>
+ <!-- EL 1.0 -->
+ <dependency>
+ <groupId>org.apache.geronimo.specs</groupId>
+ <artifactId>geronimo-el_1.0_spec</artifactId>
+ <version>1.0.2</version>
+ <scope>provided</scope>
+ </dependency>
+
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <configuration>
+ <source>1.5</source>
+ <target>1.5</target>
+ </configuration>
+ </plugin>
+ <plugin>
+ <artifactId>maven-source-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>attach-source</id>
+ <goals>
+ <goal>jar</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <!--
+ - Add a new source directory to the compile path.
+ -
+ - test12_sources: contains all the source code from the "main" branch of test,
+ - which is written to be JSF1.2 and JSF1.1-compatible.
+ -->
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>build-helper-maven-plugin</artifactId>
+ <version>1.7</version>
+ <executions>
+ <execution>
+ <id>add-source</id>
+ <phase>generate-sources</phase>
+ <goals>
+ <goal>add-source</goal>
+ </goals>
+ <configuration>
+ <sources>
+ <source>
+ ${project.build.directory}/test20_sources
+ </source>
+ </sources>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.myfaces.buildtools</groupId>
+ <artifactId>myfaces-builder-plugin</artifactId>
+ <version>1.0.10</version>
+ <executions>
+ <execution>
+ <id>unpack-test12</id>
+ <phase>generate-sources</phase>
+ <goals>
+ <goal>unpack</goal>
+ </goals>
+ <configuration>
+ <scanModel>false</scanModel>
+ <artifactItems>
+ <artifactItem>
+ <groupId>org.apache.myfaces.test</groupId>
+ <artifactId>myfaces-test20</artifactId>
+ <version>1.0.5-SNAPSHOT</version>
+ <classifier>sources</classifier>
+ <outputDirectory>${project.build.directory}/test20_sources</outputDirectory>
+ <includes>org/apache/myfaces/**/*.java</includes>
+ <excludes>**/*.class,**/META-INF/**</excludes>
+ </artifactItem>
+ </artifactItems>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ <profiles>
+ <profile>
+ <id>generate-assembly</id>
+ <activation>
+ <property>
+ <name>performRelease</name>
+ <value>true</value>
+ </property>
+ </activation>
+ <build>
+ <plugins>
+
+ <plugin>
+ <artifactId>maven-javadoc-plugin</artifactId>
+ <version>2.8</version>
+ <executions>
+ <execution>
+ <id>attach-javadoc</id>
+ <goals>
+ <goal>jar</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+
+ </plugins>
+ </build>
+ </profile>
+ </profiles>
+ <reporting>
+ <plugins>
+ <plugin>
+ <artifactId>maven-javadoc-plugin</artifactId>
+ <version>2.8</version>
+ <reportSets>
+ <reportSet>
+ <id>non-aggregate</id>
+ <configuration>
+ <!-- Specific configuration for the non aggregate report -->
+ </configuration>
+ <reports>
+ <report>javadoc</report>
+ </reports>
+ </reportSet>
+ </reportSets>
+ </plugin>
+ </plugins>
+ </reporting>
+ <properties>
+ <jsf-ri.version>2.0.2-b10</jsf-ri.version>
+ <jsf-myfaces.version>2.2.0-SNAPSHOT</jsf-myfaces.version>
+ </properties>
+</project>
diff --git a/test22/src/main/java/org/apache/myfaces/test/mock/MockApplication22.java b/test22/src/main/java/org/apache/myfaces/test/mock/MockApplication22.java
new file mode 100644
index 0000000..5db427e
--- /dev/null
+++ b/test22/src/main/java/org/apache/myfaces/test/mock/MockApplication22.java
@@ -0,0 +1,60 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to you under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.myfaces.test.mock;
+
+import javax.faces.flow.FlowHandler;
+
+/**
+ * <p>Mock implementation of <code>Application</code> that includes the semantics
+ * added by JavaServer Faces 2.0.</p>
+ *
+ * @author Leonardo Uribe
+ * @since 1.0.0
+ *
+ */
+public class MockApplication22 extends MockApplication20
+{
+ // ------------------------------------------------------------ Constructors
+
+ public MockApplication22()
+ {
+ super();
+
+ // install flow Handler
+ setFlowHandler(new MockFlowHandler());
+ }
+
+ // ------------------------------------------------------ Instance Variables
+
+ private FlowHandler _flowHandler;
+
+ // ----------------------------------------------------- Mock Object Methods
+
+ @Override
+ public FlowHandler getFlowHandler()
+ {
+ return _flowHandler;
+ }
+
+ @Override
+ public void setFlowHandler(FlowHandler flowHandler)
+ {
+ this._flowHandler = flowHandler;
+ }
+
+}
diff --git a/test22/src/main/java/org/apache/myfaces/test/mock/MockApplicationFactory.java b/test22/src/main/java/org/apache/myfaces/test/mock/MockApplicationFactory.java
new file mode 100644
index 0000000..1f7881d
--- /dev/null
+++ b/test22/src/main/java/org/apache/myfaces/test/mock/MockApplicationFactory.java
@@ -0,0 +1,147 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to you under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.myfaces.test.mock;
+
+import javax.faces.FacesException;
+import javax.faces.application.Application;
+import javax.faces.application.ApplicationFactory;
+
+/**
+ * <p>Mock implementation of <code>ApplicationFactory</code>.</p>
+ *
+ * $Id$
+ * @since 1.0.0
+ */
+
+public class MockApplicationFactory extends ApplicationFactory
+{
+
+ // ------------------------------------------------------------ Constructors
+
+ /**
+ * <p>Construct a default instance.</p>
+ */
+ public MockApplicationFactory()
+ {
+
+ }
+
+ // ----------------------------------------------------- Mock Object Methods
+
+ // ------------------------------------------------------ Instance Variables
+
+ /**
+ * <p>The <code>Application</code> instance to be returned by
+ * this factory.</p>
+ */
+ private Application application = null;
+
+ // --------------------------------------------- AppolicationFactory Methods
+
+ /** {@inheritDoc} */
+ public Application getApplication()
+ {
+
+ if (this.application == null)
+ {
+ Class clazz = null;
+
+ try
+ {
+ clazz = this.getClass().getClassLoader().loadClass(
+ "org.apache.myfaces.test.mock.MockApplication22");
+ if (clazz == null)
+ {
+ clazz = this.getClass().getClassLoader().loadClass(
+ "org.apache.myfaces.test.mock.MockApplication20");
+ }
+ this.application = (MockApplication) clazz.newInstance();
+ }
+ catch (NoClassDefFoundError e)
+ {
+ clazz = null; // We are not running in a JSF 1.2 environment
+ }
+ catch (ClassNotFoundException e)
+ {
+ clazz = null; // Same as above
+ }
+ catch (RuntimeException e)
+ {
+ throw e;
+ }
+ catch (Exception e)
+ {
+ throw new FacesException(e);
+ }
+
+ if (clazz == null)
+ {
+ try
+ {
+ clazz = this.getClass().getClassLoader().loadClass(
+ "org.apache.myfaces.test.mock.MockApplication12");
+ this.application = (MockApplication) clazz.newInstance();
+ }
+ catch (NoClassDefFoundError e)
+ {
+ clazz = null; // We are not running in a JSF 1.2 environment
+ }
+ catch (ClassNotFoundException e)
+ {
+ clazz = null; // Same as above
+ }
+ catch (RuntimeException e)
+ {
+ throw e;
+ }
+ catch (Exception e)
+ {
+ throw new FacesException(e);
+ }
+ }
+ if (clazz == null)
+ {
+ try
+ {
+ clazz = this.getClass().getClassLoader().loadClass(
+ "org.apache.myfaces.test.mock.MockApplication");
+ this.application = (MockApplication) clazz.newInstance();
+ }
+ catch (RuntimeException e)
+ {
+ throw e;
+ }
+ catch (Exception e)
+ {
+ throw new FacesException(e);
+ }
+ }
+ }
+ return this.application;
+
+ }
+
+ /** {@inheritDoc} */
+ public void setApplication(Application application)
+ {
+
+ this.application = application;
+
+ }
+
+}
diff --git a/test22/src/main/java/org/apache/myfaces/test/mock/MockFlowHandler.java b/test22/src/main/java/org/apache/myfaces/test/mock/MockFlowHandler.java
new file mode 100644
index 0000000..3c542c6
--- /dev/null
+++ b/test22/src/main/java/org/apache/myfaces/test/mock/MockFlowHandler.java
@@ -0,0 +1,66 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to you under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.myfaces.test.mock;
+
+import java.util.Collections;
+import java.util.Map;
+import javax.faces.context.FacesContext;
+import javax.faces.flow.Flow;
+import javax.faces.flow.FlowCallNode;
+import javax.faces.flow.FlowHandler;
+
+/**
+ *
+ * @author Leonardo Uribe
+ */
+public class MockFlowHandler extends FlowHandler
+{
+
+ @Override
+ public Map<Object, Object> getCurrentFlowScope()
+ {
+ return Collections.emptyMap();
+ }
+
+ @Override
+ public Flow getFlow(FacesContext context, String definingDocumentId, String id)
+ {
+ return null;
+ }
+
+ @Override
+ public void addFlow(FacesContext context, Flow toAdd)
+ {
+ }
+
+ @Override
+ public Flow getCurrentFlow(FacesContext context)
+ {
+ return null;
+ }
+
+ @Override
+ public void transition(FacesContext context, Flow sourceFlow, Flow targetFlow, FlowCallNode outboundCallNode)
+ {
+ }
+
+ @Override
+ public boolean isActive(FacesContext context, String definingDocument, String id)
+ {
+ return false;
+ }
+}