[seam-commits] Seam SVN: r14333 - in branches/community/Seam_2_3: seam-integration-tests-ee6 and 17 other directories.
seam-commits at lists.jboss.org
seam-commits at lists.jboss.org
Tue Feb 28 08:53:33 EST 2012
Author: maschmid
Date: 2012-02-28 08:53:30 -0500 (Tue, 28 Feb 2012)
New Revision: 14333
Added:
branches/community/Seam_2_3/seam-integration-tests-ee6/
branches/community/Seam_2_3/seam-integration-tests-ee6/pom.xml
branches/community/Seam_2_3/seam-integration-tests-ee6/readme.txt
branches/community/Seam_2_3/seam-integration-tests-ee6/src/
branches/community/Seam_2_3/seam-integration-tests-ee6/src/test/
branches/community/Seam_2_3/seam-integration-tests-ee6/src/test/java/
branches/community/Seam_2_3/seam-integration-tests-ee6/src/test/java/org/
branches/community/Seam_2_3/seam-integration-tests-ee6/src/test/java/org/jboss/
branches/community/Seam_2_3/seam-integration-tests-ee6/src/test/java/org/jboss/seam/
branches/community/Seam_2_3/seam-integration-tests-ee6/src/test/java/org/jboss/seam/test/
branches/community/Seam_2_3/seam-integration-tests-ee6/src/test/java/org/jboss/seam/test/integration/
branches/community/Seam_2_3/seam-integration-tests-ee6/src/test/java/org/jboss/seam/test/integration/Action.java
branches/community/Seam_2_3/seam-integration-tests-ee6/src/test/java/org/jboss/seam/test/integration/BeanA.java
branches/community/Seam_2_3/seam-integration-tests-ee6/src/test/java/org/jboss/seam/test/integration/BeanB.java
branches/community/Seam_2_3/seam-integration-tests-ee6/src/test/java/org/jboss/seam/test/integration/BusinessProcessTest.java
branches/community/Seam_2_3/seam-integration-tests-ee6/src/test/java/org/jboss/seam/test/integration/ConcurrentFactoryTest.java
branches/community/Seam_2_3/seam-integration-tests-ee6/src/test/java/org/jboss/seam/test/integration/ConversationTest.java
branches/community/Seam_2_3/seam-integration-tests-ee6/src/test/java/org/jboss/seam/test/integration/Country.java
branches/community/Seam_2_3/seam-integration-tests-ee6/src/test/java/org/jboss/seam/test/integration/CountryHome.java
branches/community/Seam_2_3/seam-integration-tests-ee6/src/test/java/org/jboss/seam/test/integration/Deployments.java
branches/community/Seam_2_3/seam-integration-tests-ee6/src/test/java/org/jboss/seam/test/integration/ELTest.java
branches/community/Seam_2_3/seam-integration-tests-ee6/src/test/java/org/jboss/seam/test/integration/EntityPassivationTest.java
branches/community/Seam_2_3/seam-integration-tests-ee6/src/test/java/org/jboss/seam/test/integration/EntityTest.java
branches/community/Seam_2_3/seam-integration-tests-ee6/src/test/java/org/jboss/seam/test/integration/EventTest.java
branches/community/Seam_2_3/seam-integration-tests-ee6/src/test/java/org/jboss/seam/test/integration/Foo.java
branches/community/Seam_2_3/seam-integration-tests-ee6/src/test/java/org/jboss/seam/test/integration/IdentifierTest.java
branches/community/Seam_2_3/seam-integration-tests-ee6/src/test/java/org/jboss/seam/test/integration/ImportTest.java
branches/community/Seam_2_3/seam-integration-tests-ee6/src/test/java/org/jboss/seam/test/integration/JavaBeanEqualsTest.java
branches/community/Seam_2_3/seam-integration-tests-ee6/src/test/java/org/jboss/seam/test/integration/MessagingTest.java
branches/community/Seam_2_3/seam-integration-tests-ee6/src/test/java/org/jboss/seam/test/integration/NamespaceResolverTest.java
branches/community/Seam_2_3/seam-integration-tests-ee6/src/test/java/org/jboss/seam/test/integration/NamespaceTest.java
branches/community/Seam_2_3/seam-integration-tests-ee6/src/test/java/org/jboss/seam/test/integration/PageContextTest.java
branches/community/Seam_2_3/seam-integration-tests-ee6/src/test/java/org/jboss/seam/test/integration/PageParamTest.java
branches/community/Seam_2_3/seam-integration-tests-ee6/src/test/java/org/jboss/seam/test/integration/People.java
branches/community/Seam_2_3/seam-integration-tests-ee6/src/test/java/org/jboss/seam/test/integration/Person.java
branches/community/Seam_2_3/seam-integration-tests-ee6/src/test/java/org/jboss/seam/test/integration/Thing.java
branches/community/Seam_2_3/seam-integration-tests-ee6/src/test/java/org/jboss/seam/test/integration/UnversionedThing.java
branches/community/Seam_2_3/seam-integration-tests-ee6/src/test/java/org/jboss/seam/test/integration/bpm/
branches/community/Seam_2_3/seam-integration-tests-ee6/src/test/java/org/jboss/seam/test/integration/bpm/SeamExpressionEvaluatorTest.java
branches/community/Seam_2_3/seam-integration-tests-ee6/src/test/java/org/jboss/seam/test/integration/bpm/SeamExpressionEvaluatorTestController.java
branches/community/Seam_2_3/seam-integration-tests-ee6/src/test/java/org/jboss/seam/test/integration/databinding/
branches/community/Seam_2_3/seam-integration-tests-ee6/src/test/java/org/jboss/seam/test/integration/databinding/DataModelTest.java
branches/community/Seam_2_3/seam-integration-tests-ee6/src/test/java/org/jboss/seam/test/integration/i8ln/
branches/community/Seam_2_3/seam-integration-tests-ee6/src/test/java/org/jboss/seam/test/integration/i8ln/LocaleTest.java
branches/community/Seam_2_3/seam-integration-tests-ee6/src/test/java/org/jboss/seam/test/integration/i8ln/TimeZoneTest.java
branches/community/Seam_2_3/seam-integration-tests-ee6/src/test/java/org/jboss/seam/test/integration/mock/
branches/community/Seam_2_3/seam-integration-tests-ee6/src/test/java/org/jboss/seam/test/integration/mock/SeamMockELResolverTest.java
branches/community/Seam_2_3/seam-integration-tests-ee6/src/test/java/org/jboss/seam/test/integration/mock/SeamTestTest.java
branches/community/Seam_2_3/seam-integration-tests-ee6/src/test/java/org/jboss/seam/test/integration/security/
branches/community/Seam_2_3/seam-integration-tests-ee6/src/test/java/org/jboss/seam/test/integration/security/SecurityTest.java
branches/community/Seam_2_3/seam-integration-tests-ee6/src/test/resources-jbossas-7/
branches/community/Seam_2_3/seam-integration-tests-ee6/src/test/resources-jbossas-7/arquillian.xml
branches/community/Seam_2_3/seam-integration-tests-ee6/src/test/resources/
branches/community/Seam_2_3/seam-integration-tests-ee6/src/test/resources/META-INF/
branches/community/Seam_2_3/seam-integration-tests-ee6/src/test/resources/META-INF/ejb-jar.xml
branches/community/Seam_2_3/seam-integration-tests-ee6/src/test/resources/META-INF/persistence.xml
branches/community/Seam_2_3/seam-integration-tests-ee6/src/test/resources/WEB-INF/
branches/community/Seam_2_3/seam-integration-tests-ee6/src/test/resources/WEB-INF/components-jbpm.xml
branches/community/Seam_2_3/seam-integration-tests-ee6/src/test/resources/WEB-INF/components.xml
branches/community/Seam_2_3/seam-integration-tests-ee6/src/test/resources/WEB-INF/pages.xml
branches/community/Seam_2_3/seam-integration-tests-ee6/src/test/resources/WEB-INF/web.xml
branches/community/Seam_2_3/seam-integration-tests-ee6/src/test/resources/components.properties
branches/community/Seam_2_3/seam-integration-tests-ee6/src/test/resources/hibernate.cfg.xml
branches/community/Seam_2_3/seam-integration-tests-ee6/src/test/resources/jboss-seam-integration-tests-ds.xml
branches/community/Seam_2_3/seam-integration-tests-ee6/src/test/resources/jbpm.cfg.xml
branches/community/Seam_2_3/seam-integration-tests-ee6/src/test/resources/messages_en.properties
branches/community/Seam_2_3/seam-integration-tests-ee6/src/test/resources/test-destinations-service.xml
branches/community/Seam_2_3/seam-integration-tests-ee6/src/test/resources/testProcess1.jpdl.xml
branches/community/Seam_2_3/seam-integration-tests-ee6/src/test/resources/testProcess2.jpdl.xml
branches/community/Seam_2_3/seam-integration-tests-ee6/src/test/resources/testProcess3.jpdl.xml
branches/community/Seam_2_3/seam-integration-tests-ee6/src/test/resources/testProcess4.jpdl.xml
Log:
Initial import of the arquillian integration testsuite
Added: branches/community/Seam_2_3/seam-integration-tests-ee6/pom.xml
===================================================================
--- branches/community/Seam_2_3/seam-integration-tests-ee6/pom.xml (rev 0)
+++ branches/community/Seam_2_3/seam-integration-tests-ee6/pom.xml 2012-02-28 13:53:30 UTC (rev 14333)
@@ -0,0 +1,343 @@
+<?xml version="1.0"?>
+<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/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <artifactId>jboss-seam-parent</artifactId>
+ <groupId>org.jboss.seam</groupId>
+ <version>2.3.0-SNAPSHOT</version>
+ <relativePath>../jboss-seam-parent/pom.xml</relativePath>
+ </parent>
+ <groupId>org.jboss.seam</groupId>
+ <artifactId>seam-integration-tests-ee6</artifactId>
+ <name>Seam Integration Tests</name>
+
+ <properties>
+ </properties>
+
+ <build>
+ <testResources>
+ <testResource>
+ <directory>src/test/resources</directory>
+ <filtering>true</filtering>
+ </testResource>
+ </testResources>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <skipTests>true</skipTests>
+ </configuration>
+
+ <executions>
+ <execution>
+ <id>surefire-it</id>
+ <phase>integration-test</phase>
+ <goals>
+ <goal>test</goal>
+ </goals>
+ <configuration>
+ <skip>true</skip>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+
+ <plugin>
+ <artifactId>maven-clean-plugin</artifactId>
+ <configuration>
+ <filesets>
+ <fileset>
+ <directory>${project.build.directory}/bootstrap</directory>
+ </fileset>
+ <fileset>
+ <directory>${basedir}/src/test/META-INF</directory>
+ </fileset>
+ </filesets>
+ </configuration>
+ </plugin>
+ </plugins>
+
+
+ </build>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.jbpm</groupId>
+ <artifactId>jbpm-jpdl</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>javassist</groupId>
+ <artifactId>javassist</artifactId>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.arquillian.junit</groupId>
+ <artifactId>arquillian-junit-container</artifactId>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.arquillian.protocol</groupId>
+ <artifactId>arquillian-protocol-servlet</artifactId>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.shrinkwrap.resolver</groupId>
+ <artifactId>shrinkwrap-resolver-api-maven</artifactId>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.shrinkwrap.resolver</groupId>
+ <artifactId>shrinkwrap-resolver-impl-maven</artifactId>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.spec</groupId>
+ <artifactId>jboss-javaee-6.0</artifactId>
+ <type>pom</type>
+ <scope>provided</scope>
+ </dependency>
+
+ </dependencies>
+
+ <profiles>
+ <profile>
+ <id>code-coverage</id>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>default-test</id>
+ <phase>none</phase>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.sonatype.maven.plugin</groupId>
+ <artifactId>emma4it-maven-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>merge</id>
+ <phase>post-integration-test</phase>
+ <goals>
+ <goal>merge</goal>
+ </goals>
+ <configuration>
+ <searchPath>${basedir}/../</searchPath>
+ </configuration>
+ </execution>
+ <execution>
+ <id>report</id>
+ <phase>verify</phase>
+ <goals>
+ <goal>report</goal>
+ </goals>
+ <configuration>
+ <sourceSets>
+ <sourceSet>
+ <directory>${basedir}/../jboss-seam-jsf2/src/main/java</directory>
+ <directory>${basedir}/../jboss-seam-debug/src/main/java</directory>
+ <directory>${basedir}/../jboss-seam-excel/src/main/java</directory>
+ <directory>${basedir}/../jboss-seam-flex/src/main/java</directory>
+ <directory>${basedir}/../jboss-seam-gen/src/main/java</directory>
+ <directory>${basedir}/../jboss-seam-ioc/src/main/java</directory>
+ <directory>${basedir}/../jboss-seam-jul/src/main/java</directory>
+ <directory>${basedir}/../jboss-seam-mail/src/main/java</directory>
+ <directory>${basedir}/../jboss-seam-pdf/src/main/java</directory>
+ <directory>${basedir}/../jboss-seam-remoting/src/main/java</directory>
+ <directory>${basedir}/../jboss-seam-resteasy/src/main/java</directory>
+ <directory>${basedir}/../jboss-seam-rss/src/main/java</directory>
+ <directory>${basedir}/../jboss-seam-ui/src/main/java</directory>
+ <directory>${basedir}/../jboss-seam-wicket/src/main/java</directory>
+ </sourceSet>
+ </sourceSets>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ <profile>
+ <id>jsf2</id>
+ <activation>
+ <activeByDefault>true</activeByDefault>
+ </activation>
+ <dependencies>
+ <dependency>
+ <groupId>com.sun.faces</groupId>
+ <artifactId>jsf-api</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>com.sun.faces</groupId>
+ <artifactId>jsf-impl</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.seam</groupId>
+ <artifactId>jboss-seam-jsf2</artifactId>
+ <version>${project.version}</version>
+
+ <exclusions>
+ <exclusion>
+ <groupId>org.testng</groupId>
+ <artifactId>testng</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+
+ <dependency>
+ <groupId>org.hibernate</groupId>
+ <artifactId>hibernate-core</artifactId>
+ </dependency>
+
+ </dependencies>
+ <build>
+ <testResources>
+ <testResource>
+ <directory>src/test/resources</directory>
+ <filtering>true</filtering>
+ </testResource>
+ </testResources>
+ </build>
+ </profile>
+
+ <profile>
+ <id>integration-test</id>
+ <activation>
+ <activeByDefault>true</activeByDefault>
+ <property>
+ <name>arquillian</name>
+ </property>
+ </activation>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <skip>true</skip>
+ <skipTests>false</skipTests>
+ </configuration>
+
+ <executions>
+ <execution>
+ <id>surefire-it</id>
+ <phase>integration-test</phase>
+ <goals>
+ <goal>test</goal>
+ </goals>
+ <configuration>
+ <redirectTestOutputToFile>true</redirectTestOutputToFile>
+ <skip>false</skip>
+ <systemProperties>
+ <!-- used by the jbossas-managed-7 profile in arquillian.xml for the jbossHome property-->
+ <version.jbossas7>${version.jbossas7}</version.jbossas7>
+ </systemProperties>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+
+ <profile>
+ <id>arq-jbossas-7-managed</id>
+ <activation>
+ <activeByDefault>true</activeByDefault>
+ <property>
+ <name>arquillian</name>
+ <value>jbossas-managed-7</value>
+ </property>
+ </activation>
+ <dependencies>
+ <dependency>
+ <groupId>org.jboss.as</groupId>
+ <artifactId>jboss-as-arquillian-container-managed</artifactId>
+ </dependency>
+ </dependencies>
+ <build>
+ <testResources>
+ <testResource>
+ <directory>src/test/resources</directory>
+ </testResource>
+ <testResource>
+ <directory>src/test/resources-jbossas-7</directory>
+ </testResource>
+ </testResources>
+
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-dependency-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>unpack-as7</id>
+ <phase>process-test-classes</phase>
+ <goals>
+ <goal>unpack</goal>
+ </goals>
+ <configuration>
+ <artifactItems>
+ <artifactItem>
+ <groupId>org.jboss.as</groupId>
+ <artifactId>jboss-as-dist</artifactId>
+ <version>${version.jbossas7}</version>
+ <type>zip</type>
+ <overWrite>false</overWrite>
+ <outputDirectory>${project.build.directory}</outputDirectory>
+ </artifactItem>
+ </artifactItems>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+
+ <profile>
+ <id>arq-jbossas-7-remote</id>
+ <activation>
+ <property>
+ <name>arquillian</name>
+ <value>jbossas-remote-7</value>
+ </property>
+ </activation>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.jboss.as</groupId>
+ <artifactId>jboss-as-arquillian-container-remote</artifactId>
+ </dependency>
+ </dependencies>
+ <build>
+ <testResources>
+ <testResource>
+ <directory>src/test/resources</directory>
+ </testResource>
+ <testResource>
+ <directory>src/test/resources-jbossas-7</directory>
+ </testResource>
+ </testResources>
+ </build>
+ </profile>
+ </profiles>
+</project>
Added: branches/community/Seam_2_3/seam-integration-tests-ee6/readme.txt
===================================================================
--- branches/community/Seam_2_3/seam-integration-tests-ee6/readme.txt (rev 0)
+++ branches/community/Seam_2_3/seam-integration-tests-ee6/readme.txt 2012-02-28 13:53:30 UTC (rev 14333)
@@ -0,0 +1 @@
+Core integration tests for Seam (those not associated with a particular example)
\ No newline at end of file
Added: branches/community/Seam_2_3/seam-integration-tests-ee6/src/test/java/org/jboss/seam/test/integration/Action.java
===================================================================
--- branches/community/Seam_2_3/seam-integration-tests-ee6/src/test/java/org/jboss/seam/test/integration/Action.java (rev 0)
+++ branches/community/Seam_2_3/seam-integration-tests-ee6/src/test/java/org/jboss/seam/test/integration/Action.java 2012-02-28 13:53:30 UTC (rev 14333)
@@ -0,0 +1,11 @@
+package org.jboss.seam.test.integration;
+
+import org.jboss.seam.annotations.Name;
+
+ at Name("action")
+public class Action {
+
+ public String go() {
+ return "success";
+ }
+}
Added: branches/community/Seam_2_3/seam-integration-tests-ee6/src/test/java/org/jboss/seam/test/integration/BeanA.java
===================================================================
--- branches/community/Seam_2_3/seam-integration-tests-ee6/src/test/java/org/jboss/seam/test/integration/BeanA.java (rev 0)
+++ branches/community/Seam_2_3/seam-integration-tests-ee6/src/test/java/org/jboss/seam/test/integration/BeanA.java 2012-02-28 13:53:30 UTC (rev 14333)
@@ -0,0 +1,38 @@
+package org.jboss.seam.test.integration;
+
+import java.io.Serializable;
+import org.jboss.seam.ScopeType;
+import org.jboss.seam.annotations.AutoCreate;
+import org.jboss.seam.annotations.Create;
+import org.jboss.seam.annotations.Name;
+import org.jboss.seam.annotations.Observer;
+import org.jboss.seam.annotations.Scope;
+import org.jboss.seam.core.Events;
+
+ at Name("beanA")
+ at Scope(ScopeType.CONVERSATION)
+ at AutoCreate
+public class BeanA implements Serializable {
+
+ private String myValue;
+
+ public String getMyValue() {
+ return myValue;
+ }
+
+ public void setMyValue(String myValue) {
+ this.myValue = myValue;
+ }
+
+ @Create
+ public void create() {
+ myValue = "Foo";
+ }
+
+ @Observer(value = "BeanA.refreshMyValue")
+ public void refreshMyValue() {
+ myValue = "Bar";
+ Events.instance().raiseEvent("BeanA.valueModified");
+ }
+
+}
Added: branches/community/Seam_2_3/seam-integration-tests-ee6/src/test/java/org/jboss/seam/test/integration/BeanB.java
===================================================================
--- branches/community/Seam_2_3/seam-integration-tests-ee6/src/test/java/org/jboss/seam/test/integration/BeanB.java (rev 0)
+++ branches/community/Seam_2_3/seam-integration-tests-ee6/src/test/java/org/jboss/seam/test/integration/BeanB.java 2012-02-28 13:53:30 UTC (rev 14333)
@@ -0,0 +1,33 @@
+package org.jboss.seam.test.integration;
+
+import java.io.Serializable;
+
+import org.jboss.seam.Component;
+import org.jboss.seam.ScopeType;
+import org.jboss.seam.annotations.AutoCreate;
+import org.jboss.seam.annotations.Name;
+import org.jboss.seam.annotations.Observer;
+import org.jboss.seam.annotations.Scope;
+
+ at Name("beanB")
+ at Scope(ScopeType.PAGE)
+ at AutoCreate
+public class BeanB implements Serializable {
+
+ private String myValue;
+
+ public String getMyValue() {
+ return myValue;
+ }
+
+ public void setMyValue(String myValue) {
+ this.myValue = myValue;
+ }
+
+ @Observer(value = "BeanA.valueModified")
+ public void takeValueFromBeanA() {
+ BeanA beanA = (BeanA) Component.getInstance("beanA");
+ myValue = beanA.getMyValue();
+ }
+
+}
\ No newline at end of file
Added: branches/community/Seam_2_3/seam-integration-tests-ee6/src/test/java/org/jboss/seam/test/integration/BusinessProcessTest.java
===================================================================
--- branches/community/Seam_2_3/seam-integration-tests-ee6/src/test/java/org/jboss/seam/test/integration/BusinessProcessTest.java (rev 0)
+++ branches/community/Seam_2_3/seam-integration-tests-ee6/src/test/java/org/jboss/seam/test/integration/BusinessProcessTest.java 2012-02-28 13:53:30 UTC (rev 14333)
@@ -0,0 +1,73 @@
+package org.jboss.seam.test.integration;
+
+import org.jboss.arquillian.container.test.api.Deployment;
+import org.jboss.arquillian.container.test.api.OverProtocol;
+import org.jboss.arquillian.junit.Arquillian;
+import org.jboss.seam.annotations.Name;
+import org.jboss.seam.annotations.bpm.CreateProcess;
+import org.jboss.seam.mock.JUnitSeamTest;
+import org.jboss.shrinkwrap.api.Archive;
+import org.junit.Ignore;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+ at Ignore
+ at RunWith(Arquillian.class)
+public class BusinessProcessTest
+ extends JUnitSeamTest
+{
+ @Deployment(name="BusinessProcessTest")
+ @OverProtocol("Servlet 3.0")
+ public static Archive<?> createDeployment()
+ {
+ return Deployments.jbpmSeamDeployment().addClasses(ProcessComponent.class);
+ }
+
+ @Test
+ public void noProcessDefinition()
+ throws Exception
+ {
+ new FacesRequest() {
+ @Override
+ protected void invokeApplication() throws Exception {
+ try {
+ invokeAction("#{bpmTest.startInvalid}");
+ assert false;
+ } catch (Exception e) {
+ // expected
+ }
+ }
+
+ }.run();
+ }
+
+ @Test
+ public void noVariableStart()
+ throws Exception
+ {
+ new FacesRequest() {
+ @Override
+ protected void invokeApplication() throws Exception {
+ try {
+ invokeAction("#{bpmTest.startOne}");
+ } catch (Exception e) {
+ e.printStackTrace();
+ assert false;
+ }
+ }
+
+ }.run();
+ }
+
+
+ @Name("bpmTest")
+ static public class ProcessComponent {
+ @CreateProcess(definition="NoSuchProcess")
+ public void startInvalid() {
+ }
+
+ @CreateProcess(definition="TestProcess1")
+ public void startOne() {
+ }
+ }
+}
Added: branches/community/Seam_2_3/seam-integration-tests-ee6/src/test/java/org/jboss/seam/test/integration/ConcurrentFactoryTest.java
===================================================================
--- branches/community/Seam_2_3/seam-integration-tests-ee6/src/test/java/org/jboss/seam/test/integration/ConcurrentFactoryTest.java (rev 0)
+++ branches/community/Seam_2_3/seam-integration-tests-ee6/src/test/java/org/jboss/seam/test/integration/ConcurrentFactoryTest.java 2012-02-28 13:53:30 UTC (rev 14333)
@@ -0,0 +1,76 @@
+package org.jboss.seam.test.integration;
+
+import static org.jboss.seam.ScopeType.APPLICATION;
+
+import org.jboss.arquillian.container.test.api.Deployment;
+import org.jboss.arquillian.container.test.api.OverProtocol;
+import org.jboss.arquillian.junit.Arquillian;
+import org.jboss.seam.annotations.Factory;
+import org.jboss.seam.annotations.In;
+import org.jboss.seam.annotations.Name;
+import org.jboss.seam.contexts.ServletLifecycle;
+import org.jboss.seam.mock.JUnitSeamTest;
+import org.junit.Ignore;
+import org.junit.Test;
+import org.junit.After;
+import org.junit.runner.RunWith;
+
+public class ConcurrentFactoryTest
+ extends JUnitSeamTest
+{
+
+ // TODO: Implement a different way to run concurrent test for junit
+ // @Test(threadPoolSize = 2, invocationCount = 2)
+ @Test
+ @Ignore
+ public void concurrentFactoryCall()
+ throws Exception
+ {
+ new ComponentTest() {
+ @Override
+ protected void testComponents() throws Exception {
+ assert "slowly created String".equals(getValue("#{concurrentFactoryTest.component.injectedString}"));
+ }
+ }.run();
+ }
+
+ @After
+ @Override
+ public void end()
+ {
+ if (session != null) {
+ // Because we run in threads. Only the first thread that finishes ends the session.
+ ServletLifecycle.endSession(session);
+ }
+ session = null;
+ }
+
+ @Name("concurrentFactoryTest.component")
+ static public class Component {
+ @In(value = "concurrentFactoryTest.slowlyCreatedString") String injectedString;
+
+ public String getInjectedString() {
+ return injectedString;
+ }
+ }
+
+ @Name("concurrentFactoryTest.SlowFactory")
+ static public class SlowFactory {
+ @Factory(value = "concurrentFactoryTest.slowlyCreatedString", scope = APPLICATION, autoCreate = true)
+ public String slowlyCreateString() {
+ try
+ {
+ Thread.sleep(1000);
+ return "slowly created String";
+ }
+ catch (InterruptedException e)
+ {
+ e.printStackTrace();
+ return null;
+ }
+ }
+ }
+
+
+
+}
Added: branches/community/Seam_2_3/seam-integration-tests-ee6/src/test/java/org/jboss/seam/test/integration/ConversationTest.java
===================================================================
--- branches/community/Seam_2_3/seam-integration-tests-ee6/src/test/java/org/jboss/seam/test/integration/ConversationTest.java (rev 0)
+++ branches/community/Seam_2_3/seam-integration-tests-ee6/src/test/java/org/jboss/seam/test/integration/ConversationTest.java 2012-02-28 13:53:30 UTC (rev 14333)
@@ -0,0 +1,460 @@
+package org.jboss.seam.test.integration;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.faces.model.SelectItem;
+
+import org.jboss.arquillian.container.test.api.Deployment;
+import org.jboss.arquillian.container.test.api.OverProtocol;
+import org.jboss.arquillian.junit.Arquillian;
+import org.jboss.seam.core.ConversationEntries;
+import org.jboss.seam.core.ConversationEntry;
+import org.jboss.seam.core.Manager;
+import org.jboss.seam.faces.Switcher;
+import org.jboss.seam.mock.JUnitSeamTest;
+import org.jboss.shrinkwrap.api.Archive;
+import org.jboss.shrinkwrap.api.ShrinkWrap;
+import org.jboss.shrinkwrap.api.asset.StringAsset;
+import org.jboss.shrinkwrap.api.spec.WebArchive;
+
+import org.junit.After;
+import org.junit.Before;
+import org.junit.BeforeClass;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+ at RunWith(Arquillian.class)
+public class ConversationTest
+ extends JUnitSeamTest
+{
+ @Deployment(name="ConversationTest")
+ @OverProtocol("Servlet 3.0")
+ public static Archive<?> createDeployment()
+ {
+ return Deployments.defaultSeamDeployment();
+ }
+
+ @Test
+ public void conversationStack()
+ throws Exception
+ {
+ // no conversation, no stack
+ new FacesRequest("/pageWithDescription.xhtml") {
+ @Override
+ protected void renderResponse() throws Exception {
+ List<ConversationEntry> entries = (List<ConversationEntry>) getValue("#{conversationStack}");
+ assert entries.size() == 0;
+ }
+ }.run();
+
+ // no conversation, no stack
+ new FacesRequest("/pageWithoutDescription.xhtml") {
+ @Override
+ protected void invokeApplication() throws Exception {
+ Manager.instance().beginConversation();
+ }
+
+ @Override
+ protected void renderResponse() throws Exception {
+ List<ConversationEntry> entries = (List<ConversationEntry>) getValue("#{conversationStack}");
+ assert entries.size() == 0;
+ }
+ }.run();
+
+ // new conversation, stack = 1
+ String rootId = new FacesRequest("/pageWithDescription.xhtml") {
+ @Override
+ protected void invokeApplication() throws Exception {
+ Manager.instance().beginConversation();
+ }
+
+ @Override
+ protected void renderResponse() throws Exception {
+ List<ConversationEntry> entries = (List<ConversationEntry>) getValue("#{conversationStack}");
+ assert entries.size() == 1;
+ }
+ }.run();
+
+ // nested conversation, stack =2
+ String nested1 = new FacesRequest("/pageWithDescription.xhtml", rootId) {
+ @Override
+ protected void invokeApplication() throws Exception {
+ Manager.instance().beginNestedConversation();
+ }
+
+ @Override
+ protected void renderResponse() throws Exception {
+ List<ConversationEntry> entries = (List<ConversationEntry>) getValue("#{conversationStack}");
+ assert entries.size() == 2;
+ }
+
+ }.run();
+
+ // nested conversation without description, not added to stack
+ String nested2 = new FacesRequest("/pageWithoutDescription.xhtml", nested1) {
+ @Override
+ protected void invokeApplication() throws Exception {
+ Manager.instance().beginNestedConversation();
+ }
+
+ @Override
+ protected void renderResponse() throws Exception {
+ List<ConversationEntry> entries = (List<ConversationEntry>) getValue("#{conversationStack}");
+ assert entries.size() == 2;
+ }
+ }.run();
+
+ // access a page, now it's on the stack
+ new FacesRequest("/pageWithDescription.xhtml", nested2) {
+ @Override
+ protected void renderResponse() throws Exception {
+ List<ConversationEntry> entries = (List<ConversationEntry>) getValue("#{conversationStack}");
+ assert entries.size() == 3;
+ }
+ }.run();
+
+ // end conversation, stack goes down
+ new FacesRequest("/pageWithDescription.xhtml", nested2) {
+ @Override
+ protected void invokeApplication() throws Exception {
+ Manager.instance().endConversation(false);
+ }
+
+ @Override
+ protected void renderResponse() throws Exception {
+ List<ConversationEntry> entries = (List<ConversationEntry>) getValue("#{conversationStack}");
+ assert entries.size() == 2;
+ }
+ }.run();
+
+ // end another one, size is 1
+ new FacesRequest("/pageWithDescription.xhtml", nested1) {
+ @Override
+ protected void invokeApplication() throws Exception {
+ Manager.instance().endConversation(false);
+ }
+
+ @Override
+ protected void renderResponse() throws Exception {
+ List<ConversationEntry> entries = (List<ConversationEntry>) getValue("#{conversationStack}");
+ assert entries.size() == 1;
+ }
+ }.run();
+ }
+
+ @Test
+ public void conversationList()
+ throws Exception
+ {
+ new FacesRequest("/pageWithDescription.xhtml") {
+ @Override
+ protected void renderResponse() throws Exception {
+ List<ConversationEntry> entries = (List<ConversationEntry>) getValue("#{conversationList}");
+ assert entries.size() == 0;
+ }
+ }.run();
+
+ new FacesRequest("/pageWithoutDescription.xhtml") {
+ @Override
+ protected void invokeApplication() throws Exception {
+ Manager.instance().beginConversation();
+ }
+
+ @Override
+ protected void renderResponse() throws Exception {
+ List<ConversationEntry> entries = (List<ConversationEntry>) getValue("#{conversationList}");
+ assert entries.size() == 0;
+ }
+ }.run();
+
+ String conv1 = new FacesRequest("/pageWithDescription.xhtml") {
+ @Override
+ protected void invokeApplication() throws Exception {
+ Manager.instance().beginConversation();
+ }
+
+ @Override
+ protected void renderResponse() throws Exception {
+ List<ConversationEntry> entries = (List<ConversationEntry>) getValue("#{conversationList}");
+ assert entries.size() == 1;
+ }
+ }.run();
+
+ String conv2 = new FacesRequest("/pageWithDescription.xhtml") {
+ @Override
+ protected void invokeApplication() throws Exception {
+ Manager.instance().beginConversation();
+ }
+
+ @Override
+ protected void renderResponse() throws Exception {
+ List<ConversationEntry> entries = (List<ConversationEntry>) getValue("#{conversationList}");
+ assert entries.size() == 2;
+ }
+ }.run();
+
+ String conv3 = new FacesRequest("/pageWithDescription.xhtml") {
+ @Override
+ protected void invokeApplication() throws Exception {
+ Manager.instance().beginConversation();
+ }
+
+ @Override
+ protected void renderResponse() throws Exception {
+ List<ConversationEntry> entries = (List<ConversationEntry>) getValue("#{conversationList}");
+ assert entries.size() == 3;
+ }
+ }.run();
+
+
+ new FacesRequest("/pageWithDescription", conv2) {
+ @Override
+ protected void invokeApplication() throws Exception {
+ Manager.instance().endConversation(true);
+ }
+
+ @Override
+ protected void renderResponse() throws Exception {
+ List<ConversationEntry> entries = (List<ConversationEntry>) getValue("#{conversationList}");
+ assert entries.size() == 2;
+ }
+ }.run();
+
+ new FacesRequest("/pageWithDescription", conv1) {
+ @Override
+ protected void invokeApplication() throws Exception {
+ Manager.instance().endConversation(true);
+ }
+
+ @Override
+ protected void renderResponse() throws Exception {
+ List<ConversationEntry> entries = (List<ConversationEntry>) getValue("#{conversationList}");
+ assert entries.size() == 1;
+ }
+ }.run();
+
+
+ new FacesRequest("/pageWithDescription", conv3) {
+ @Override
+ protected void invokeApplication() throws Exception {
+ Manager.instance().endConversation(true);
+ }
+
+ @Override
+ protected void renderResponse() throws Exception {
+ List<ConversationEntry> entries = (List<ConversationEntry>) getValue("#{conversationList}");
+ assert entries.size() == 0;
+ }
+ }.run();
+ }
+
+
+ @Test
+ public void switcher()
+ throws Exception
+ {
+ new FacesRequest("/pageWithDescription.xhtml") {
+ @Override
+ protected void renderResponse() throws Exception {
+ Switcher switcher = (Switcher) getValue("#{switcher}");
+ assert switcher.getSelectItems().size() == 0;
+ assert switcher.getConversationIdOrOutcome() == null;
+ }
+ }.run();
+
+
+ final String conv1 = new FacesRequest("/pageWithDescription.xhtml") {
+ @Override
+ protected void invokeApplication() throws Exception {
+ Manager.instance().beginConversation();
+ }
+
+ @Override
+ protected void renderResponse() throws Exception {
+ Switcher switcher = (Switcher) getValue("#{switcher}");
+ assert switcher.getSelectItems().size() == 1;
+ }
+ }.run();
+
+ final String conv2 = new FacesRequest("/pageWithDescription.xhtml") {
+ @Override
+ protected void invokeApplication() throws Exception {
+ Manager.instance().beginConversation();
+ }
+
+ @Override
+ protected void renderResponse() throws Exception {
+ Switcher switcher = (Switcher) getValue("#{switcher}");
+ assert switcher.getSelectItems().size() == 2;
+ }
+ }.run();
+
+ final String conv3 = new FacesRequest("/pageWithDescription.xhtml") {
+ @Override
+ protected void invokeApplication() throws Exception {
+ Manager.instance().beginConversation();
+ }
+
+ @Override
+ protected void renderResponse() throws Exception {
+ Switcher switcher = (Switcher) getValue("#{switcher}");
+ assert switcher.getSelectItems().size() == 3;
+ }
+ }.run();
+
+ new FacesRequest() {
+ @Override
+ protected void renderResponse() throws Exception {
+ Switcher switcher = (Switcher) getValue("#{switcher}");
+ assert switcher.getSelectItems().size() == 3;
+
+ List<SelectItem> items = switcher.getSelectItems();
+ List<String> values = new ArrayList<String>();
+ for (SelectItem item: items) {
+ assert item.getLabel().equals("page description");
+ values.add((String) item.getValue());
+ }
+
+ assert values.contains(conv1);
+ assert values.contains(conv2);
+ assert values.contains(conv3);
+ }
+ }.run();
+
+ new FacesRequest("/pageWithDescription.xhtml", conv1) {
+ @Override
+ protected void invokeApplication() throws Exception {
+ Manager.instance().endConversation(true);
+ }
+ }.run();
+
+ new FacesRequest("/pageWithDescription.xhtml", conv2) {
+ @Override
+ protected void invokeApplication() throws Exception {
+ Manager.instance().endConversation(true);
+ }
+
+ @Override
+ protected void renderResponse() throws Exception {
+ Switcher switcher = (Switcher) getValue("#{switcher}");
+ assert switcher.getSelectItems().size() == 1;
+ assert switcher.getSelectItems().get(0).getLabel().equals("page description");
+ assert switcher.getSelectItems().get(0).getValue().equals(conv3);
+ }
+ }.run();
+
+ new FacesRequest("/pageWithAnotherDescription.xhtml", conv3) {
+ @Override
+ protected void renderResponse() throws Exception {
+ Switcher switcher = (Switcher) getValue("#{switcher}");
+ assert switcher.getSelectItems().size() == 1;
+
+ assert switcher.getSelectItems().get(0).getLabel().equals("another page description");
+ assert switcher.getSelectItems().get(0).getValue().equals(conv3);
+ }
+ }.run();
+ }
+
+ @Test
+ public void killAllOthers() throws Exception
+ {
+ new FacesRequest("/pageWithAnotherDescription.xhtml") {
+ @Override
+ protected void invokeApplication() throws Exception
+ {
+ Manager.instance().beginConversation();
+ }
+
+ @Override
+ protected void renderResponse() throws Exception
+ {
+ assert ConversationEntries.instance().size() == 1;
+ }
+ }.run();
+
+ new FacesRequest("/pageWithoutDescription.xhtml") {
+ @Override
+ protected void invokeApplication() throws Exception
+ {
+ Manager.instance().beginConversation();
+ }
+
+ @Override
+ protected void renderResponse() throws Exception
+ {
+ assert ConversationEntries.instance().size() == 2;
+ }
+ }.run();
+
+ new FacesRequest("/pageWithDescription.xhtml") {
+ @Override
+ protected void invokeApplication() throws Exception
+ {
+ Manager.instance().beginConversation();
+ Manager.instance().killAllOtherConversations();
+ }
+
+ @Override
+ protected void renderResponse() throws Exception
+ {
+ assert ConversationEntries.instance().size() == 1;
+ }
+ }.run();
+
+ }
+
+ @Test
+ public void nestedKillAllOthers() throws Exception
+ {
+
+ final String unrelated = new FacesRequest("/pageWithoutDescription.xhtml") {
+ @Override
+ protected void invokeApplication() throws Exception
+ {
+ Manager.instance().beginConversation();
+ }
+
+ @Override
+ protected void renderResponse() throws Exception
+ {
+ assert ConversationEntries.instance().size() == 1;
+ }
+ }.run();
+
+ String root = new FacesRequest("/pageWithDescription.xhtml") {
+ @Override
+ protected void invokeApplication() throws Exception
+ {
+ Manager.instance().beginConversation();
+ }
+
+ @Override
+ protected void renderResponse() throws Exception
+ {
+ assert ConversationEntries.instance().size() == 2;
+ }
+ }.run();
+
+ // nested conversation
+ new FacesRequest("/pageWithDescription.xhtml", root) {
+ @Override
+ protected void invokeApplication() throws Exception
+ {
+ Manager.instance().beginNestedConversation();
+ }
+
+ @Override
+ protected void renderResponse() throws Exception
+ {
+ assert ConversationEntries.instance().size() == 3;
+
+ Manager.instance().killAllOtherConversations();
+ assert ConversationEntries.instance().size() == 2;
+ assert ConversationEntries.instance().getConversationIds()
+ .contains(unrelated) == false;
+ }
+
+ }.run();
+ }
+}
Added: branches/community/Seam_2_3/seam-integration-tests-ee6/src/test/java/org/jboss/seam/test/integration/Country.java
===================================================================
--- branches/community/Seam_2_3/seam-integration-tests-ee6/src/test/java/org/jboss/seam/test/integration/Country.java (rev 0)
+++ branches/community/Seam_2_3/seam-integration-tests-ee6/src/test/java/org/jboss/seam/test/integration/Country.java 2012-02-28 13:53:30 UTC (rev 14333)
@@ -0,0 +1,54 @@
+package org.jboss.seam.test.integration;
+
+import javax.persistence.Entity;
+import javax.persistence.GeneratedValue;
+import javax.persistence.Id;
+
+/**
+ * @author Pete Muir
+ *
+ */
+ at Entity
+public class Country
+{
+
+ @Id @GeneratedValue
+ private Integer id;
+
+ private String name;
+
+ /**
+ * @return the id
+ */
+ public Integer getId()
+ {
+ return this.id;
+ }
+
+ /**
+ * @param id the id to set
+ */
+ public void setId(Integer id)
+ {
+ this.id = id;
+ }
+
+ /**
+ * @return the name
+ */
+ public String getName()
+ {
+ return this.name;
+ }
+
+ /**
+ * @param name the name to set
+ */
+ public void setName(String name)
+ {
+ this.name = name;
+ }
+
+
+
+}
Added: branches/community/Seam_2_3/seam-integration-tests-ee6/src/test/java/org/jboss/seam/test/integration/CountryHome.java
===================================================================
--- branches/community/Seam_2_3/seam-integration-tests-ee6/src/test/java/org/jboss/seam/test/integration/CountryHome.java (rev 0)
+++ branches/community/Seam_2_3/seam-integration-tests-ee6/src/test/java/org/jboss/seam/test/integration/CountryHome.java 2012-02-28 13:53:30 UTC (rev 14333)
@@ -0,0 +1,14 @@
+package org.jboss.seam.test.integration;
+
+import org.jboss.seam.annotations.Name;
+import org.jboss.seam.framework.EntityHome;
+
+/**
+ * @author Pete Muir
+ *
+ */
+ at Name("countryHome")
+public class CountryHome extends EntityHome<Country>
+{
+
+}
Added: branches/community/Seam_2_3/seam-integration-tests-ee6/src/test/java/org/jboss/seam/test/integration/Deployments.java
===================================================================
--- branches/community/Seam_2_3/seam-integration-tests-ee6/src/test/java/org/jboss/seam/test/integration/Deployments.java (rev 0)
+++ branches/community/Seam_2_3/seam-integration-tests-ee6/src/test/java/org/jboss/seam/test/integration/Deployments.java 2012-02-28 13:53:30 UTC (rev 14333)
@@ -0,0 +1,82 @@
+package org.jboss.seam.test.integration;
+
+import org.jboss.seam.test.integration.bpm.SeamExpressionEvaluatorTestController;
+import org.jboss.shrinkwrap.api.Archive;
+import org.jboss.shrinkwrap.api.ShrinkWrap;
+import org.jboss.shrinkwrap.api.asset.StringAsset;
+import org.jboss.shrinkwrap.api.spec.WebArchive;
+
+import org.jboss.shrinkwrap.resolver.api.DependencyResolvers;
+import org.jboss.shrinkwrap.resolver.api.maven.MavenDependencyResolver;
+
+public class Deployments {
+ public static WebArchive defaultSeamDeployment() {
+ return ShrinkWrap.create(WebArchive.class, "test.war")
+ .addAsWebInfResource(new StringAsset(
+ "<jboss-deployment-structure>" +
+ "<deployment>" +
+ "<dependencies>" +
+ "<module name=\"org.javassist\"/>" +
+ "<module name=\"org.dom4j\"/>" +
+ "</dependencies>" +
+ "</deployment>" +
+ "</jboss-deployment-structure>"), "jboss-deployment-structure.xml")
+ .addAsResource("seam.properties")
+ .addAsResource("components.properties")
+ .addAsResource("messages_en.properties")
+ .addAsResource("META-INF/persistence.xml")
+
+ //.addAsWebInfResource(new StringAsset("org.jboss.seam.mock.MockFacesContextFactory"), "classes/META-INF/services/javax.faces.context.FacesContextFactory")
+ //.addAsWebInfResource(new StringAsset("org.jboss.seam.mock.MockApplicationFactory"), "classes/META-INF/services/javax.faces.application.ApplicationFactory")
+
+ .addAsResource("hibernate.cfg.xml")
+ .addAsWebInfResource("WEB-INF/components.xml", "components.xml")
+ .addAsWebInfResource("WEB-INF/pages.xml", "pages.xml")
+
+ .addAsWebInfResource("WEB-INF/web.xml", "web.xml")
+
+ .addAsLibraries(DependencyResolvers.use(MavenDependencyResolver.class)
+ .configureFrom("pom.xml")
+ .goOffline()
+ .artifact("org.jboss.seam:jboss-seam-jsf2:2.3.0-SNAPSHOT")
+ .resolveAsFiles());
+ }
+
+ public static WebArchive jbpmSeamDeployment() {
+ return ShrinkWrap.create(WebArchive.class, "test.war")
+ .addAsWebInfResource(new StringAsset(
+ "<jboss-deployment-structure>" +
+ "<deployment>" +
+ "<dependencies>" +
+ "<module name=\"org.javassist\"/>" +
+ "<module name=\"org.dom4j\"/>" +
+ "<module name=\"org.apache.commons.collections\"/>" +
+ "</dependencies>" +
+ "</deployment>" +
+ "</jboss-deployment-structure>"), "jboss-deployment-structure.xml")
+ .addAsResource("seam.properties")
+ .addAsResource("components.properties")
+ .addAsResource("messages_en.properties")
+ .addAsResource("META-INF/persistence.xml")
+ .addAsResource("testProcess1.jpdl.xml")
+ .addAsResource("testProcess2.jpdl.xml")
+ .addAsResource("testProcess3.jpdl.xml")
+ .addAsResource("testProcess4.jpdl.xml")
+
+ .addAsResource("jbpm.cfg.xml")
+
+ .addAsResource("hibernate.cfg.xml")
+ .addAsWebInfResource("WEB-INF/components-jbpm.xml", "components.xml")
+ .addAsWebInfResource("WEB-INF/pages.xml", "pages.xml")
+
+ .addAsWebInfResource("WEB-INF/web.xml", "web.xml")
+
+ .addAsLibraries(DependencyResolvers.use(MavenDependencyResolver.class)
+ .configureFrom("pom.xml")
+ .goOffline()
+ .artifact("org.jboss.seam:jboss-seam-jsf2:2.3.0-SNAPSHOT")
+ .artifact("org.jbpm.jbpm3:jbpm-jpdl:3.2.10.SP3-seam2")
+ .exclusion("org.hibernate:hibernate-core")
+ .resolveAsFiles());
+ }
+}
Added: branches/community/Seam_2_3/seam-integration-tests-ee6/src/test/java/org/jboss/seam/test/integration/ELTest.java
===================================================================
--- branches/community/Seam_2_3/seam-integration-tests-ee6/src/test/java/org/jboss/seam/test/integration/ELTest.java (rev 0)
+++ branches/community/Seam_2_3/seam-integration-tests-ee6/src/test/java/org/jboss/seam/test/integration/ELTest.java 2012-02-28 13:53:30 UTC (rev 14333)
@@ -0,0 +1,143 @@
+package org.jboss.seam.test.integration;
+
+import javax.el.ELException;
+import javax.faces.el.MethodBinding;
+import javax.faces.el.ValueBinding;
+
+import org.jboss.arquillian.container.test.api.Deployment;
+import org.jboss.arquillian.container.test.api.OverProtocol;
+import org.jboss.arquillian.junit.Arquillian;
+import org.jboss.seam.jsf.UnifiedELMethodBinding;
+import org.jboss.seam.jsf.UnifiedELValueBinding;
+import org.jboss.seam.mock.JUnitSeamTest;
+import org.jboss.shrinkwrap.api.Archive;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+
+/**
+ *
+ * @author Pete Muir
+ *
+ */
+public class ELTest extends JUnitSeamTest
+{
+ @Test
+ public void testUnifiedELMethodBinding() throws Exception
+ {
+ new FacesRequest()
+ {
+ @SuppressWarnings("deprecation")
+ @Override
+ protected void invokeApplication() throws Exception
+ {
+ MethodBinding methodBinding = new UnifiedELMethodBinding("#{action.go}", new Class[0]);
+
+ assert "#{action.go}".equals(methodBinding.getExpressionString());
+
+ assert String.class.equals(methodBinding.getType(getFacesContext()));
+
+ Object result = methodBinding.invoke(getFacesContext(), new Object[0]);
+
+ assert result instanceof String;
+ assert "success".equals(result);
+ }
+ }.run();
+ }
+
+ @Test
+ public void testUnifiedELMethodBindingWithNull() throws Exception
+ {
+ new FacesRequest()
+ {
+ @SuppressWarnings("deprecation")
+ @Override
+ protected void invokeApplication() throws Exception
+ {
+
+ MethodBinding methodBinding = new UnifiedELMethodBinding("#{action.go}", null);
+
+ assert String.class.equals(methodBinding.getType(getFacesContext()));
+
+ Object result = methodBinding.invoke(getFacesContext(), null);
+
+ assert result instanceof String;
+ assert "success".equals(result);
+ }
+ }.run();
+ }
+
+ @Test
+ public void testEmptyUnifiedELMethodBinding() throws Exception
+ {
+ new FacesRequest()
+ {
+ @SuppressWarnings("deprecation")
+ @Override
+ protected void invokeApplication() throws Exception
+ {
+
+ MethodBinding methodBinding = new UnifiedELMethodBinding();
+ boolean failed = false;
+ try
+ {
+ methodBinding.invoke(getFacesContext(), null);
+ }
+ catch (ELException e) {
+ failed = true;
+ }
+ assert failed;
+ }
+ }.run();
+ }
+
+ @Test
+ public void testUnifiedELValueBinding() throws Exception
+ {
+ new FacesRequest()
+ {
+ @SuppressWarnings("deprecation")
+ @Override
+ protected void invokeApplication() throws Exception
+ {
+ ValueBinding valueBinding = new UnifiedELValueBinding("#{person.name}");
+
+ assert "#{person.name}".equals(valueBinding.getExpressionString());
+
+ assert !valueBinding.isReadOnly(getFacesContext());
+
+ assert String.class.equals(valueBinding.getType(getFacesContext()));
+
+ valueBinding.setValue(getFacesContext(), "Pete");
+
+ assert "Pete".equals(valueBinding.getValue(getFacesContext()));
+ }
+ }.run();
+ }
+
+ @Test
+ public void testEmptyUnifiedELValueBinding() throws Exception
+ {
+ new FacesRequest()
+ {
+ @SuppressWarnings("deprecation")
+ @Override
+ protected void invokeApplication() throws Exception
+ {
+
+ ValueBinding valueBinding = new UnifiedELValueBinding();
+ boolean failed = false;
+ try
+ {
+ valueBinding.setValue(getFacesContext(), "Pete");
+ valueBinding.getValue(getFacesContext());
+ }
+ catch (ELException e) {
+ failed = true;
+ }
+ assert failed;
+ }
+ }.run();
+ }
+
+}
Added: branches/community/Seam_2_3/seam-integration-tests-ee6/src/test/java/org/jboss/seam/test/integration/EntityPassivationTest.java
===================================================================
--- branches/community/Seam_2_3/seam-integration-tests-ee6/src/test/java/org/jboss/seam/test/integration/EntityPassivationTest.java (rev 0)
+++ branches/community/Seam_2_3/seam-integration-tests-ee6/src/test/java/org/jboss/seam/test/integration/EntityPassivationTest.java 2012-02-28 13:53:30 UTC (rev 14333)
@@ -0,0 +1,265 @@
+package org.jboss.seam.test.integration;
+
+import java.io.Serializable;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import javax.persistence.EntityManager;
+
+import org.jboss.arquillian.container.test.api.Deployment;
+import org.jboss.arquillian.container.test.api.OverProtocol;
+import org.jboss.arquillian.junit.Arquillian;
+import org.jboss.seam.Component;
+import org.jboss.seam.ScopeType;
+import org.jboss.seam.annotations.AutoCreate;
+import org.jboss.seam.annotations.Begin;
+import org.jboss.seam.annotations.In;
+import org.jboss.seam.annotations.Name;
+import org.jboss.seam.annotations.Scope;
+import org.jboss.seam.contexts.Contexts;
+import org.jboss.seam.core.Conversation;
+import org.jboss.seam.mock.JUnitSeamTest;
+import org.jboss.seam.persistence.ManagedEntityInterceptor;
+import org.jboss.shrinkwrap.api.Archive;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+/**
+ * Verifies the work of the ManagedEntityInterceptor. Specifically that
+ * collections containing entity instances are properly put into the session and
+ * pulled back into the conversation-scoped component between requests (during a
+ * potential period of passivation of the SFSB). The test also verifies that
+ * when a component in a nested conversation calls a component in a parent
+ * conversation, that the passivated state is kept with the parent conversation.
+ *
+ * @author Norman Richards
+ * @author Dan Allen
+ */
+ at RunWith(Arquillian.class)
+public class EntityPassivationTest extends JUnitSeamTest
+{
+ @Deployment(name="EntityPassivationTest")
+ @OverProtocol("Servlet 3.0")
+ public static Archive<?> createDeployment()
+ {
+ return Deployments.defaultSeamDeployment()
+ .addClasses(SomeComponent.class, NestedComponent.class, UnversionedThing.class);
+ }
+
+ @Test
+ public void testEntityList() throws Exception
+ {
+ String pid = new FacesRequest("/test.xhtml")
+ {
+ @Override
+ protected void invokeApplication() throws Exception
+ {
+ // MEI is not installed by default, so we need to enable it
+ Component.forName("entitytest.someComponent").addInterceptor(new ManagedEntityInterceptor());
+ Component.forName("entitytest.nestedComponent").addInterceptor(new ManagedEntityInterceptor());
+
+ Conversation.instance().begin(true, false);
+
+ invokeAction("#{entitytest.someComponent.createSomeThings}");
+ invokeAction("#{entitytest.someComponent.loadThings}");
+ }
+
+ @Override
+ protected void renderResponse() throws Exception
+ {
+ Object thing = getValue("#{entitytest.someComponent.thing}");
+ assert thing != null;
+
+ List thingList = (List) getValue("#{entitytest.someComponent.thingsAsList}");
+ assert thingList != null && !thingList.isEmpty();
+ assert thingList.get(0) != null;
+
+ Set thingSet = (Set) getValue("#{entitytest.someComponent.thingsAsSet}");
+ assert thingSet != null && thingSet.size() > 0;
+ assert thingSet.iterator().next() != null;
+
+ Map thingMap = (Map) getValue("#{entitytest.someComponent.thingsAsMap}");
+ assert thingMap != null && thingMap.size() > 0;
+ }
+ }.run();
+
+ new FacesRequest("/test.xhtml", pid)
+ {
+ // the entities should be passivated
+ }.run();
+
+ new FacesRequest("/test.xhtml", pid)
+ {
+ // passivated a second time
+ }.run();
+
+ new FacesRequest("/test.xhtml", pid)
+ {
+ @Override
+ protected void renderResponse() throws Exception
+ {
+ Object thing = getValue("#{entitytest.someComponent.thing}");
+ assert thing != null;
+
+ List thingList = (List) getValue("#{entitytest.someComponent.thingsAsList}");
+ assert thingList != null && !thingList.isEmpty();
+ assert thingList.get(0) != null;
+
+ Set thingSet = (Set) getValue("#{entitytest.someComponent.thingsAsSet}");
+ assert thingSet != null && thingSet.size() > 0;
+ assert thingSet.iterator().next() != null;
+
+ Map thingMap = (Map) getValue("#{entitytest.someComponent.thingsAsMap}");
+ assert thingMap != null && thingMap.size() > 0;
+ }
+
+ }.run();
+
+ // Start a nested conversation to verify that calls to a component in a parent conversation
+ // will passivate that component's state in the parent conversation context and not in
+ // the nested conversation. Thus, when the parent conversation is restored, its state
+ // will be properly restored.
+ String nid = new FacesRequest("/test.xhtml", pid)
+ {
+ @Override
+ protected void invokeApplication() throws Exception
+ {
+ invokeMethod("#{entitytest.nestedComponent.nest}");
+ }
+
+ @Override
+ protected void renderResponse() throws Exception
+ {
+ assert Conversation.instance().isNested();
+ }
+
+ }.run();
+
+ new FacesRequest("/test.xhtml", nid)
+ {
+ @Override
+ protected void invokeApplication() throws Exception
+ {
+ // invoke component in parent conversation from nested conversation
+ invokeMethod("#{entitytest.someComponent.removeFirstThingFromList}");
+ }
+
+ @Override
+ protected void renderResponse() throws Exception
+ {
+ // the nested conversation should not hold the serialized property of the component in the parent conversation
+ assert !Arrays.asList(Contexts.getConversationContext().getNames()).contains("entitytest.someComponent.thingList");
+ List thingList = (List) getValue("#{entitytest.someComponent.thingsAsList}");
+ assert thingList.size() == 1;
+ }
+ }.run();
+
+ new FacesRequest("/test.xhtml", nid)
+ {
+ @Override
+ protected void invokeApplication() throws Exception
+ {
+ invokeMethod("#{entitytest.nestedComponent.end}");
+ }
+ }.run();
+
+ new FacesRequest("/test.xhtml", pid)
+ {
+ @Override
+ protected void renderResponse() throws Exception
+ {
+ // The state of the component in the parent conversation should be preserved.
+ List thingList = (List) getValue("#{entitytest.someComponent.thingsAsList}");
+ assert thingList.size() == 1;
+ }
+ }.run();
+ }
+
+ @Name("entitytest.someComponent")
+ @Scope(ScopeType.CONVERSATION)
+ @AutoCreate
+ public static class SomeComponent implements Serializable
+ {
+ @In
+ EntityManager entityManager;
+
+ Set<UnversionedThing> thingSet;
+ List<UnversionedThing> thingList;
+ Map<Long, UnversionedThing> thingMap;
+ UnversionedThing thing;
+
+ public void loadThings()
+ {
+ thingList = entityManager.createQuery("select t from UnversionedThing t").getResultList();
+ thingSet = new HashSet<UnversionedThing>(thingList);
+
+ thingMap = new HashMap<Long, UnversionedThing>();
+ for (UnversionedThing thing : thingList)
+ {
+ thingMap.put(thing.getId(), thing);
+ }
+
+ thing = thingList.get(0);
+ }
+
+ public List<UnversionedThing> getThingsAsList()
+ {
+ return thingList;
+ }
+
+ public Set<UnversionedThing> getThingsAsSet()
+ {
+ return thingSet;
+ }
+
+ public Map<Long, UnversionedThing> getThingsAsMap()
+ {
+ return thingMap;
+ }
+
+ public UnversionedThing getThing()
+ {
+ return thing;
+ }
+
+ public void removeFirstThingFromList()
+ {
+ loadThings();
+ thingList.remove(0);
+ }
+
+ public void createSomeThings()
+ {
+ UnversionedThing thing1 = new UnversionedThing();
+ thing1.setName("thing one");
+ entityManager.persist(thing1);
+
+ UnversionedThing thing2 = new UnversionedThing();
+ thing2.setName("thing two");
+ entityManager.persist(thing2);
+ }
+ }
+
+ @Name("entitytest.nestedComponent")
+ @Scope(ScopeType.CONVERSATION)
+ @AutoCreate
+ public static class NestedComponent implements Serializable
+ {
+ @In
+ EntityManager entityManager;
+
+ @Begin(nested = true)
+ public void nest()
+ {
+ }
+
+ public void end()
+ {
+ Conversation.instance().end();
+ }
+ }
+}
Added: branches/community/Seam_2_3/seam-integration-tests-ee6/src/test/java/org/jboss/seam/test/integration/EntityTest.java
===================================================================
--- branches/community/Seam_2_3/seam-integration-tests-ee6/src/test/java/org/jboss/seam/test/integration/EntityTest.java (rev 0)
+++ branches/community/Seam_2_3/seam-integration-tests-ee6/src/test/java/org/jboss/seam/test/integration/EntityTest.java 2012-02-28 13:53:30 UTC (rev 14333)
@@ -0,0 +1,166 @@
+package org.jboss.seam.test.integration;
+
+import org.jboss.arquillian.container.test.api.Deployment;
+import org.jboss.arquillian.container.test.api.OverProtocol;
+import org.jboss.arquillian.junit.Arquillian;
+import org.jboss.seam.mock.JUnitSeamTest;
+import java.util.HashMap;
+import java.util.Map;
+
+import javax.persistence.EntityManager;
+
+import org.jboss.seam.annotations.Name;
+import org.jboss.seam.annotations.Observer;
+import org.jboss.seam.contexts.Contexts;
+import org.jboss.seam.core.Manager;
+import org.jboss.shrinkwrap.api.Archive;
+import org.junit.Assert;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+ at RunWith(Arquillian.class)
+public class EntityTest
+ extends JUnitSeamTest
+{
+ @Deployment(name="EntityTest")
+ @OverProtocol("Servlet 3.0")
+ public static Archive<?> createDeployment()
+ {
+ return Deployments.defaultSeamDeployment()
+ .addClasses(Thing.class);
+ }
+
+ @Test
+ public void entityUpdatedInNestedConversation() throws Exception {
+ String parentConversation = new FacesRequest("/page.xhtml") {
+ @Override
+ protected void invokeApplication() throws Exception {
+ Thing thing = new Thing();
+ thing.setName("thing");
+ EntityManager entityManager = (EntityManager) getValue("#{entityManager}");
+ entityManager.persist(thing);
+ Contexts.getConversationContext().set("thing", thing);
+ Manager.instance().beginConversation();
+ }
+ }.run();
+
+
+ new FacesRequest("/page.xhtml", parentConversation) {
+ }.run();
+
+ // nested conversation
+ String nestedId = new FacesRequest("/page.xhtml", parentConversation) {
+ @Override
+ protected void invokeApplication() throws Exception {
+ Manager.instance().beginNestedConversation();
+ }
+ }.run();
+
+ // update entity in nested conversation
+ new FacesRequest("/page.xhtml", nestedId) {
+ @Override
+ protected void invokeApplication() throws Exception {
+ Thing thing = (Thing) Contexts.getConversationContext().get("thing");
+ thing.setName("foo");
+ EntityManager entityManager = (EntityManager) getValue("#{entityManager}");
+ entityManager.flush();
+ }
+ }.run();
+
+ // end nested conversation
+ assert new FacesRequest("/page.xhtml", nestedId) {
+ @Override
+ protected void invokeApplication() throws Exception {
+ Manager.instance().endConversation(false);
+ }
+ }.run().equals(parentConversation);
+
+
+ // This tests that the activation in the parent conversation
+ // doesn't fail
+ new FacesRequest("/page.xhtml",parentConversation) {
+ @Override
+ protected void renderResponse() throws Exception {
+ Thing thing = (Thing) Contexts.getConversationContext().get("thing");
+ assert thing.getName().equals("foo");
+ }
+ }.run();
+ }
+
+ @Test
+ public void testStale() throws Exception {
+
+ final Map<String, Long> holder = new HashMap<String, Long>();
+
+ final String conversation1 = new FacesRequest("/page.xhtml") {
+ @Override
+ protected void invokeApplication() throws Exception {
+ Thing thing = new Thing();
+ thing.setName("thing");
+ EntityManager entityManager = (EntityManager) getValue("#{entityManager}");
+ entityManager.persist(thing);
+ holder.put("id", thing.getId());
+ Contexts.getConversationContext().set("thing", thing);
+ Manager.instance().beginConversation();
+ }
+ }.run();
+
+ new FacesRequest("/page.xhtml", conversation1) {
+ }.run();
+
+ // update in second conversation
+ new FacesRequest("/page.xhtml") {
+ @Override
+ @SuppressWarnings("cast")
+ protected void invokeApplication() throws Exception {
+ EntityManager entityManager = (EntityManager) getValue("#{entityManager}");
+ Thing thing = (Thing) entityManager.find(Thing.class, holder.get("id"));
+ thing.setName("foo");
+ entityManager.flush();
+ }
+ }.run();
+
+ new FacesRequest("/page.xhtml", conversation1) {
+ EntityExceptionObserver observer;
+
+ @Override
+ protected void invokeApplication() throws Exception {
+ Thing thing = (Thing) Contexts.getConversationContext().get("thing");
+ thing.setName("bar");
+
+ observer = (EntityExceptionObserver) getValue("#{entityExceptionObserver}");
+ assert observer != null;
+ }
+
+ @Override
+ protected void renderResponse() throws Exception {
+ Assert.fail("page rendered without redirect, expected StaleStateException!");
+ }
+
+ @Override
+ protected void afterRequest() {
+ assert observer.getOptimisticLockExceptionSeen();
+ }
+ }.run();
+ }
+
+ @Name("entityExceptionObserver")
+ public static class EntityExceptionObserver {
+
+ private boolean exceptionSeen;
+
+ @Observer(value="org.jboss.seam.exceptionHandled.javax.persistence.OptimisticLockException")
+ public void handleException(Exception e) {
+ exceptionSeen=true;
+ }
+
+ public boolean getOptimisticLockExceptionSeen() {
+ return exceptionSeen;
+ }
+
+ @Override
+ public String toString() {
+ return "EntityExceptionObserver[" + exceptionSeen + "]";
+ }
+ }
+}
Added: branches/community/Seam_2_3/seam-integration-tests-ee6/src/test/java/org/jboss/seam/test/integration/EventTest.java
===================================================================
--- branches/community/Seam_2_3/seam-integration-tests-ee6/src/test/java/org/jboss/seam/test/integration/EventTest.java (rev 0)
+++ branches/community/Seam_2_3/seam-integration-tests-ee6/src/test/java/org/jboss/seam/test/integration/EventTest.java 2012-02-28 13:53:30 UTC (rev 14333)
@@ -0,0 +1,61 @@
+package org.jboss.seam.test.integration;
+
+import org.jboss.arquillian.container.test.api.Deployment;
+import org.jboss.arquillian.container.test.api.OverProtocol;
+import org.jboss.arquillian.junit.Arquillian;
+import org.jboss.seam.Component;
+import org.jboss.seam.core.Events;
+import org.jboss.seam.mock.JUnitSeamTest;
+import org.jboss.shrinkwrap.api.Archive;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+
+/**
+ *
+ * @author Pete Muir
+ *
+ */
+ at RunWith(Arquillian.class)
+public class EventTest extends JUnitSeamTest {
+
+ @Deployment(name="IdentifierTest")
+ @OverProtocol("Servlet 3.0")
+ public static Archive<?> createDeployment()
+ {
+ return Deployments.defaultSeamDeployment()
+ .addClasses(BeanA.class, BeanB.class);
+ }
+
+ @Test
+ public void testEventChain() throws Exception {
+
+ new FacesRequest("/index.xhtml") {
+
+ @Override
+ protected void invokeApplication() throws Exception {
+ BeanA beanA = (BeanA) Component.getInstance("beanA");
+ BeanB beanB = (BeanB) Component.getInstance("beanB");
+
+ assert "Foo".equals(beanA.getMyValue());
+ assert beanB.getMyValue() == null;
+
+ Events.instance().raiseEvent("BeanA.refreshMyValue");
+
+ beanA = (BeanA) Component.getInstance("beanA");
+
+ assert "Bar".equals(beanA.getMyValue());
+ }
+
+ @Override
+ protected void renderResponse() throws Exception
+ {
+ BeanB beanB = (BeanB) Component.getInstance("beanB");
+ assert "Bar".equals(beanB.getMyValue());
+ }
+ }.run();
+ }
+
+}
+
+
Added: branches/community/Seam_2_3/seam-integration-tests-ee6/src/test/java/org/jboss/seam/test/integration/Foo.java
===================================================================
--- branches/community/Seam_2_3/seam-integration-tests-ee6/src/test/java/org/jboss/seam/test/integration/Foo.java (rev 0)
+++ branches/community/Seam_2_3/seam-integration-tests-ee6/src/test/java/org/jboss/seam/test/integration/Foo.java 2012-02-28 13:53:30 UTC (rev 14333)
@@ -0,0 +1,94 @@
+/*
+ * JBoss, Home of Professional Open Source
+ *
+ * Distributable under LGPL license.
+ * See terms of license at gnu.org.
+ */
+package org.jboss.seam.test.integration;
+
+import java.io.Serializable;
+
+import javax.ejb.Remove;
+
+import javax.validation.constraints.NotNull;
+import org.jboss.seam.ScopeType;
+import org.jboss.seam.annotations.Begin;
+import org.jboss.seam.annotations.End;
+import org.jboss.seam.annotations.Name;
+import org.jboss.seam.annotations.Scope;
+
+/**
+ * @author <a href="mailto:theute at jboss.org">Thomas Heute </a>
+ * @version $Revision: 6435 $
+ */
+ at Name("foo")
+ at Scope(ScopeType.SESSION)
+ at SuppressWarnings("deprecation")
+public class Foo implements Serializable
+{
+ private static final long serialVersionUID = -5448030633067107049L;
+
+ private String value;
+
+ public String foo() { return "foo"; }
+
+ @Remove
+ public void destroy() {}
+
+ @NotNull
+ public String getValue()
+ {
+ return value;
+ }
+
+ public void setValue(String value)
+ {
+ this.value = value;
+ }
+
+ public String bar()
+ {
+ return "bar";
+ }
+
+ @Begin
+ public String begin()
+ {
+ return "begun";
+ }
+ @End
+ public String end()
+ {
+ return "ended";
+ }
+
+ @Begin
+ public String beginNull()
+ {
+ return null;
+ }
+ @End
+ public String endNull()
+ {
+ return null;
+ }
+
+ @Begin
+ public void beginVoid() { }
+ @End
+ public void endVoid() { }
+
+ @Begin(ifOutcome="success")
+ public String beginIf()
+ {
+ return "success";
+ }
+ @End(ifOutcome="success")
+ public String endIf()
+ {
+ return "success";
+ }
+
+}
+
+
Added: branches/community/Seam_2_3/seam-integration-tests-ee6/src/test/java/org/jboss/seam/test/integration/IdentifierTest.java
===================================================================
--- branches/community/Seam_2_3/seam-integration-tests-ee6/src/test/java/org/jboss/seam/test/integration/IdentifierTest.java (rev 0)
+++ branches/community/Seam_2_3/seam-integration-tests-ee6/src/test/java/org/jboss/seam/test/integration/IdentifierTest.java 2012-02-28 13:53:30 UTC (rev 14333)
@@ -0,0 +1,77 @@
+package org.jboss.seam.test.integration;
+
+import javax.persistence.EntityManager;
+
+import org.hibernate.Session;
+import org.jboss.arquillian.container.test.api.Deployment;
+import org.jboss.arquillian.container.test.api.OverProtocol;
+import org.jboss.arquillian.junit.Arquillian;
+import org.jboss.seam.framework.EntityIdentifier;
+import org.jboss.seam.framework.HibernateEntityIdentifier;
+import org.jboss.seam.mock.JUnitSeamTest;
+import org.jboss.shrinkwrap.api.Archive;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+/**
+ * @author Pete Muir
+ *
+ */
+ at RunWith(Arquillian.class)
+public class IdentifierTest extends JUnitSeamTest
+{
+ @Deployment(name="IdentifierTest")
+ @OverProtocol("Servlet 3.0")
+ public static Archive<?> createDeployment()
+ {
+ return Deployments.defaultSeamDeployment()
+ .addClasses(Country.class, CountryHome.class);
+ }
+
+ @Test
+ public void testEntityIdentifier() throws Exception
+ {
+ new ComponentTest()
+ {
+
+ @Override
+ protected void testComponents() throws Exception
+ {
+ setValue("#{countryHome.instance.name}", "foo");
+ invokeMethod("#{countryHome.persist}");
+ Country country = (Country) getValue("#{countryHome.instance}");
+ EntityManager entityManager = (EntityManager) getValue("#{countryHome.entityManager}");
+
+ EntityIdentifier entityIdentifier = new EntityIdentifier(country, entityManager);
+ assert "foo".equals(((Country) entityIdentifier.find(entityManager)).getName());
+ EntityIdentifier entityIdentifier2 = new EntityIdentifier(country, entityManager);
+ assert entityIdentifier.equals(entityIdentifier2);
+ }
+
+ }.run();
+ }
+
+ @Test
+ public void testHibernateEntityIdentifier() throws Exception
+ {
+ new ComponentTest()
+ {
+
+ @Override
+ protected void testComponents() throws Exception
+ {
+ setValue("#{countryHome.instance.name}", "foo");
+ invokeMethod("#{countryHome.persist}");
+ Country country = (Country) getValue("#{countryHome.instance}");
+ Session session = (Session) getValue("#{countryHome.entityManager.delegate}");
+
+ HibernateEntityIdentifier hibernateEntityIdentifier = new HibernateEntityIdentifier(country, session);
+ assert "foo".equals(((Country) hibernateEntityIdentifier.find(session)).getName());
+ HibernateEntityIdentifier hibernateEntityIdentifier2 = new HibernateEntityIdentifier(country, session);
+ assert hibernateEntityIdentifier.equals(hibernateEntityIdentifier2);
+ }
+
+ }.run();
+ }
+
+}
Added: branches/community/Seam_2_3/seam-integration-tests-ee6/src/test/java/org/jboss/seam/test/integration/ImportTest.java
===================================================================
--- branches/community/Seam_2_3/seam-integration-tests-ee6/src/test/java/org/jboss/seam/test/integration/ImportTest.java (rev 0)
+++ branches/community/Seam_2_3/seam-integration-tests-ee6/src/test/java/org/jboss/seam/test/integration/ImportTest.java 2012-02-28 13:53:30 UTC (rev 14333)
@@ -0,0 +1,57 @@
+package org.jboss.seam.test.integration;
+
+import org.jboss.arquillian.container.test.api.Deployment;
+import org.jboss.arquillian.container.test.api.OverProtocol;
+import org.jboss.arquillian.junit.Arquillian;
+import org.jboss.seam.annotations.Factory;
+import org.jboss.seam.annotations.Import;
+import org.jboss.seam.annotations.In;
+import org.jboss.seam.annotations.Name;
+import org.jboss.seam.mock.JUnitSeamTest;
+import org.jboss.shrinkwrap.api.Archive;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+ at RunWith(Arquillian.class)
+public class ImportTest
+ extends JUnitSeamTest
+{
+ @Deployment(name="IdentifierTest")
+ @OverProtocol("Servlet 3.0")
+ public static Archive<?> createDeployment()
+ {
+ return Deployments.defaultSeamDeployment()
+ .addClasses(Importer.class);
+ }
+
+ @Test
+ public void testImport()
+ throws Exception
+ {
+ new FacesRequest() {
+ @Override
+ protected void invokeApplication()
+ throws Exception
+ {
+ assert getValue("#{importTest.otherValue}").equals("foobar2");
+ }
+ }.run();
+ }
+
+
+ @Name("importTest")
+ @Import("importTest.ns2")
+ public static class Importer {
+ @In
+ String otherValue;
+
+ public String getOtherValue() {
+ return otherValue;
+ }
+
+ @Factory(value="importTest.ns2.otherValue", autoCreate=true)
+ public String createOtherValue() {
+ return "foobar2";
+ }
+ }
+}
Added: branches/community/Seam_2_3/seam-integration-tests-ee6/src/test/java/org/jboss/seam/test/integration/JavaBeanEqualsTest.java
===================================================================
--- branches/community/Seam_2_3/seam-integration-tests-ee6/src/test/java/org/jboss/seam/test/integration/JavaBeanEqualsTest.java (rev 0)
+++ branches/community/Seam_2_3/seam-integration-tests-ee6/src/test/java/org/jboss/seam/test/integration/JavaBeanEqualsTest.java 2012-02-28 13:53:30 UTC (rev 14333)
@@ -0,0 +1,43 @@
+package org.jboss.seam.test.integration;
+
+import org.jboss.arquillian.container.test.api.Deployment;
+import org.jboss.arquillian.container.test.api.OverProtocol;
+import org.jboss.arquillian.junit.Arquillian;
+import org.jboss.seam.mock.JUnitSeamTest;
+import org.jboss.shrinkwrap.api.Archive;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+/**
+ * @author Pete Muir
+ *
+ */
+ at RunWith(Arquillian.class)
+public class JavaBeanEqualsTest extends JUnitSeamTest
+{
+ @Deployment(name="JavaBeanEqualsTest")
+ @OverProtocol("Servlet 3.0")
+ public static Archive<?> createDeployment()
+ {
+ return Deployments.defaultSeamDeployment()
+ .addClasses(BeanA.class);
+ }
+
+ @Test
+ // Test for JBSEAM-1257
+ public void testReflexiveEquals() throws Exception
+ {
+ new ComponentTest()
+ {
+
+ @Override
+ protected void testComponents() throws Exception
+ {
+ assert getInstance("beanA").equals(getInstance("beanA"));
+ assert getValue("#{beanA.component}").equals(getValue("#{beanA.component}"));
+ }
+
+ }.run();
+ }
+
+}
Added: branches/community/Seam_2_3/seam-integration-tests-ee6/src/test/java/org/jboss/seam/test/integration/MessagingTest.java
===================================================================
--- branches/community/Seam_2_3/seam-integration-tests-ee6/src/test/java/org/jboss/seam/test/integration/MessagingTest.java (rev 0)
+++ branches/community/Seam_2_3/seam-integration-tests-ee6/src/test/java/org/jboss/seam/test/integration/MessagingTest.java 2012-02-28 13:53:30 UTC (rev 14333)
@@ -0,0 +1,170 @@
+package org.jboss.seam.test.integration;
+
+import javax.ejb.ActivationConfigProperty;
+import javax.ejb.MessageDriven;
+import javax.jms.JMSException;
+import javax.jms.Message;
+import javax.jms.MessageListener;
+import javax.jms.QueueSender;
+import javax.jms.QueueSession;
+import javax.jms.TextMessage;
+import javax.jms.TopicPublisher;
+import javax.jms.TopicSession;
+
+import org.jboss.arquillian.container.test.api.Deployment;
+import org.jboss.arquillian.container.test.api.OverProtocol;
+import org.jboss.arquillian.junit.Arquillian;
+import org.jboss.seam.annotations.In;
+import org.jboss.seam.annotations.Name;
+import org.jboss.seam.contexts.Contexts;
+import org.jboss.seam.mock.JUnitSeamTest;
+import org.jboss.shrinkwrap.api.Archive;
+import org.junit.Ignore;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+ at RunWith(Arquillian.class)
+ at Ignore
+public class MessagingTest
+ extends JUnitSeamTest
+{
+ @Deployment(name="MessagingTest")
+ @OverProtocol("Servlet 3.0")
+ public static Archive<?> createDeployment()
+ {
+ return Deployments.defaultSeamDeployment();
+ }
+
+ @Test
+ public void publishToTopic()
+ throws Exception
+ {
+ final SimpleReference<String> messageText = new SimpleReference<String>();
+
+ new FacesRequest() {
+ @Override
+ protected void invokeApplication()
+ throws Exception
+ {
+ Contexts.getApplicationContext().set("testMessage", messageText);
+ invokeAction("#{testTopic.publish}");
+ }
+ }.run();
+
+ // need to delay a bit to make sure the message is delivered
+ // might need
+ Thread.sleep(2000);
+
+ assert messageText.getValue().equals("message for topic");
+ }
+
+ @Test
+ public void sendToQueue()
+ throws Exception
+ {
+ final SimpleReference<String> messageText = new SimpleReference<String>();
+
+ new FacesRequest() {
+ @Override
+ protected void invokeApplication()
+ throws Exception
+ {
+ Contexts.getApplicationContext().set("testMessage", messageText);
+ invokeAction("#{testQueue.send}");
+ }
+ }.run();
+
+ // need to delay a bit to make sure the message is delivered
+ // might need
+ Thread.sleep(2000);
+
+ assert messageText.getValue().equals("message for queue");
+ }
+
+
+ @Name("testTopic")
+ public static class TopicBean {
+ @In
+ private TopicPublisher testPublisher;
+
+ @In
+ private TopicSession topicSession;
+
+ public void publish()
+ throws JMSException
+ {
+ testPublisher.publish(topicSession.createTextMessage("message for topic"));
+ }
+ }
+
+ @Name("testQueue")
+ public static class QueueBean {
+ @In
+ private QueueSender testSender;
+
+ @In
+ private QueueSession queueSession;
+
+ public void send() throws JMSException {
+ testSender.send(queueSession.createTextMessage("message for queue"));
+ }
+ }
+
+ @MessageDriven(activationConfig={
+ @ActivationConfigProperty(propertyName="destinationType", propertyValue="javax.jms.Topic"),
+ @ActivationConfigProperty(propertyName="destination", propertyValue="topic/testTopic")
+ })
+ @Name("testTopicListener")
+ static public class TestTopicListener
+ implements MessageListener
+ {
+ @In
+ private SimpleReference<String> testMessage;
+
+ public void onMessage(Message msg)
+ {
+ try {
+ testMessage.setValue(((TextMessage) msg).getText());
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+ }
+
+ @MessageDriven(activationConfig={
+ @ActivationConfigProperty(propertyName="destinationType", propertyValue="javax.jms.Queue"),
+ @ActivationConfigProperty(propertyName="destination", propertyValue="queue/testQueue")
+ })
+ @Name("testQueueListener")
+ static public class TestQueueListener
+ implements MessageListener
+ {
+ @In
+ private SimpleReference<String> testMessage;
+
+ public void onMessage(Message msg)
+ {
+ try {
+ testMessage.setValue(((TextMessage) msg).getText());
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+ }
+
+
+ static class SimpleReference<T> {
+ T value;
+ public SimpleReference() {
+ }
+ public SimpleReference(T value) {
+ setValue(value);
+ }
+ public T getValue() {
+ return value;
+ }
+ public void setValue(T value) {
+ this.value = value;
+ }
+ }
+}
Added: branches/community/Seam_2_3/seam-integration-tests-ee6/src/test/java/org/jboss/seam/test/integration/NamespaceResolverTest.java
===================================================================
--- branches/community/Seam_2_3/seam-integration-tests-ee6/src/test/java/org/jboss/seam/test/integration/NamespaceResolverTest.java (rev 0)
+++ branches/community/Seam_2_3/seam-integration-tests-ee6/src/test/java/org/jboss/seam/test/integration/NamespaceResolverTest.java 2012-02-28 13:53:30 UTC (rev 14333)
@@ -0,0 +1,64 @@
+package org.jboss.seam.test.integration;
+
+import org.jboss.arquillian.container.test.api.Deployment;
+import org.jboss.arquillian.container.test.api.OverProtocol;
+import org.jboss.arquillian.junit.Arquillian;
+import org.jboss.seam.init.NamespacePackageResolver;
+import org.jboss.seam.mock.JUnitSeamTest;
+import org.jboss.shrinkwrap.api.Archive;
+import org.junit.runner.RunWith;
+import org.junit.Assert;
+import org.junit.Test;
+
+ at RunWith(Arquillian.class)
+public class NamespaceResolverTest
+ extends JUnitSeamTest
+{
+ @Deployment(name="NamespaceResolverTest")
+ @OverProtocol("Servlet 3.0")
+ public static Archive<?> createDeployment()
+ {
+ return Deployments.defaultSeamDeployment();
+ }
+
+ NamespacePackageResolver resolver = new NamespacePackageResolver();
+
+ @Test
+ public void testResolver() {
+
+ test("java:foo", "foo");
+ test("java:com.company.department",
+ "com.company.department");
+ test("java:com.company.department.product",
+ "com.company.department.product");
+ test("http://www.company.com/department/product",
+ "com.company.department.product");
+ test("https://my-company.com/department/product",
+ "com.my_company.department.product");
+ test("http://ericjung:password@www.company.com:8080/foo/bar/baz#anchor?param1=332¶m2=334",
+ "com.company.foo.bar.baz");
+ test("http://cats.import.com",
+ "com.import.cats");
+
+
+ //testFail("http://bar#foo#com");
+
+ testFail("java:");
+
+ // need to think about this one
+ //testFail("java:foo!bar");
+
+ testFail("mailto:java-net at java.sun.com");
+ testFail("news:comp.lang.java");
+ testFail("urn:isbn:096139210x");
+
+ }
+
+ private void test(String namespace, String packageName) {
+ Assert.assertEquals(packageName, resolver.resolve(namespace));
+ }
+
+ private void testFail(String namespace) {
+ Assert.assertNull(namespace, resolver.resolve(namespace));
+ }
+}
Added: branches/community/Seam_2_3/seam-integration-tests-ee6/src/test/java/org/jboss/seam/test/integration/NamespaceTest.java
===================================================================
--- branches/community/Seam_2_3/seam-integration-tests-ee6/src/test/java/org/jboss/seam/test/integration/NamespaceTest.java (rev 0)
+++ branches/community/Seam_2_3/seam-integration-tests-ee6/src/test/java/org/jboss/seam/test/integration/NamespaceTest.java 2012-02-28 13:53:30 UTC (rev 14333)
@@ -0,0 +1,106 @@
+package org.jboss.seam.test.integration;
+
+import org.jboss.arquillian.container.test.api.Deployment;
+import org.jboss.arquillian.container.test.api.OverProtocol;
+import org.jboss.arquillian.junit.Arquillian;
+import org.jboss.seam.ScopeType;
+import org.jboss.seam.annotations.Factory;
+import org.jboss.seam.annotations.Name;
+import org.jboss.seam.annotations.Out;
+import org.jboss.seam.core.Init;
+import org.jboss.seam.mock.JUnitSeamTest;
+import org.jboss.shrinkwrap.api.Archive;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+public class NamespaceTest
+ extends JUnitSeamTest
+{
+ @Test
+ public void nameSpaceComponent()
+ throws Exception
+ {
+ new ComponentTest() {
+ @Override
+ protected void testComponents() throws Exception {
+ assert getValue("#{namespaceTest.fooFactory}") != null;
+ }
+ }.run();
+ }
+
+ @Test
+ public void nameSpaceFactory()
+ throws Exception
+ {
+ new ComponentTest() {
+ @Override
+ protected void testComponents() throws Exception {
+ assert getValue("#{namespaceTest.ns1.factory}") != null;
+ }
+ }.run();
+ }
+
+
+ @Test
+ public void namespaceOutjection()
+ throws Exception
+ {
+ new ComponentTest() {
+ @Override
+ protected void testComponents() throws Exception {
+ FooFactory factory = (FooFactory) getValue("#{namespaceTest.fooFactory}");
+ factory.someMethod();
+ assert getValue("#{namespaceTest.ns2.outject}") != null;
+ }
+ }.run();
+ }
+
+
+ @Test
+ public void factoryMethodExpression()
+ throws Exception
+ {
+ new ComponentTest() {
+ @Override
+ protected void testComponents() throws Exception {
+ Init init = Init.instance();
+ init.addFactoryMethodExpression("namespaceTest.ns3.factory", "#{namespaceTest.fooFactory.createFoo}", ScopeType.SESSION);
+
+ assert getValue("#{namespaceTest.ns3.factory}") != null;
+ }
+ }.run();
+ }
+
+ @Test
+ public void factoryValueExpression()
+ throws Exception
+ {
+ new ComponentTest() {
+ @Override
+ protected void testComponents() throws Exception {
+ Init init = Init.instance();
+ init.addFactoryValueExpression("namespaceTest.ns4.factory", "#{namespaceTest.fooFactory.createFoo()}", ScopeType.SESSION);
+
+ assert getValue("#{namespaceTest.ns4.factory}") != null;
+ }
+ }.run();
+ }
+
+ @Name("namespaceTest.fooFactory")
+ public static class FooFactory {
+ public class Foo {}
+
+ @Factory("namespaceTest.ns1.factory")
+ public Foo createFoo() {
+ return new Foo();
+ }
+
+ @Out("namespaceTest.ns2.outject")
+ public Foo outjectFoo() {
+ return new Foo();
+ }
+
+ public void someMethod() {
+ }
+ }
+}
Added: branches/community/Seam_2_3/seam-integration-tests-ee6/src/test/java/org/jboss/seam/test/integration/PageContextTest.java
===================================================================
--- branches/community/Seam_2_3/seam-integration-tests-ee6/src/test/java/org/jboss/seam/test/integration/PageContextTest.java (rev 0)
+++ branches/community/Seam_2_3/seam-integration-tests-ee6/src/test/java/org/jboss/seam/test/integration/PageContextTest.java 2012-02-28 13:53:30 UTC (rev 14333)
@@ -0,0 +1,49 @@
+package org.jboss.seam.test.integration;
+
+import org.jboss.arquillian.container.test.api.Deployment;
+import org.jboss.arquillian.container.test.api.OverProtocol;
+import org.jboss.arquillian.junit.Arquillian;
+import org.jboss.seam.contexts.Contexts;
+import org.jboss.seam.mock.JUnitSeamTest;
+import org.jboss.shrinkwrap.api.Archive;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+/**
+ *
+ * @author Pete Muir
+ *
+ */
+ at RunWith(Arquillian.class)
+public class PageContextTest extends JUnitSeamTest
+{
+ @Deployment(name="PageContextTest")
+ @OverProtocol("Servlet 3.0")
+ public static Archive<?> createDeployment()
+ {
+ return Deployments.defaultSeamDeployment();
+ }
+
+ @Test
+ public void pageContextTest() throws Exception {
+
+ new FacesRequest("/index.xhtml") {
+
+ @Override
+ protected void invokeApplication() throws Exception
+ {
+ Contexts.getPageContext().set("foo", "bar");
+ assert Contexts.getPageContext().get("foo") == null;
+ }
+
+ @Override
+ protected void renderResponse() throws Exception
+ {
+ assert Contexts.getPageContext().get("foo") != null;
+ assert "bar".equals(Contexts.getPageContext().get("foo"));
+ }
+ }.run();
+
+ }
+
+}
Added: branches/community/Seam_2_3/seam-integration-tests-ee6/src/test/java/org/jboss/seam/test/integration/PageParamTest.java
===================================================================
--- branches/community/Seam_2_3/seam-integration-tests-ee6/src/test/java/org/jboss/seam/test/integration/PageParamTest.java (rev 0)
+++ branches/community/Seam_2_3/seam-integration-tests-ee6/src/test/java/org/jboss/seam/test/integration/PageParamTest.java 2012-02-28 13:53:30 UTC (rev 14333)
@@ -0,0 +1,125 @@
+package org.jboss.seam.test.integration;
+
+import java.util.List;
+
+import javax.faces.application.FacesMessage;
+
+import org.jboss.arquillian.container.test.api.Deployment;
+import org.jboss.arquillian.container.test.api.OverProtocol;
+import org.jboss.arquillian.junit.Arquillian;
+import org.jboss.seam.mock.JUnitSeamTest;
+import org.jboss.shrinkwrap.api.Archive;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+/**
+ * @author Pete Muir
+ * @author Dan Allen
+ */
+ at RunWith(Arquillian.class)
+public class PageParamTest extends JUnitSeamTest
+{
+ @Deployment(name="PageParamTest")
+ @OverProtocol("Servlet 3.0")
+ public static Archive<?> createDeployment()
+ {
+ return Deployments.defaultSeamDeployment()
+ .addClasses(Person.class);
+ }
+
+ @Test
+ public void testPageParameter() throws Exception
+ {
+ new FacesRequest("/pageWithParameter.xhtml")
+ {
+ @Override
+ protected void beforeRequest()
+ {
+ setParameter("personName", "pete");
+ }
+
+ @Override
+ protected void invokeApplication() throws Exception
+ {
+ assert "pete".equals(getValue("#{person.name}"));
+ }
+ }.run();
+
+ new FacesRequest("/pageWithParameter.xhtml")
+ {
+ @Override
+ protected void beforeRequest()
+ {
+ setParameter("anotherPersonName", "pete");
+ }
+
+ @Override
+ protected void invokeApplication() throws Exception
+ {
+ assert getValue("#{person.name}") == null;
+ }
+ }.run();
+ }
+
+ @Test
+ public void testPageParameterFailsModelValidation() throws Exception
+ {
+ new FacesRequest("/pageWithParameter.xhtml")
+ {
+ @Override
+ protected void beforeRequest()
+ {
+ setParameter("personName", "pe");
+ }
+
+ @Override
+ protected void invokeApplication() throws Exception
+ {
+ List<FacesMessage> messages = (List<FacesMessage>) getValue("#{facesMessages.currentMessages}");
+ assert messages.size() == 1;
+ assert messages.get(0).getDetail().startsWith("'personName' parameter is invalid");
+ assert getValue("#{person.name}") == null;
+ }
+ }.run();
+ }
+
+ @Test
+ public void testPageParameterModelValidationDisabled() throws Exception
+ {
+ new FacesRequest("/pageWithValidateModelDisabledParameter.xhtml")
+ {
+ @Override
+ protected void beforeRequest()
+ {
+ setParameter("personName", "pe");
+ }
+
+ @Override
+ protected void invokeApplication() throws Exception
+ {
+ assert "pe".equals(getValue("#{person.name}"));
+ }
+ }.run();
+ }
+
+ @Test
+ public void testRequiredPageParameter() throws Exception
+ {
+ new FacesRequest("/pageWithRequiredParameter.xhtml")
+ {
+ @Override
+ protected void beforeRequest()
+ {
+ setParameter("personName", "pete");
+ }
+
+ @Override
+ protected void invokeApplication() throws Exception
+ {
+ assert "pete".equals(getValue("#{person.name}"));
+ }
+ }.run();
+
+ }
+
+}
Added: branches/community/Seam_2_3/seam-integration-tests-ee6/src/test/java/org/jboss/seam/test/integration/People.java
===================================================================
--- branches/community/Seam_2_3/seam-integration-tests-ee6/src/test/java/org/jboss/seam/test/integration/People.java (rev 0)
+++ branches/community/Seam_2_3/seam-integration-tests-ee6/src/test/java/org/jboss/seam/test/integration/People.java 2012-02-28 13:53:30 UTC (rev 14333)
@@ -0,0 +1,35 @@
+package org.jboss.seam.test.integration;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.jboss.seam.ScopeType;
+import org.jboss.seam.annotations.Factory;
+import org.jboss.seam.annotations.Name;
+import org.jboss.seam.annotations.datamodel.DataModelSelection;
+
+ at Name("people")
+public class People
+{
+ @org.jboss.seam.annotations.datamodel.DataModel(scope=ScopeType.PAGE)
+ private List<Person> peopleList;
+
+ @DataModelSelection
+ private Person selectedPerson;
+
+ @Factory("peopleList")
+ public void peopleFactory()
+ {
+ peopleList = new ArrayList<Person>();
+ peopleList.add(new Person("Gavin"));
+ peopleList.add(new Person("Pete"));
+ peopleList.add(new Person("Shane"));
+ peopleList.add(new Person("Norman"));
+ }
+
+ public Person getSelectedPerson()
+ {
+ return selectedPerson;
+ }
+
+}
Added: branches/community/Seam_2_3/seam-integration-tests-ee6/src/test/java/org/jboss/seam/test/integration/Person.java
===================================================================
--- branches/community/Seam_2_3/seam-integration-tests-ee6/src/test/java/org/jboss/seam/test/integration/Person.java (rev 0)
+++ branches/community/Seam_2_3/seam-integration-tests-ee6/src/test/java/org/jboss/seam/test/integration/Person.java 2012-02-28 13:53:30 UTC (rev 14333)
@@ -0,0 +1,47 @@
+package org.jboss.seam.test.integration;
+
+import java.io.Serializable;
+import javax.validation.constraints.Size;
+
+import org.jboss.seam.annotations.Name;
+
+
+ at Name("person")
+public class Person implements Serializable
+{
+
+ public Person(String name)
+ {
+ this.name = name;
+ }
+
+ public Person() {}
+
+ private String name;
+
+ @Size(min = 3, max = 10)
+ public String getName()
+ {
+ return name;
+ }
+
+ public void setName(String name)
+ {
+ this.name = name;
+ }
+
+ @Override
+ public boolean equals(Object other)
+ {
+ if (other instanceof Person)
+ {
+ Person that = (Person) other;
+ return (this.name == null && that.name == null) || (this.name != null && this.name.equals(that.name));
+ }
+ else
+ {
+ return false;
+ }
+ }
+
+}
Added: branches/community/Seam_2_3/seam-integration-tests-ee6/src/test/java/org/jboss/seam/test/integration/Thing.java
===================================================================
--- branches/community/Seam_2_3/seam-integration-tests-ee6/src/test/java/org/jboss/seam/test/integration/Thing.java (rev 0)
+++ branches/community/Seam_2_3/seam-integration-tests-ee6/src/test/java/org/jboss/seam/test/integration/Thing.java 2012-02-28 13:53:30 UTC (rev 14333)
@@ -0,0 +1,49 @@
+package org.jboss.seam.test.integration;
+
+import javax.persistence.Entity;
+import javax.persistence.GeneratedValue;
+import javax.persistence.Id;
+import javax.persistence.Version;
+
+ at Entity
+public class Thing {
+ public Thing() {}
+
+ @GeneratedValue
+ @Id
+ private Long id;
+
+ @Version
+ private Integer version;
+
+ private String name;
+
+ public Long getId() {
+ return id;
+ }
+
+ public void setId(Long id) {
+ this.id = id;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public Integer getVersion() {
+ return version;
+ }
+
+ public void setVersion(Integer version) {
+ this.version = version;
+ }
+
+ @Override
+ public String toString() {
+ return "Thing#" + id + "[v=" + version + "]";
+ }
+}
\ No newline at end of file
Added: branches/community/Seam_2_3/seam-integration-tests-ee6/src/test/java/org/jboss/seam/test/integration/UnversionedThing.java
===================================================================
--- branches/community/Seam_2_3/seam-integration-tests-ee6/src/test/java/org/jboss/seam/test/integration/UnversionedThing.java (rev 0)
+++ branches/community/Seam_2_3/seam-integration-tests-ee6/src/test/java/org/jboss/seam/test/integration/UnversionedThing.java 2012-02-28 13:53:30 UTC (rev 14333)
@@ -0,0 +1,35 @@
+package org.jboss.seam.test.integration;
+
+import javax.persistence.Entity;
+import javax.persistence.GeneratedValue;
+import javax.persistence.Id;
+
+ at Entity
+public class UnversionedThing {
+ @GeneratedValue
+ @Id
+ private Long id;
+
+ private String name;
+
+ public Long getId() {
+ return id;
+ }
+
+ public void setId(Long id) {
+ this.id = id;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ @Override
+ public String toString() {
+ return "UnversionedThing#" + id + "]";
+ }
+}
\ No newline at end of file
Added: branches/community/Seam_2_3/seam-integration-tests-ee6/src/test/java/org/jboss/seam/test/integration/bpm/SeamExpressionEvaluatorTest.java
===================================================================
--- branches/community/Seam_2_3/seam-integration-tests-ee6/src/test/java/org/jboss/seam/test/integration/bpm/SeamExpressionEvaluatorTest.java (rev 0)
+++ branches/community/Seam_2_3/seam-integration-tests-ee6/src/test/java/org/jboss/seam/test/integration/bpm/SeamExpressionEvaluatorTest.java 2012-02-28 13:53:30 UTC (rev 14333)
@@ -0,0 +1,101 @@
+package org.jboss.seam.test.integration.bpm;
+
+import org.jboss.arquillian.container.test.api.Deployment;
+import org.jboss.arquillian.container.test.api.OverProtocol;
+import org.jboss.arquillian.junit.Arquillian;
+import org.jboss.seam.mock.JUnitSeamTest;
+import org.jboss.seam.test.integration.Deployments;
+import org.jboss.shrinkwrap.api.Archive;
+import org.jbpm.jpdl.el.ELException;
+import org.junit.Ignore;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+/**
+ * @author Pete Muir
+ *
+ */
+ at Ignore
+ at RunWith(Arquillian.class)
+public class SeamExpressionEvaluatorTest extends JUnitSeamTest
+{
+ @Deployment(name="SeamExpressionEvaluatorTest")
+ @OverProtocol("Servlet 3.0")
+ public static Archive<?> createDeployment()
+ {
+ return Deployments.jbpmSeamDeployment()
+ .addClasses(SeamExpressionEvaluatorTestController.class);
+ }
+
+ // Test for JBSEAM-1937
+ @Test
+ public void testValueExpression() throws Exception
+ {
+ new FacesRequest()
+ {
+
+ @Override
+ protected void invokeApplication() throws Exception
+ {
+ invokeAction("#{seamExpressionEvaluatorTestController.createProcess2}");
+ }
+
+ }.run();
+ }
+
+ // Test for JBSEAM-3250
+ @Test
+ public void testUnqualifiedValueExpression() throws Exception
+ {
+ new FacesRequest()
+ {
+
+ @Override
+ protected void invokeApplication() throws Exception
+ {
+ invokeAction("#{seamExpressionEvaluatorTestController.createProcess4}");
+ }
+
+ }.run();
+ }
+
+ // Test for JBSEAM-2152
+ @Test
+ public void testMissingMethod() throws Exception
+ {
+ new FacesRequest()
+ {
+
+ @Override
+ protected void invokeApplication() throws Exception
+ {
+ try
+ {
+ invokeAction("#{seamExpressionEvaluatorTestController.createProcess3}");
+ }
+ catch (Exception e)
+ {
+ if (!(isRootCause(e, ELException.class) || isRootCause(e, javax.el.ELException.class)))
+ {
+ e.printStackTrace();
+ assert false;
+ }
+ }
+ }
+
+ }.run();
+ }
+
+ private static boolean isRootCause(Throwable t, Class clazz)
+ {
+ for (Throwable cause = t.getCause(); cause != null && cause != cause.getCause(); cause = cause.getCause())
+ {
+ if (clazz.isAssignableFrom(cause.getClass()))
+ {
+ return true;
+ }
+ }
+ return false;
+ }
+
+}
Added: branches/community/Seam_2_3/seam-integration-tests-ee6/src/test/java/org/jboss/seam/test/integration/bpm/SeamExpressionEvaluatorTestController.java
===================================================================
--- branches/community/Seam_2_3/seam-integration-tests-ee6/src/test/java/org/jboss/seam/test/integration/bpm/SeamExpressionEvaluatorTestController.java (rev 0)
+++ branches/community/Seam_2_3/seam-integration-tests-ee6/src/test/java/org/jboss/seam/test/integration/bpm/SeamExpressionEvaluatorTestController.java 2012-02-28 13:53:30 UTC (rev 14333)
@@ -0,0 +1,50 @@
+package org.jboss.seam.test.integration.bpm;
+
+import org.jboss.seam.ScopeType;
+import org.jboss.seam.annotations.Factory;
+import org.jboss.seam.annotations.Name;
+import org.jboss.seam.annotations.bpm.CreateProcess;
+
+ at Name("seamExpressionEvaluatorTestController")
+public class SeamExpressionEvaluatorTestController {
+
+ private String name = "foo";
+
+ @Factory(value="testBoolean", scope=ScopeType.BUSINESS_PROCESS)
+ public Boolean testNameFactory()
+ {
+ return false;
+ }
+
+ @CreateProcess(definition="TestProcess2")
+ public void createProcess2()
+ {
+ }
+
+ @CreateProcess(definition="TestProcess3")
+ public void createProcess3()
+ {
+ }
+
+ @CreateProcess(definition="TestProcess4")
+ public void createProcess4()
+ {
+ }
+
+ public void logTrue()
+ {
+ System.out.println("true");
+ }
+
+ public String getName()
+ {
+ return this.name;
+ }
+
+ public void setName(String name)
+ {
+ this.name = name;
+ }
+
+
+}
\ No newline at end of file
Added: branches/community/Seam_2_3/seam-integration-tests-ee6/src/test/java/org/jboss/seam/test/integration/databinding/DataModelTest.java
===================================================================
--- branches/community/Seam_2_3/seam-integration-tests-ee6/src/test/java/org/jboss/seam/test/integration/databinding/DataModelTest.java (rev 0)
+++ branches/community/Seam_2_3/seam-integration-tests-ee6/src/test/java/org/jboss/seam/test/integration/databinding/DataModelTest.java 2012-02-28 13:53:30 UTC (rev 14333)
@@ -0,0 +1,345 @@
+package org.jboss.seam.test.integration.databinding;
+
+
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.NotSerializableException;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import javax.faces.model.DataModel;
+import javax.faces.model.ListDataModel;
+
+import org.jboss.arquillian.container.test.api.Deployment;
+import org.jboss.arquillian.container.test.api.OverProtocol;
+import org.jboss.arquillian.junit.Arquillian;
+import org.jboss.seam.faces.DataModels;
+import org.jboss.seam.jsf.ArrayDataModel;
+import org.jboss.seam.jsf.MapDataModel;
+import org.jboss.seam.jsf.SetDataModel;
+import org.jboss.seam.mock.JUnitSeamTest;
+import org.jboss.seam.test.integration.Deployments;
+import org.jboss.seam.test.integration.Foo;
+import org.jboss.seam.test.integration.People;
+import org.jboss.seam.test.integration.Person;
+import org.jboss.shrinkwrap.api.Archive;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+ at RunWith(Arquillian.class)
+public class DataModelTest extends JUnitSeamTest
+{
+ @Deployment(name="DataModelTest")
+ @OverProtocol("Servlet 3.0")
+ public static Archive<?> createDeployment()
+ {
+ return Deployments.defaultSeamDeployment()
+ .addClasses(Foo.class, Person.class, People.class);
+ }
+
+ @Test
+ public void testDataModels() throws Exception
+ {
+
+ new FacesRequest()
+ {
+ @Override
+ protected void invokeApplication() throws Exception
+ {
+ DataModels dataModels = DataModels.instance();
+
+ assert dataModels.getDataModel(new ArrayList()) instanceof ListDataModel;
+ assert dataModels.getDataModel(new HashMap()) instanceof MapDataModel;
+ assert dataModels.getDataModel(new HashSet()) instanceof SetDataModel;
+ assert dataModels.getDataModel(new Object[0]) instanceof ArrayDataModel;
+ // TODO assert dataModels.getDataModel(query) instanceof ListDataModel;
+
+ boolean failed = false;
+ try
+ {
+ dataModels.getDataModel(new Foo());
+ }
+ catch (IllegalArgumentException e)
+ {
+ failed = true;
+ }
+ assert failed;
+ }
+ }.run();
+ }
+
+ @Test
+ public void testArrayDataModelSerialization() throws Exception
+ {
+ String[] array = {"Seam", "Hibernate"};
+ javax.faces.model.ArrayDataModel arrayDataModel = new ArrayDataModel(array);
+ arrayDataModel.setRowIndex(1);
+
+ Object object = null;
+ try
+ {
+ object = serialize(arrayDataModel);
+ }
+ catch (NotSerializableException e)
+ {
+ assert false;
+ }
+ assert object instanceof javax.faces.model.ArrayDataModel;
+
+ javax.faces.model.ArrayDataModel serializedArrayDataModel = (javax.faces.model.ArrayDataModel) object;
+
+ assert serializedArrayDataModel.getRowIndex() == 1;
+
+ String[] serializedArray = (String[]) serializedArrayDataModel.getWrappedData();
+
+ assert array[0].equals(serializedArray[0]);
+
+ assert array[1].equals(serializedArray[1]);
+ }
+
+ // Utility to serialize an object
+ private Object serialize(Object object) throws Exception
+ {
+ ByteArrayOutputStream bos = new ByteArrayOutputStream();
+ ObjectOutputStream oos = new ObjectOutputStream(bos);
+ oos.writeObject(object);
+ ByteArrayInputStream bis = new ByteArrayInputStream(bos.toByteArray());
+ ObjectInputStream ois = new ObjectInputStream(bis);
+ return ois.readObject();
+ }
+
+ @Test
+ public void testListDataModelSerialization() throws Exception
+ {
+
+ List<String> list = Arrays.asList("Seam", "Hibernate");
+ javax.faces.model.ListDataModel listDataModel = new org.jboss.seam.jsf.ListDataModel(list);
+ listDataModel.setRowIndex(1);
+
+ Object object = null;
+ try
+ {
+ object = serialize(listDataModel);
+ }
+ catch (NotSerializableException e)
+ {
+ assert false;
+ }
+
+ assert object instanceof javax.faces.model.ListDataModel;
+ javax.faces.model.ListDataModel serializedListDataModel = (javax.faces.model.ListDataModel) object;
+ List<String> serializedList = (List<String>) serializedListDataModel.getWrappedData();
+
+ assert serializedListDataModel.getRowIndex() == 1;
+ assert list.get(0).equals(serializedList.get(0));
+ assert list.get(1).equals(serializedList.get(1));
+ }
+
+ @Test
+ public void testMapDataModel() throws IOException, ClassNotFoundException
+ {
+ Map<String, Person> map = new HashMap<String, Person>();
+ map.put("0", new Person("Gavin"));
+ map.put("1", new Person("Tom"));
+
+ javax.faces.model.DataModel mapDataModel = new MapDataModel();
+
+ assert mapDataModel.getRowCount() == -1;
+ assert mapDataModel.getRowData() == null;
+ assert !mapDataModel.isRowAvailable();
+
+ mapDataModel = new MapDataModel(map);
+
+ assert mapDataModel.getWrappedData() instanceof Map;
+
+ assert map.get("0").equals(((Map) mapDataModel.getWrappedData()).get("0"));
+ assert map.get("1").equals(((Map) mapDataModel.getWrappedData()).get("1"));
+
+ mapDataModel.setRowIndex(10);
+
+ assert !mapDataModel.isRowAvailable();
+
+ boolean failed = false;
+ try
+ {
+ mapDataModel.getRowData();
+ }
+ catch (IllegalArgumentException e)
+ {
+ failed = true;
+ }
+
+ assert failed;
+
+ mapDataModel.setRowIndex(1);
+
+ assert mapDataModel.isRowAvailable();
+ assert mapDataModel.getRowIndex() == 1;
+ assert mapDataModel.getRowCount() == 2;
+
+ // JBSEAM-1660
+ try
+ {
+ mapDataModel.setWrappedData(null);
+ }
+ catch (NullPointerException e)
+ {
+ // Spec allows passing null
+ assert false;
+ }
+ }
+
+ /**
+ * JBSEAM-1659
+ */
+ @Test
+ public void testMapDataModelSerialization() throws Exception
+ {
+
+ Map<String, Person> map = new HashMap<String, Person>();
+ map.put("0", new Person("Gavin"));
+ map.put("1", new Person("Tom"));
+
+ javax.faces.model.DataModel mapDataModel = new MapDataModel(map);
+ mapDataModel.setRowIndex(1);
+
+ Object object = null;
+ try
+ {
+ object = serialize(mapDataModel);
+ }
+ catch (NotSerializableException e)
+ {
+ assert false;
+ }
+
+
+ assert object instanceof javax.faces.model.DataModel;
+ javax.faces.model.DataModel serializedMapDataModel = (javax.faces.model.DataModel) object;
+ Map<String, Person> serializedMap = (Map<String, Person>) serializedMapDataModel.getWrappedData();
+
+ assert serializedMapDataModel.getRowIndex() == 1;
+ assert map.get("0").equals(serializedMap.get("0"));
+ assert map.get("1").equals(serializedMap.get("1"));
+ }
+
+ @Test
+ public void testSetDataModel() throws IOException, ClassNotFoundException
+ {
+ Person gavin = new Person("Gavin");
+ Person tom = new Person("Tom");
+
+ Set<Person> set = new HashSet<Person>();
+ set.add(gavin);
+ set.add(tom);
+
+ javax.faces.model.DataModel setDataModel = new SetDataModel();
+
+ assert setDataModel.getRowCount() == -1;
+ assert setDataModel.getRowData() == null;
+ assert !setDataModel.isRowAvailable();
+
+ setDataModel = new SetDataModel(set);
+
+ assert setDataModel.getWrappedData() instanceof Set;
+
+ assert set.contains(gavin);
+ assert set.contains(tom);
+
+ setDataModel.setRowIndex(10);
+
+ assert !setDataModel.isRowAvailable();
+
+ boolean failed = false;
+ try
+ {
+ setDataModel.getRowData();
+ }
+ catch (IllegalArgumentException e)
+ {
+ failed = true;
+ }
+
+ assert failed;
+
+ setDataModel.setRowIndex(1);
+
+ assert setDataModel.isRowAvailable();
+ assert setDataModel.getRowIndex() == 1;
+ assert setDataModel.getRowCount() == 2;
+
+ // JBSEAM-1660
+ try
+ {
+ setDataModel.setWrappedData(null);
+ }
+ catch (NullPointerException e)
+ {
+ // Spec allows passing null
+ assert false;
+ }
+ }
+
+ @Test
+ public void testSetDataModelSerialization() throws Exception
+ {
+
+ Person gavin = new Person("Gavin");
+ Person tom = new Person("Tom");
+
+ Set<Person> set = new HashSet<Person>();
+ set.add(gavin);
+ set.add(tom);
+
+ javax.faces.model.DataModel setDataModel = new SetDataModel(set);
+ setDataModel.setRowIndex(1);
+
+ Object object = null;
+ try
+ {
+ object = serialize(setDataModel);
+ }
+ catch (NotSerializableException e)
+ {
+ assert false;
+ }
+
+
+ assert object instanceof javax.faces.model.DataModel;
+ javax.faces.model.DataModel serializedSetDataModel = (javax.faces.model.DataModel) object;
+ Set<Person> serializedSet = (Set<Person>) serializedSetDataModel.getWrappedData();
+
+ assert serializedSetDataModel.getRowIndex() == 1;
+ assert serializedSet.contains(gavin);
+ assert serializedSet.contains(tom);
+ }
+
+ @Test
+ public void testDataModelOutjection() throws Exception
+ {
+ new FacesRequest()
+ {
+
+ @Override
+ protected void renderResponse() throws Exception
+ {
+ Object people = getValue("#{peopleList}");
+ assert people instanceof DataModel;
+ DataModel dataModel = (DataModel) people;
+ assert dataModel.getRowCount() == 4;
+ dataModel.setRowIndex(1);
+ }
+
+ }.run();
+
+ }
+
+}
Added: branches/community/Seam_2_3/seam-integration-tests-ee6/src/test/java/org/jboss/seam/test/integration/i8ln/LocaleTest.java
===================================================================
--- branches/community/Seam_2_3/seam-integration-tests-ee6/src/test/java/org/jboss/seam/test/integration/i8ln/LocaleTest.java (rev 0)
+++ branches/community/Seam_2_3/seam-integration-tests-ee6/src/test/java/org/jboss/seam/test/integration/i8ln/LocaleTest.java 2012-02-28 13:53:30 UTC (rev 14333)
@@ -0,0 +1,140 @@
+package org.jboss.seam.test.integration.i8ln;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Locale;
+
+import javax.faces.component.UIOutput;
+import javax.faces.event.ValueChangeEvent;
+
+import org.jboss.arquillian.container.test.api.Deployment;
+import org.jboss.arquillian.container.test.api.OverProtocol;
+import org.jboss.arquillian.junit.Arquillian;
+import org.jboss.seam.international.LocaleConfig;
+import org.jboss.seam.international.LocaleSelector;
+import org.jboss.seam.Seam;
+import org.jboss.seam.contexts.Contexts;
+import org.jboss.seam.mock.JUnitSeamTest;
+import org.jboss.seam.test.integration.Deployments;
+import org.jboss.shrinkwrap.api.Archive;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+ at RunWith(Arquillian.class)
+public class LocaleTest extends JUnitSeamTest
+{
+ @Deployment(name="LocaleTest")
+ @OverProtocol("Servlet 3.0")
+ public static Archive<?> createDeployment()
+ {
+ return Deployments.defaultSeamDeployment();
+ }
+
+ @Test
+ public void localeTest() throws Exception
+ {
+ new NonFacesRequest()
+ {
+ @Override
+ protected void renderResponse() throws Exception
+ {
+ // it's necessary to emulate the startup behavior of LocaleConfig since it alters the JSF Application
+ // and we cannot be sure that the JSF Application wasn't cleared by an earlier class
+ // NOTE: I wish this test suite had some better place of initializing the application context
+ Contexts.getApplicationContext().remove(Seam.getComponentName(LocaleConfig.class));
+ LocaleConfig.instance();
+ }
+ }.run();
+
+ new FacesRequest()
+ {
+
+ @Override
+ protected void invokeApplication() throws Exception
+ {
+ // <i18:locale-config default-locale="fr_CA" supported-locales="fr_CA fr_FR en"/>
+ List<Locale> supportedLocales = new ArrayList<Locale>();
+ for (Iterator<Locale> iter = getFacesContext().getApplication().getSupportedLocales(); iter.hasNext();)
+ {
+ supportedLocales.add(iter.next());
+ }
+ assert supportedLocales.size() == 3;
+ assert supportedLocales.contains(Locale.CANADA_FRENCH);
+ assert supportedLocales.contains(Locale.ENGLISH);
+ assert supportedLocales.contains(Locale.FRANCE);
+ assert getFacesContext().getApplication().getDefaultLocale().equals(Locale.CANADA_FRENCH);
+
+ // why not? I guess be default locale means different things in different contexts (server vs user)
+ //assert org.jboss.seam.international.Locale.instance().equals(Locale.CANADA_FRENCH);
+
+ // reset the locale configuration (as it would be w/o <i18n:locale-config>)
+ getFacesContext().getApplication().setDefaultLocale(Locale.ENGLISH);
+ getFacesContext().getApplication().setSupportedLocales(null);
+
+ assert org.jboss.seam.international.Locale.instance().equals(Locale.getDefault());
+
+ LocaleSelector.instance().setLocale(Locale.UK);
+
+ assert org.jboss.seam.international.Locale.instance().equals(Locale.UK);
+
+ LocaleSelector.instance().setLocaleString(Locale.FRANCE.toString());
+
+ assert LocaleSelector.instance().getLanguage().equals(Locale.FRANCE.getLanguage());
+ assert LocaleSelector.instance().getCountry().equals(Locale.FRANCE.getCountry());
+ assert LocaleSelector.instance().getVariant().equals(Locale.FRANCE.getVariant());
+
+ assert org.jboss.seam.international.Locale.instance().equals(Locale.FRANCE);
+ assert LocaleSelector.instance().getLocaleString().equals(Locale.FRANCE.toString());
+
+ LocaleSelector.instance().select();
+ assert org.jboss.seam.international.Locale.instance().equals(Locale.FRANCE);
+
+ LocaleSelector.instance().selectLanguage(Locale.JAPANESE.getLanguage());
+ assert org.jboss.seam.international.Locale.instance().getLanguage().equals(Locale.JAPANESE.getLanguage());
+
+ ValueChangeEvent valueChangeEvent = new ValueChangeEvent(new UIOutput(), Locale.JAPANESE.toString(), Locale.TAIWAN.toString());
+ LocaleSelector.instance().select(valueChangeEvent);
+ assert org.jboss.seam.international.Locale.instance().equals(Locale.TAIWAN);
+
+ Locale uk_posix = new Locale(Locale.UK.getLanguage(), Locale.UK.getCountry(), "POSIX");
+ LocaleSelector.instance().setLocale(uk_posix);
+
+ assert org.jboss.seam.international.Locale.instance().equals(uk_posix);
+ assert LocaleSelector.instance().getLanguage().equals(uk_posix.getLanguage());
+ assert LocaleSelector.instance().getCountry().equals(uk_posix.getCountry());
+ assert LocaleSelector.instance().getVariant().equals(uk_posix.getVariant());
+
+ LocaleSelector.instance().setLanguage(Locale.CHINA.getLanguage());
+ LocaleSelector.instance().setCountry(Locale.CHINA.getCountry());
+ LocaleSelector.instance().setVariant(null);
+
+ assert org.jboss.seam.international.Locale.instance().equals(Locale.CHINA);
+
+ LocaleSelector.instance().setLanguage(Locale.ITALIAN.getLanguage());
+ LocaleSelector.instance().setCountry(null);
+ LocaleSelector.instance().setVariant(null);
+
+ assert org.jboss.seam.international.Locale.instance().equals(Locale.ITALIAN);
+
+ assert LocaleSelector.instance().getSupportedLocales().size() == 1;
+ assert LocaleSelector.instance().getSupportedLocales().get(0).getValue().equals(Locale.ENGLISH.toString());
+ assert LocaleSelector.instance().getSupportedLocales().get(0).getLabel().equals(Locale.ENGLISH.getDisplayName());
+
+ boolean failed = false;
+ try
+ {
+ LocaleSelector.instance().setLocale(null);
+ }
+ catch (NullPointerException e)
+ {
+ failed = true;
+ }
+ assert failed;
+
+ // TODO Test cookie stuff (need to extend Mocks for this)
+
+ }
+ }.run();
+ }
+}
Added: branches/community/Seam_2_3/seam-integration-tests-ee6/src/test/java/org/jboss/seam/test/integration/i8ln/TimeZoneTest.java
===================================================================
--- branches/community/Seam_2_3/seam-integration-tests-ee6/src/test/java/org/jboss/seam/test/integration/i8ln/TimeZoneTest.java (rev 0)
+++ branches/community/Seam_2_3/seam-integration-tests-ee6/src/test/java/org/jboss/seam/test/integration/i8ln/TimeZoneTest.java 2012-02-28 13:53:30 UTC (rev 14333)
@@ -0,0 +1,64 @@
+package org.jboss.seam.test.integration.i8ln;
+
+import java.util.TimeZone;
+
+import javax.faces.component.UIOutput;
+import javax.faces.event.ValueChangeEvent;
+
+import org.jboss.arquillian.container.test.api.Deployment;
+import org.jboss.arquillian.container.test.api.OverProtocol;
+import org.jboss.arquillian.junit.Arquillian;
+import org.jboss.seam.international.TimeZoneSelector;
+import org.jboss.seam.mock.JUnitSeamTest;
+import org.jboss.seam.test.integration.Deployments;
+import org.jboss.shrinkwrap.api.Archive;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+/**
+ *
+ * @author Pete Muir
+ *
+ */
+ at RunWith(Arquillian.class)
+public class TimeZoneTest extends JUnitSeamTest
+{
+ @Deployment(name="TimeZoneTest")
+ @OverProtocol("Servlet 3.0")
+ public static Archive<?> createDeployment()
+ {
+ return Deployments.defaultSeamDeployment();
+ }
+
+ @Test
+ public void timeZoneTest() throws Exception
+ {
+ new FacesRequest()
+ {
+ @Override
+ protected void invokeApplication() throws Exception
+ {
+ assert org.jboss.seam.international.TimeZone.instance().equals(java.util.TimeZone.getDefault());
+
+ TimeZone cet = TimeZone.getTimeZone("CET");
+ TimeZoneSelector.instance().setTimeZone(cet);
+
+ assert org.jboss.seam.international.TimeZone.instance().equals(cet);
+
+ TimeZoneSelector.instance().setTimeZoneId("CET");
+
+ assert org.jboss.seam.international.TimeZone.instance().equals(cet);
+
+ TimeZoneSelector.instance().selectTimeZone("GMT");
+ assert org.jboss.seam.international.TimeZone.instance().getID().equals("GMT");
+
+ ValueChangeEvent valueChangeEvent = new ValueChangeEvent(new UIOutput(), "GMT", "PST");
+ TimeZoneSelector.instance().select(valueChangeEvent);
+ assert org.jboss.seam.international.TimeZone.instance().getID().equals("PST");
+
+ // TODO Test cookie stuff (need to extend Mocks for this)
+
+ }
+ }.run();
+ }
+}
Added: branches/community/Seam_2_3/seam-integration-tests-ee6/src/test/java/org/jboss/seam/test/integration/mock/SeamMockELResolverTest.java
===================================================================
--- branches/community/Seam_2_3/seam-integration-tests-ee6/src/test/java/org/jboss/seam/test/integration/mock/SeamMockELResolverTest.java (rev 0)
+++ branches/community/Seam_2_3/seam-integration-tests-ee6/src/test/java/org/jboss/seam/test/integration/mock/SeamMockELResolverTest.java 2012-02-28 13:53:30 UTC (rev 14333)
@@ -0,0 +1,166 @@
+package org.jboss.seam.test.integration.mock;
+
+import java.beans.FeatureDescriptor;
+import java.util.Iterator;
+
+import javax.el.ELContext;
+import javax.el.ELException;
+import javax.el.ELResolver;
+import javax.el.PropertyNotFoundException;
+import javax.el.PropertyNotWritableException;
+
+import org.jboss.arquillian.container.test.api.Deployment;
+import org.jboss.arquillian.container.test.api.OverProtocol;
+import org.jboss.arquillian.junit.Arquillian;
+import org.jboss.seam.mock.JUnitSeamTest;
+import org.jboss.seam.test.integration.Deployments;
+import org.jboss.shrinkwrap.api.Archive;
+import org.junit.runner.RunWith;
+import org.junit.Test;
+
+
+/**
+ * Test for adding EL resolvers to Seam MockFacesContext
+ *
+ * @author Pete Muir
+ *
+ */
+ at RunWith(Arquillian.class)
+public class SeamMockELResolverTest extends JUnitSeamTest
+{
+ @Deployment(name="SecurityTest")
+ @OverProtocol("Servlet 3.0")
+ public static Archive<?> createDeployment()
+ {
+ return Deployments.defaultSeamDeployment();
+ }
+
+ private static final String property = "customELResolverTest";
+
+ @Override
+ protected ELResolver[] getELResolvers()
+ {
+ ELResolver[] resolvers = new ELResolver[2];
+ resolvers[0] = new ELResolver()
+ {
+
+ @Override
+ public Class<?> getCommonPropertyType(ELContext arg0, Object arg1)
+ {
+ return null;
+ }
+
+ @Override
+ public Iterator<FeatureDescriptor> getFeatureDescriptors(ELContext arg0, Object arg1)
+ {
+ return null;
+ }
+
+ @Override
+ public Class<?> getType(ELContext arg0, Object base, Object property)
+ throws NullPointerException, PropertyNotFoundException, ELException
+ {
+ return null;
+ }
+
+ @Override
+ public Object getValue(ELContext context, Object base, Object property)
+ throws NullPointerException, PropertyNotFoundException, ELException
+ {
+ if (SeamMockELResolverTest.property.equals(property))
+ {
+ context.setPropertyResolved(true);
+ return "found";
+ }
+ return null;
+ }
+
+ @Override
+ public boolean isReadOnly(ELContext arg0, Object base, Object property)
+ throws NullPointerException, PropertyNotFoundException, ELException
+ {
+ if (SeamMockELResolverTest.property.equals(property))
+ {
+ return false;
+ }
+ return false;
+ }
+
+ @Override
+ public void setValue(ELContext context, Object base, Object property, Object value)
+ throws NullPointerException, PropertyNotFoundException,
+ PropertyNotWritableException, ELException
+ {
+ if (SeamMockELResolverTest.property.equals(property))
+ {
+ throw new PropertyNotWritableException();
+ }
+ }
+
+ };
+ resolvers[1] = new ELResolver() {
+
+ @Override
+ public Class<?> getCommonPropertyType(ELContext arg0, Object arg1)
+ {
+ return null;
+ }
+
+ @Override
+ public Iterator<FeatureDescriptor> getFeatureDescriptors(ELContext arg0, Object arg1)
+ {
+ return null;
+ }
+
+ @Override
+ public Class<?> getType(ELContext arg0, Object base, Object property)
+ throws NullPointerException, PropertyNotFoundException, ELException
+ {
+ return null;
+ }
+
+ @Override
+ public Object getValue(ELContext context, Object base, Object property)
+ throws NullPointerException, PropertyNotFoundException, ELException
+ {
+ if (base != null && "className".equals(property))
+ {
+ context.setPropertyResolved(true);
+ return base.getClass().getSimpleName();
+ }
+ return null;
+ }
+
+ @Override
+ public boolean isReadOnly(ELContext arg0, Object base, Object property)
+ throws NullPointerException, PropertyNotFoundException, ELException
+ {
+ return true;
+ }
+
+ @Override
+ public void setValue(ELContext context, Object base, Object property, Object value)
+ throws NullPointerException, PropertyNotFoundException,
+ PropertyNotWritableException, ELException
+ {
+ throw new PropertyNotWritableException();
+ }
+ };
+ return resolvers;
+ }
+
+ @Test
+ public void testCustomELResolver() throws Exception
+ {
+ new FacesRequest()
+ {
+ @Override
+ protected void invokeApplication() throws Exception
+ {
+ assert "found".equals(getValue("#{" + property + "}"));
+ assert "String".equals(getValue("#{" + property + ".className}"));
+ }
+ }.run();
+ }
+
+}
Added: branches/community/Seam_2_3/seam-integration-tests-ee6/src/test/java/org/jboss/seam/test/integration/mock/SeamTestTest.java
===================================================================
--- branches/community/Seam_2_3/seam-integration-tests-ee6/src/test/java/org/jboss/seam/test/integration/mock/SeamTestTest.java (rev 0)
+++ branches/community/Seam_2_3/seam-integration-tests-ee6/src/test/java/org/jboss/seam/test/integration/mock/SeamTestTest.java 2012-02-28 13:53:30 UTC (rev 14333)
@@ -0,0 +1,67 @@
+package org.jboss.seam.test.integration.mock;
+
+import org.jboss.arquillian.container.test.api.Deployment;
+import org.jboss.arquillian.container.test.api.OverProtocol;
+import org.jboss.arquillian.junit.Arquillian;
+import org.jboss.seam.mock.JUnitSeamTest;
+import org.jboss.seam.test.integration.Action;
+import org.jboss.seam.test.integration.Deployments;
+import org.jboss.seam.test.integration.Person;
+import org.jboss.shrinkwrap.api.Archive;
+import org.junit.runner.RunWith;
+import org.junit.Test;
+
+public class SeamTestTest extends JUnitSeamTest
+{
+ private static final String PETER_NAME = "Pete Muir";
+ private static final String PETER_USERNAME = "pmuir";
+
+ @Test
+ public void testEl() throws Exception
+ {
+ new FacesRequest()
+ {
+
+ @Override
+ protected void updateModelValues() throws Exception
+ {
+ setValue("#{person.name}", PETER_NAME);
+ }
+
+ @Override
+ protected void renderResponse() throws Exception
+ {
+ assert getValue("#{person.name}").equals(PETER_NAME);
+ }
+
+ @Override
+ protected void invokeApplication() throws Exception
+ {
+ invokeAction("#{action.go}");
+ String result = getOutcome();
+ assert "success".equals(result);
+ }
+ }.run();
+ }
+
+ @Test
+ public void testSeamSecurity() throws Exception
+ {
+ new FacesRequest()
+ {
+
+ @Override
+ protected void updateModelValues() throws Exception
+ {
+ setValue("#{identity.username}", PETER_USERNAME);
+ }
+
+ @Override
+ protected void renderResponse() throws Exception
+ {
+ assert getValue("#{identity.username}").equals(PETER_USERNAME);
+ }
+ }.run();
+ }
+
+}
Added: branches/community/Seam_2_3/seam-integration-tests-ee6/src/test/java/org/jboss/seam/test/integration/security/SecurityTest.java
===================================================================
--- branches/community/Seam_2_3/seam-integration-tests-ee6/src/test/java/org/jboss/seam/test/integration/security/SecurityTest.java (rev 0)
+++ branches/community/Seam_2_3/seam-integration-tests-ee6/src/test/java/org/jboss/seam/test/integration/security/SecurityTest.java 2012-02-28 13:53:30 UTC (rev 14333)
@@ -0,0 +1,182 @@
+package org.jboss.seam.test.integration.security;
+
+import java.util.HashMap;
+
+import javax.security.auth.login.AppConfigurationEntry;
+import javax.security.auth.login.Configuration;
+import javax.security.auth.login.LoginContext;
+import javax.security.auth.login.LoginException;
+import javax.security.auth.login.AppConfigurationEntry.LoginModuleControlFlag;
+
+import org.jboss.arquillian.container.test.api.Deployment;
+import org.jboss.arquillian.container.test.api.OverProtocol;
+import org.jboss.arquillian.junit.Arquillian;
+import org.jboss.seam.Component;
+import org.jboss.seam.contexts.Contexts;
+import org.jboss.seam.contexts.Lifecycle;
+import org.jboss.seam.mock.JUnitSeamTest;
+import org.jboss.seam.mock.MockLoginModule;
+import org.jboss.seam.security.AuthorizationException;
+import org.jboss.seam.security.Identity;
+import org.jboss.seam.security.NotLoggedInException;
+import org.jboss.seam.test.integration.Deployments;
+import org.jboss.seam.web.Session;
+import org.jboss.shrinkwrap.api.Archive;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+/**
+ * Seam Security Unit Tests
+ *
+ * @author Shane Bryzak
+ */
+ at RunWith(Arquillian.class)
+public class SecurityTest extends JUnitSeamTest
+{
+ @Deployment(name="SecurityTest")
+ @OverProtocol("Servlet 3.0")
+ public static Archive<?> createDeployment()
+ {
+ return Deployments.defaultSeamDeployment();
+ }
+
+ private Configuration createMockJAASConfiguration()
+ {
+ return new Configuration()
+ {
+ private AppConfigurationEntry[] aces = { new AppConfigurationEntry(
+ MockLoginModule.class.getName(),
+ LoginModuleControlFlag.REQUIRED,
+ new HashMap<String,String>()
+ ) };
+
+ @Override
+ public AppConfigurationEntry[] getAppConfigurationEntry(String name)
+ {
+ return aces;
+ }
+
+ @Override
+ public void refresh() {}
+ };
+ }
+
+ public class MockIdentity extends Identity
+ {
+ @Override
+ protected LoginContext getLoginContext() throws LoginException
+ {
+ return new LoginContext("default", getSubject(), getCredentials().createCallbackHandler(),
+ createMockJAASConfiguration());
+ }
+ }
+
+ @Test
+ public void testLogin()
+ {
+ try
+ {
+ Lifecycle.beginApplication(new HashMap<String,Object>());
+ Lifecycle.beginCall();
+
+ // Create a mock session
+ Contexts.getSessionContext().set(Component.getComponentName(Session.class), new Session());
+
+ Identity identity = new MockIdentity();
+ identity.create();
+
+ // Put the identity into our session context
+ Contexts.getSessionContext().set(Component.getComponentName(Identity.class), identity);
+
+ // Test addRole()
+ identity.addRole("admin");
+
+ assert(!identity.hasRole("admin"));
+
+ try
+ {
+ // This should throw a NotLoggedInException
+ identity.checkRole("admin");
+ assert(false);
+ }
+ catch (NotLoggedInException ex)
+ {
+ // expected
+ }
+
+ identity.getCredentials().setUsername("foo");
+ identity.getCredentials().setPassword("bar");
+
+ assert("foo".equals(identity.getCredentials().getUsername()));
+ assert("bar".equals(identity.getCredentials().getPassword()));
+
+ assert("loggedIn".equals(identity.login()));
+ assert(identity.isLoggedIn());
+
+ // Pre-authenticated roles are cleared before authenticating,
+ // so this should still return false
+ assert(!identity.hasRole("admin"));
+
+ // The foo role is added by MockLoginModule
+ assert(identity.hasRole("foo"));
+
+ identity.removeRole("foo");
+ assert(!identity.hasRole("foo"));
+
+ try
+ {
+ // This should throw an AuthorizationException
+ identity.checkRole("foo");
+ assert(false);
+ }
+ catch (AuthorizationException ex)
+ {
+ // expected
+ }
+
+ // Now that we're authenticated, adding a role should have an immediate effect
+ identity.addRole("admin");
+ assert(identity.hasRole("admin"));
+
+ identity.logout();
+
+ assert(!identity.hasRole("admin"));
+ assert(!identity.isLoggedIn());
+ }
+ finally
+ {
+ Lifecycle.endApplication();
+ }
+ }
+
+ @Test
+ public void testDisableSecurity()
+ {
+ try
+ {
+ Identity identity = new Identity();
+ identity.create();
+
+ // Disable security
+ Identity.setSecurityEnabled(false);
+
+ assert(!Identity.isSecurityEnabled());
+ assert(identity.hasRole("admin"));
+ assert(identity.hasPermission("foo", "bar"));
+
+ // This shouldn't throw an exception while security is disabled
+ identity.checkRestriction("foo");
+
+ // Enable security
+ Identity.setSecurityEnabled(true);
+ assert(Identity.isSecurityEnabled());
+ assert(!identity.hasRole("admin"));
+ assert(!identity.hasPermission("foo", "bar"));
+ }
+ finally
+ {
+ Identity.setSecurityEnabled(true);
+ }
+ }
+
+}
Added: branches/community/Seam_2_3/seam-integration-tests-ee6/src/test/resources/META-INF/ejb-jar.xml
===================================================================
--- branches/community/Seam_2_3/seam-integration-tests-ee6/src/test/resources/META-INF/ejb-jar.xml (rev 0)
+++ branches/community/Seam_2_3/seam-integration-tests-ee6/src/test/resources/META-INF/ejb-jar.xml 2012-02-28 13:53:30 UTC (rev 14333)
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ejb-jar xmlns="http://java.sun.com/xml/ns/javaee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/ejb-jar_3_0.xsd"
+ version="3.0">
+
+ <interceptors>
+ <interceptor>
+ <interceptor-class>org.jboss.seam.ejb.SeamInterceptor</interceptor-class>
+ </interceptor>
+ </interceptors>
+
+ <assembly-descriptor>
+ <interceptor-binding>
+ <ejb-name>*</ejb-name>
+ <interceptor-class>org.jboss.seam.ejb.SeamInterceptor</interceptor-class>
+ </interceptor-binding>
+ </assembly-descriptor>
+
+</ejb-jar>
\ No newline at end of file
Added: branches/community/Seam_2_3/seam-integration-tests-ee6/src/test/resources/META-INF/persistence.xml
===================================================================
--- branches/community/Seam_2_3/seam-integration-tests-ee6/src/test/resources/META-INF/persistence.xml (rev 0)
+++ branches/community/Seam_2_3/seam-integration-tests-ee6/src/test/resources/META-INF/persistence.xml 2012-02-28 13:53:30 UTC (rev 14333)
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Persistence deployment descriptor for dev profile -->
+<persistence xmlns="http://java.sun.com/xml/ns/persistence"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd"
+ version="1.0">
+
+ <persistence-unit name="integration">
+ <provider>org.hibernate.ejb.HibernatePersistence</provider>
+ <jta-data-source>java:jboss/datasources/ExampleDS</jta-data-source>
+ <properties>
+ <property name="hibernate.hbm2ddl.auto" value="create-drop"/>
+ <property name="hibernate.cache.use_query_cache" value="false"/>
+ <property name="hibernate.cache.use_second_level_cache" value="false"/>
+ <property name="hibernate.show_sql" value="true"/>
+ <property name="jboss.entity.manager.factory.jndi.name" value="java:/integrationEntityManagerFactory"/>
+ </properties>
+ </persistence-unit>
+
+</persistence>
Added: branches/community/Seam_2_3/seam-integration-tests-ee6/src/test/resources/WEB-INF/components-jbpm.xml
===================================================================
--- branches/community/Seam_2_3/seam-integration-tests-ee6/src/test/resources/WEB-INF/components-jbpm.xml (rev 0)
+++ branches/community/Seam_2_3/seam-integration-tests-ee6/src/test/resources/WEB-INF/components-jbpm.xml 2012-02-28 13:53:30 UTC (rev 14333)
@@ -0,0 +1,58 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<components xmlns="http://jboss.com/products/seam/components"
+ xmlns:bpm="http://jboss.com/products/seam/bpm"
+ xmlns:core="http://jboss.com/products/seam/core"
+ xmlns:i18n="http://jboss.com/products/seam/international"
+ xmlns:security="http://jboss.com/products/seam/security"
+ xmlns:persistence="http://jboss.com/products/seam/persistence"
+ xmlns:web="http://jboss.com/products/seam/web"
+ xmlns:framework="http://jboss.com/products/seam/framework"
+ xmlns:jms="http://jboss.com/products/seam/jms"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation=
+ "http://jboss.com/products/seam/core http://jboss.com/products/seam/core-2.3.xsd
+ http://jboss.com/products/seam/bpm http://jboss.com/products/seam/bpm-2.3.xsd
+ http://jboss.com/products/seam/international http://jboss.com/products/seam/international-2.3.xsd
+ http://jboss.com/products/seam/security http://jboss.com/products/seam/security-2.3.xsd
+ http://jboss.com/products/seam/persistence http://jboss.com/products/seam/persistence-2.3.xsd
+ http://jboss.com/products/seam/components http://jboss.com/products/seam/components-2.3.xsd
+ http://jboss.com/products/seam/web http://jboss.com/products/seam/web-2.3.xsd
+ http://jboss.com/products/seam/jms http://jboss.com/products/seam/jms-2.3.xsd
+ http://jboss.com/products/seam/framework http://jboss.com/products/seam/framework-2.3.xsd">
+
+ <core:init debug="false" jndi-pattern="@jndiPattern@" />
+
+ <core:manager concurrent-request-timeout="500"
+ conversation-timeout="120000"
+ conversation-id-parameter="cid"/>
+
+ <i18n:locale-config default-locale="fr_CA" supported-locales="fr_CA fr_FR en"/>
+
+ <persistence:managed-persistence-context name="entityManager"
+ auto-create="true"
+ persistence-unit-jndi-name="java:/integrationEntityManagerFactory" />
+
+
+ <bpm:jbpm>
+ <bpm:process-definitions>
+ <value>testProcess1.jpdl.xml</value>
+ <value>testProcess2.jpdl.xml</value>
+ <value>testProcess3.jpdl.xml</value>
+ <value>testProcess4.jpdl.xml</value>
+ </bpm:process-definitions>
+ </bpm:jbpm>
+
+
+ <jms:topic-connection topic-connection-factory-jndi-name="/ConnectionFactory" />
+ <jms:queue-connection queue-connection-factory-jndi-name="/ConnectionFactory" />
+
+ <jms:managed-topic-publisher name="testPublisher"
+ auto-create="true"
+ topic-jndi-name="/topic/testTopic" />
+
+ <jms:managed-queue-sender name="testSender"
+ auto-create="true"
+ queue-jndi-name="/queue/testQueue" />
+
+
+</components>
Added: branches/community/Seam_2_3/seam-integration-tests-ee6/src/test/resources/WEB-INF/components.xml
===================================================================
--- branches/community/Seam_2_3/seam-integration-tests-ee6/src/test/resources/WEB-INF/components.xml (rev 0)
+++ branches/community/Seam_2_3/seam-integration-tests-ee6/src/test/resources/WEB-INF/components.xml 2012-02-28 13:53:30 UTC (rev 14333)
@@ -0,0 +1,47 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<components xmlns="http://jboss.com/products/seam/components"
+ xmlns:bpm="http://jboss.com/products/seam/bpm"
+ xmlns:core="http://jboss.com/products/seam/core"
+ xmlns:i18n="http://jboss.com/products/seam/international"
+ xmlns:security="http://jboss.com/products/seam/security"
+ xmlns:persistence="http://jboss.com/products/seam/persistence"
+ xmlns:web="http://jboss.com/products/seam/web"
+ xmlns:framework="http://jboss.com/products/seam/framework"
+ xmlns:jms="http://jboss.com/products/seam/jms"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation=
+ "http://jboss.com/products/seam/core http://jboss.com/products/seam/core-2.3.xsd
+ http://jboss.com/products/seam/bpm http://jboss.com/products/seam/bpm-2.3.xsd
+ http://jboss.com/products/seam/international http://jboss.com/products/seam/international-2.3.xsd
+ http://jboss.com/products/seam/security http://jboss.com/products/seam/security-2.3.xsd
+ http://jboss.com/products/seam/persistence http://jboss.com/products/seam/persistence-2.3.xsd
+ http://jboss.com/products/seam/components http://jboss.com/products/seam/components-2.3.xsd
+ http://jboss.com/products/seam/web http://jboss.com/products/seam/web-2.3.xsd
+ http://jboss.com/products/seam/jms http://jboss.com/products/seam/jms-2.3.xsd
+ http://jboss.com/products/seam/framework http://jboss.com/products/seam/framework-2.3.xsd">
+
+ <core:init debug="false" jndi-pattern="java:app/test/#{ejbName}" />
+
+ <core:manager concurrent-request-timeout="500"
+ conversation-timeout="120000"
+ conversation-id-parameter="cid"/>
+
+ <i18n:locale-config default-locale="fr_CA" supported-locales="fr_CA fr_FR en"/>
+
+ <persistence:managed-persistence-context name="entityManager"
+ auto-create="true"
+ persistence-unit-jndi-name="java:/integrationEntityManagerFactory" />
+
+ <jms:topic-connection topic-connection-factory-jndi-name="/ConnectionFactory" />
+ <jms:queue-connection queue-connection-factory-jndi-name="/ConnectionFactory" />
+
+ <jms:managed-topic-publisher name="testPublisher"
+ auto-create="true"
+ topic-jndi-name="/topic/testTopic" />
+
+ <jms:managed-queue-sender name="testSender"
+ auto-create="true"
+ queue-jndi-name="/queue/testQueue" />
+
+
+</components>
Added: branches/community/Seam_2_3/seam-integration-tests-ee6/src/test/resources/WEB-INF/pages.xml
===================================================================
--- branches/community/Seam_2_3/seam-integration-tests-ee6/src/test/resources/WEB-INF/pages.xml (rev 0)
+++ branches/community/Seam_2_3/seam-integration-tests-ee6/src/test/resources/WEB-INF/pages.xml 2012-02-28 13:53:30 UTC (rev 14333)
@@ -0,0 +1,64 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<pages xmlns="http://jboss.com/products/seam/pages"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://jboss.com/products/seam/pages http://jboss.com/products/seam/pages-2.3.xsd"
+ no-conversation-view-id="/home.xhtml"
+ login-view-id="/login.xhtml">
+
+ <page view-id="/pageWithDescription.xhtml">
+ <description>page description</description>
+ </page>
+
+ <page view-id="/pageWithAnotherDescription.xhtml">
+ <description>another page description</description>
+ </page>
+
+ <page view-id="/pageWithParameter.xhtml">
+ <param name="personName" value="#{person.name}" />
+ </page>
+
+ <page view-id="/pageWithRequiredParameter.xhtml">
+ <param name="personName" value="#{person.name}" required="true"/>
+ </page>
+
+ <page view-id="/pageWithValidateModelDisabledParameter.xhtml">
+ <param name="personName" value="#{person.name}" validateModel="false"/>
+ </page>
+
+ <exception class="org.jboss.seam.framework.EntityNotFoundException">
+ <redirect view-id="/error.xhtml">
+ <message>Not found</message>
+ </redirect>
+ </exception>
+
+ <exception class="javax.persistence.EntityNotFoundException">
+ <redirect view-id="/error.xhtml">
+ <message>Not found</message>
+ </redirect>
+ </exception>
+
+ <exception class="javax.persistence.OptimisticLockException">
+ <end-conversation/>
+ <redirect view-id="/error.xhtml">
+ <message>Another user changed the same data, please try again</message>
+ </redirect>
+ </exception>
+
+ <exception class="org.jboss.seam.security.AuthorizationException">
+ <redirect>
+ <message>You don't have permission to do this</message>
+ </redirect>
+ </exception>
+
+ <exception class="org.jboss.seam.security.NotLoggedInException">
+ <redirect view-id="/login.xhtml">
+ <message>Please log in first</message>
+ </redirect>
+ </exception>
+
+ <exception>
+ <redirect view-id="/error.xhtml">
+ <message>Unexpected error, please try again</message>
+ </redirect>
+ </exception>
+</pages>
Added: branches/community/Seam_2_3/seam-integration-tests-ee6/src/test/resources/WEB-INF/web.xml
===================================================================
--- branches/community/Seam_2_3/seam-integration-tests-ee6/src/test/resources/WEB-INF/web.xml (rev 0)
+++ branches/community/Seam_2_3/seam-integration-tests-ee6/src/test/resources/WEB-INF/web.xml 2012-02-28 13:53:30 UTC (rev 14333)
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<web-app version="3.0"
+ xmlns="http://java.sun.com/xml/ns/javaee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd">
+
+ <listener>
+ <listener-class>org.jboss.seam.servlet.SeamListener</listener-class>
+ </listener>
+
+</web-app>
Added: branches/community/Seam_2_3/seam-integration-tests-ee6/src/test/resources/components.properties
===================================================================
--- branches/community/Seam_2_3/seam-integration-tests-ee6/src/test/resources/components.properties (rev 0)
+++ branches/community/Seam_2_3/seam-integration-tests-ee6/src/test/resources/components.properties 2012-02-28 13:53:30 UTC (rev 14333)
@@ -0,0 +1,3 @@
+# The pattern in components.xml is replaced by an application server specific value in the ant build. This value is used for running tests
+
+jndiPattern \#{ejbName}/local
\ No newline at end of file
Added: branches/community/Seam_2_3/seam-integration-tests-ee6/src/test/resources/hibernate.cfg.xml
===================================================================
--- branches/community/Seam_2_3/seam-integration-tests-ee6/src/test/resources/hibernate.cfg.xml (rev 0)
+++ branches/community/Seam_2_3/seam-integration-tests-ee6/src/test/resources/hibernate.cfg.xml 2012-02-28 13:53:30 UTC (rev 14333)
@@ -0,0 +1,175 @@
+<?xml version='1.0' encoding='utf-8'?>
+
+<!DOCTYPE hibernate-configuration PUBLIC
+ "-//Hibernate/Hibernate Configuration DTD 3.0//EN"
+ "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
+
+<hibernate-configuration>
+ <session-factory>
+
+ <property name="show_sql">false</property>
+ <property name="connection.datasource">java:jboss/datasources/ExampleDS</property>
+ <property name="transaction.factory_class">org.hibernate.transaction.JTATransactionFactory</property>
+ <property name="transaction.manager_lookup_class">org.hibernate.transaction.JBossTransactionManagerLookup</property>
+ <property name="cache.provider_class">org.hibernate.cache.HashtableCacheProvider</property>
+ <property name="hbm2ddl.auto">create-drop</property>
+
+ <property name="hibernate.cache.use_query_cache">false</property>
+ <property name="hibernate.cache.use_second_level_cache">false</property>
+
+ <!--property name="transaction.flush_before_completion">true</property-->
+
+ <!-- ############################################ -->
+ <!-- # mapping files with external dependencies # -->
+ <!-- ############################################ -->
+
+ <!-- following mapping file has a dependendy on -->
+ <!-- 'bsh-{version}.jar'. -->
+ <!-- uncomment this if you don't have bsh on your -->
+ <!-- classpath. you won't be able to use the -->
+ <!-- script element in process definition files -->
+ <mapping resource="org/jbpm/graph/action/Script.hbm.xml"/>
+
+ <!-- following mapping files have a dependendy on -->
+ <!-- 'jbpm-identity.jar', mapping files -->
+ <!-- of the pluggable jbpm identity component. -->
+ <!-- Uncomment the following 3 lines if you -->
+ <!-- want to use the jBPM identity mgmgt -->
+ <!-- component. -->
+ <!-- identity mappings (begin) ===
+ <mapping resource="org/jbpm/identity/User.hbm.xml"/>
+ <mapping resource="org/jbpm/identity/Group.hbm.xml"/>
+ <mapping resource="org/jbpm/identity/Membership.hbm.xml"/>
+ ==== identity mappings (end) -->
+
+ <!-- following mapping files have a dependendy on -->
+ <!-- the JCR API -->
+ <!-- jcr mappings (begin) ===
+ <mapping resource="org/jbpm/context/exe/variableinstance/JcrNodeInstance.hbm.xml"/>
+ ==== jcr mappings (end) -->
+
+
+ <!-- ###################### -->
+ <!-- # jbpm mapping files # -->
+ <!-- ###################### -->
+
+ <mapping resource="org/jbpm/db/hibernate.types.hbm.xml" />
+
+ <!-- hql queries and type defs -->
+ <mapping resource="org/jbpm/db/hibernate.queries.hbm.xml" />
+
+ <!-- graph.action mapping files -->
+ <mapping resource="org/jbpm/graph/action/MailAction.hbm.xml"/>
+
+ <!-- graph.def mapping files -->
+ <mapping resource="org/jbpm/graph/def/ProcessDefinition.hbm.xml"/>
+ <mapping resource="org/jbpm/graph/def/Node.hbm.xml"/>
+ <mapping resource="org/jbpm/graph/def/Transition.hbm.xml"/>
+ <mapping resource="org/jbpm/graph/def/Event.hbm.xml"/>
+ <mapping resource="org/jbpm/graph/def/Action.hbm.xml"/>
+ <mapping resource="org/jbpm/graph/def/SuperState.hbm.xml"/>
+ <mapping resource="org/jbpm/graph/def/ExceptionHandler.hbm.xml"/>
+ <mapping resource="org/jbpm/instantiation/Delegation.hbm.xml"/>
+
+ <!-- graph.node mapping files -->
+ <mapping resource="org/jbpm/graph/node/StartState.hbm.xml"/>
+ <mapping resource="org/jbpm/graph/node/EndState.hbm.xml"/>
+ <mapping resource="org/jbpm/graph/node/ProcessState.hbm.xml"/>
+ <mapping resource="org/jbpm/graph/node/Decision.hbm.xml"/>
+ <mapping resource="org/jbpm/graph/node/Fork.hbm.xml"/>
+ <mapping resource="org/jbpm/graph/node/Join.hbm.xml"/>
+ <mapping resource="org/jbpm/graph/node/MailNode.hbm.xml"/>
+ <mapping resource="org/jbpm/graph/node/State.hbm.xml"/>
+ <mapping resource="org/jbpm/graph/node/TaskNode.hbm.xml"/>
+
+ <!-- context.def mapping files -->
+ <mapping resource="org/jbpm/context/def/ContextDefinition.hbm.xml"/>
+ <mapping resource="org/jbpm/context/def/VariableAccess.hbm.xml"/>
+
+ <!-- taskmgmt.def mapping files -->
+ <mapping resource="org/jbpm/taskmgmt/def/TaskMgmtDefinition.hbm.xml"/>
+ <mapping resource="org/jbpm/taskmgmt/def/Swimlane.hbm.xml"/>
+ <mapping resource="org/jbpm/taskmgmt/def/Task.hbm.xml"/>
+ <mapping resource="org/jbpm/taskmgmt/def/TaskController.hbm.xml"/>
+
+ <!-- module.def mapping files -->
+ <mapping resource="org/jbpm/module/def/ModuleDefinition.hbm.xml"/>
+
+ <!-- bytes mapping files -->
+ <mapping resource="org/jbpm/bytes/ByteArray.hbm.xml"/>
+
+ <!-- file.def mapping files -->
+ <mapping resource="org/jbpm/file/def/FileDefinition.hbm.xml"/>
+
+ <!-- scheduler.def mapping files -->
+ <mapping resource="org/jbpm/scheduler/def/CreateTimerAction.hbm.xml"/>
+ <mapping resource="org/jbpm/scheduler/def/CancelTimerAction.hbm.xml"/>
+
+ <!-- graph.exe mapping files -->
+ <mapping resource="org/jbpm/graph/exe/Comment.hbm.xml"/>
+ <mapping resource="org/jbpm/graph/exe/ProcessInstance.hbm.xml"/>
+ <mapping resource="org/jbpm/graph/exe/Token.hbm.xml"/>
+ <mapping resource="org/jbpm/graph/exe/RuntimeAction.hbm.xml"/>
+
+ <!-- module.exe mapping files -->
+ <mapping resource="org/jbpm/module/exe/ModuleInstance.hbm.xml"/>
+
+ <!-- context.exe mapping files -->
+ <mapping resource="org/jbpm/context/exe/ContextInstance.hbm.xml"/>
+ <mapping resource="org/jbpm/context/exe/TokenVariableMap.hbm.xml"/>
+ <mapping resource="org/jbpm/context/exe/VariableInstance.hbm.xml"/>
+ <mapping resource="org/jbpm/context/exe/variableinstance/ByteArrayInstance.hbm.xml"/>
+ <mapping resource="org/jbpm/context/exe/variableinstance/DateInstance.hbm.xml"/>
+ <mapping resource="org/jbpm/context/exe/variableinstance/DoubleInstance.hbm.xml"/>
+ <mapping resource="org/jbpm/context/exe/variableinstance/HibernateLongInstance.hbm.xml"/>
+ <mapping resource="org/jbpm/context/exe/variableinstance/HibernateStringInstance.hbm.xml"/>
+ <mapping resource="org/jbpm/context/exe/variableinstance/LongInstance.hbm.xml"/>
+ <mapping resource="org/jbpm/context/exe/variableinstance/NullInstance.hbm.xml"/>
+ <mapping resource="org/jbpm/context/exe/variableinstance/StringInstance.hbm.xml"/>
+
+ <!-- job mapping files -->
+ <mapping resource="org/jbpm/job/Job.hbm.xml"/>
+ <mapping resource="org/jbpm/job/Timer.hbm.xml"/>
+ <mapping resource="org/jbpm/job/ExecuteNodeJob.hbm.xml"/>
+ <mapping resource="org/jbpm/job/ExecuteActionJob.hbm.xml"/>
+
+ <!-- taskmgmt.exe mapping files -->
+ <mapping resource="org/jbpm/taskmgmt/exe/TaskMgmtInstance.hbm.xml"/>
+ <mapping resource="org/jbpm/taskmgmt/exe/TaskInstance.hbm.xml"/>
+ <mapping resource="org/jbpm/taskmgmt/exe/PooledActor.hbm.xml"/>
+ <mapping resource="org/jbpm/taskmgmt/exe/SwimlaneInstance.hbm.xml"/>
+
+ <!-- logging mapping files -->
+ <mapping resource="org/jbpm/logging/log/ProcessLog.hbm.xml"/>
+ <mapping resource="org/jbpm/logging/log/MessageLog.hbm.xml"/>
+ <mapping resource="org/jbpm/logging/log/CompositeLog.hbm.xml"/>
+ <mapping resource="org/jbpm/graph/log/ActionLog.hbm.xml"/>
+ <mapping resource="org/jbpm/graph/log/NodeLog.hbm.xml"/>
+ <mapping resource="org/jbpm/graph/log/ProcessInstanceCreateLog.hbm.xml"/>
+ <mapping resource="org/jbpm/graph/log/ProcessInstanceEndLog.hbm.xml"/>
+ <mapping resource="org/jbpm/graph/log/ProcessStateLog.hbm.xml"/>
+ <mapping resource="org/jbpm/graph/log/SignalLog.hbm.xml"/>
+ <mapping resource="org/jbpm/graph/log/TokenCreateLog.hbm.xml"/>
+ <mapping resource="org/jbpm/graph/log/TokenEndLog.hbm.xml"/>
+ <mapping resource="org/jbpm/graph/log/TransitionLog.hbm.xml"/>
+ <mapping resource="org/jbpm/context/log/VariableLog.hbm.xml"/>
+ <mapping resource="org/jbpm/context/log/VariableCreateLog.hbm.xml"/>
+ <mapping resource="org/jbpm/context/log/VariableDeleteLog.hbm.xml"/>
+ <mapping resource="org/jbpm/context/log/VariableUpdateLog.hbm.xml"/>
+ <mapping resource="org/jbpm/context/log/variableinstance/ByteArrayUpdateLog.hbm.xml"/>
+ <mapping resource="org/jbpm/context/log/variableinstance/DateUpdateLog.hbm.xml"/>
+ <mapping resource="org/jbpm/context/log/variableinstance/DoubleUpdateLog.hbm.xml"/>
+ <mapping resource="org/jbpm/context/log/variableinstance/HibernateLongUpdateLog.hbm.xml"/>
+ <mapping resource="org/jbpm/context/log/variableinstance/HibernateStringUpdateLog.hbm.xml"/>
+ <mapping resource="org/jbpm/context/log/variableinstance/LongUpdateLog.hbm.xml"/>
+ <mapping resource="org/jbpm/context/log/variableinstance/StringUpdateLog.hbm.xml"/>
+ <mapping resource="org/jbpm/taskmgmt/log/TaskLog.hbm.xml"/>
+ <mapping resource="org/jbpm/taskmgmt/log/TaskCreateLog.hbm.xml"/>
+ <mapping resource="org/jbpm/taskmgmt/log/TaskAssignLog.hbm.xml"/>
+ <mapping resource="org/jbpm/taskmgmt/log/TaskEndLog.hbm.xml"/>
+ <mapping resource="org/jbpm/taskmgmt/log/SwimlaneLog.hbm.xml"/>
+ <mapping resource="org/jbpm/taskmgmt/log/SwimlaneCreateLog.hbm.xml"/>
+ <mapping resource="org/jbpm/taskmgmt/log/SwimlaneAssignLog.hbm.xml"/>
+
+ </session-factory>
+</hibernate-configuration>
Added: branches/community/Seam_2_3/seam-integration-tests-ee6/src/test/resources/jboss-seam-integration-tests-ds.xml
===================================================================
--- branches/community/Seam_2_3/seam-integration-tests-ee6/src/test/resources/jboss-seam-integration-tests-ds.xml (rev 0)
+++ branches/community/Seam_2_3/seam-integration-tests-ee6/src/test/resources/jboss-seam-integration-tests-ds.xml 2012-02-28 13:53:30 UTC (rev 14333)
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!DOCTYPE datasources
+ PUBLIC "-//JBoss//DTD JBOSS JCA Config 1.5//EN"
+ "http://www.jboss.org/j2ee/dtd/jboss-ds_1_5.dtd">
+
+<datasources>
+
+ <local-tx-datasource>
+ <jndi-name>integrationDatasource</jndi-name>
+ <connection-url>jdbc:hsqldb:.</connection-url>
+ <driver-class>org.hsqldb.jdbcDriver</driver-class>
+ <user-name>sa</user-name>
+ <password></password>
+ </local-tx-datasource>
+
+</datasources>
+
Added: branches/community/Seam_2_3/seam-integration-tests-ee6/src/test/resources/jbpm.cfg.xml
===================================================================
--- branches/community/Seam_2_3/seam-integration-tests-ee6/src/test/resources/jbpm.cfg.xml (rev 0)
+++ branches/community/Seam_2_3/seam-integration-tests-ee6/src/test/resources/jbpm.cfg.xml 2012-02-28 13:53:30 UTC (rev 14333)
@@ -0,0 +1,18 @@
+<jbpm-configuration>
+
+ <jbpm-context>
+ <service name="persistence">
+ <factory>
+ <bean class="org.jbpm.persistence.db.DbPersistenceServiceFactory">
+ <field name="isTransactionEnabled"><false/></field>
+ </bean>
+ </factory>
+ </service>
+ <service name="tx" factory="org.jbpm.tx.TxServiceFactory" />
+ <service name="message" factory="org.jbpm.msg.db.DbMessageServiceFactory" />
+ <service name="scheduler" factory="org.jbpm.scheduler.db.DbSchedulerServiceFactory" />
+ <service name="logging" factory="org.jbpm.logging.db.DbLoggingServiceFactory" />
+ <service name="authentication" factory="org.jbpm.security.authentication.DefaultAuthenticationServiceFactory" />
+ </jbpm-context>
+
+</jbpm-configuration>
Added: branches/community/Seam_2_3/seam-integration-tests-ee6/src/test/resources/messages_en.properties
===================================================================
--- branches/community/Seam_2_3/seam-integration-tests-ee6/src/test/resources/messages_en.properties (rev 0)
+++ branches/community/Seam_2_3/seam-integration-tests-ee6/src/test/resources/messages_en.properties 2012-02-28 13:53:30 UTC (rev 14333)
@@ -0,0 +1,116 @@
+up=\u2191
+down=\u2193
+left=\u2039
+right=\u203A
+
+validator.assertFalse=validation failed
+validator.assertTrue=validation failed
+validator.future=must be a future date
+validator.length=length must be between {min} and {max}
+validator.max=must be less than or equal to {value}
+validator.min=must be greater than or equal to {value}
+validator.notNull=may not be null
+validator.past=must be a past date
+validator.pattern=must match "{regex}"
+validator.range=must be between {min} and {max}
+validator.size=size must be between {min} and {max}
+validator.email=must be a well-formed email address
+
+org.jboss.seam.loginFailed=Login failed
+org.jboss.seam.loginSuccessful=Welcome, #0
+
+org.jboss.seam.TransactionFailed=Transaction failed
+org.jboss.seam.NoConversation=The conversation ended, timed out or was processing another request
+org.jboss.seam.IllegalNavigation=Illegal navigation
+org.jboss.seam.ProcessEnded=Process #0 already ended
+org.jboss.seam.ProcessNotFound=Process #0 not found
+org.jboss.seam.TaskEnded=Task #0 already ended
+org.jboss.seam.TaskNotFound=Task #0 not found
+org.jboss.seam.NotLoggedIn=Please log in first
+
+javax.faces.component.UIInput.CONVERSION=value could not be converted to the expected type
+javax.faces.component.UIInput.REQUIRED=value is required
+javax.faces.component.UIInput.UPDATE=an error occurred when processing your submitted information
+javax.faces.component.UISelectOne.INVALID=value is not valid
+javax.faces.component.UISelectMany.INVALID=value is not valid
+
+javax.faces.converter.BigDecimalConverter.DECIMAL=value must be a number
+javax.faces.converter.BigDecimalConverter.DECIMAL_detail=value must be a signed decimal number consisting of zero or more digits, optionally followed by a decimal point and fraction, eg. {1}
+javax.faces.converter.BigIntegerConverter.BIGINTEGER=value must be an integer
+javax.faces.converter.BigIntegerConverter.BIGINTEGER_detail=value must be a signed integer number consisting of zero or more digits
+javax.faces.converter.BooleanConverter.BOOLEAN=value must be true or false
+javax.faces.converter.BooleanConverter.BOOLEAN_detail=value must be true or false (any value other than true will evaluate to false)
+javax.faces.converter.ByteConverter.BYTE=value must be a number between 0 and 255
+javax.faces.converter.ByteConverter.BYTE_detail=value must be a number between 0 and 255
+javax.faces.converter.CharacterConverter.CHARACTER=value must be a character
+javax.faces.converter.CharacterConverter.CHARACTER_detail=value must be a valid ASCII character
+javax.faces.converter.DateTimeConverter.DATE=value must be a date
+javax.faces.converter.DateTimeConverter.DATE_detail=value must be a date, eg. {1}
+javax.faces.converter.DateTimeConverter.TIME=value must be a time
+javax.faces.converter.DateTimeConverter.TIME_detail=value must be a time, eg. {1}
+javax.faces.converter.DateTimeConverter.DATETIME=value must be a date and time
+javax.faces.converter.DateTimeConverter.DATETIME_detail=value must be a date and time, eg. {1}
+javax.faces.converter.DateTimeConverter.PATTERN_TYPE=a pattern or type attribute must be specified to convert the value
+javax.faces.converter.DoubleConverter.DOUBLE=value must be a number
+javax.faces.converter.DoubleConverter.DOUBLE_detail=value must be a number between 4.9E-324 and 1.7976931348623157E308
+javax.faces.converter.EnumConverter.ENUM=value must be convertible to an enum
+javax.faces.converter.EnumConverter.ENUM_detail=value must be convertible to an enum or from the enum that contains the constant {1}
+javax.faces.converter.EnumConverter.ENUM_NO_CLASS=value must be convertible to an enum or from the enum, but no enum class provided
+javax.faces.converter.EnumConverter.ENUM_NO_CLASS_detail=value must be convertible to an enum or from the enum, but no enum class provided
+javax.faces.converter.FloatConverter.FLOAT=value must be a number
+javax.faces.converter.FloatConverter.FLOAT_detail=value must be a number between 1.4E-45 and 3.4028235E38
+javax.faces.converter.IntegerConverter.INTEGER=value must be an integer
+javax.faces.converter.IntegerConverter.INTEGER_detail=value must be an integer number between -2147483648 and 2147483647
+javax.faces.converter.LongConverter.LONG=value must be an integer
+javax.faces.converter.LongConverter.LONG_detail=must be an integer number between -9223372036854775808 and 9223372036854775807
+javax.faces.converter.NumberConverter.CURRENCY=value must be a currency amount
+javax.faces.converter.NumberConverter.CURRENCY_detail=value must be a currency amount, eg. {1}
+javax.faces.converter.NumberConverter.PERCENT=value must be a percentage amount
+javax.faces.converter.NumberConverter.PERCENT_detail=value must be a percentage amount, eg. {1}
+javax.faces.converter.NumberConverter.NUMBER=value must be a number
+javax.faces.converter.NumberConverter.NUMBER_detail=value must be a number
+javax.faces.converter.NumberConverter.PATTERN=value must be a number
+javax.faces.converter.NumberConverter.PATTERN_detail=value must be a number
+javax.faces.converter.ShortConverter.SHORT=value must be an integer
+javax.faces.converter.ShortConverter.SHORT_detail=value must be an integer number between -32768 and 32767
+
+javax.faces.validator.DoubleRangeValidator.MAXIMUM=value must be less than or equal to {0}
+javax.faces.validator.DoubleRangeValidator.MINIMUM=value must be greater than or equal to {0}
+javax.faces.validator.DoubleRangeValidator.NOT_IN_RANGE=value must be between {0} and {1}
+javax.faces.validator.DoubleRangeValidator.TYPE=value is not of the correct type
+javax.faces.validator.LengthValidator.MAXIMUM=value is must be shorter than or equal to {0} characters
+javax.faces.validator.LengthValidator.MINIMUM=value is must be longer than or equal to {0} characters
+javax.faces.validator.LongRangeValidator.MAXIMUM=value must be less than or equal to {0}
+javax.faces.validator.LongRangeValidator.MINIMUM=value must be greater than or equal to {0}
+javax.faces.validator.LongRangeValidator.NOT_IN_RANGE=value must be between {0} and {1}
+javax.faces.validator.LongRangeValidator.TYPE=value is not of the correct type
+
+javax.faces.validator.NOT_IN_RANGE=value must be between {0} and {1}
+javax.faces.converter.STRING=value could not be converted to a string
+
+#JSF 1.1:
+javax.faces.convert.BigDecimalConverter.CONVERSION value must be a number
+javax.faces.convert.BigDecimalConverter.CONVERSION_detail value must be a number
+javax.faces.convert.BigIntegerConverter.CONVERSION value must be an integre
+javax.faces.convert.BigIntegerConverter.CONVERSION_detail value must be a number
+javax.faces.convert.BooleanConverter.CONVERSION value must be true or false
+javax.faces.convert.BooleanConverter.CONVERSION_detail value must be true or false
+javax.faces.convert.ByteConverter.CONVERSION value must be a byte
+javax.faces.convert.ByteConverter.CONVERSION_detail value must be a byte
+javax.faces.convert.CharacterConverter.CONVERSION value must be a character
+javax.faces.convert.CharacterConverter.CONVERSION_detail value must be a character
+javax.faces.convert.DateTimeConverter.CONVERSION value must be a datetime
+javax.faces.convert.DateTimeConverter.CONVERSION_detail value must be a datetime
+javax.faces.convert.DoubleConverter.CONVERSION value must be a number
+javax.faces.convert.DoubleConverter.CONVERSION_detail value must be a number
+javax.faces.convert.FloatConverter.CONVERSION value must be a number
+javax.faces.convert.FloatConverter.CONVERSION_detail value must be a number
+javax.faces.convert.IntegerConverter.CONVERSION value must be an integer
+javax.faces.convert.IntegerConverter.CONVERSION_detail value must be an integer
+javax.faces.convert.LongConverter.CONVERSION value must be an integer
+javax.faces.convert.LongConverter.CONVERSION_detail value must be a long integer
+javax.faces.convert.NumberConverter.CONVERSION value must be a number
+javax.faces.convert.NumberConverter.CONVERSION_detail value must be a number
+javax.faces.convert.ShortConverter.CONVERSION value must be an integer
+javax.faces.convert.ShortConverter.CONVERSION_detail value must be a short integer
+descriptionError=Less than \#{disc.name}
\ No newline at end of file
Added: branches/community/Seam_2_3/seam-integration-tests-ee6/src/test/resources/test-destinations-service.xml
===================================================================
--- branches/community/Seam_2_3/seam-integration-tests-ee6/src/test/resources/test-destinations-service.xml (rev 0)
+++ branches/community/Seam_2_3/seam-integration-tests-ee6/src/test/resources/test-destinations-service.xml 2012-02-28 13:53:30 UTC (rev 14333)
@@ -0,0 +1,17 @@
+<server>
+ <mbean code="org.jboss.mq.server.jmx.Topic"
+ name="jboss.mq.destination:service=Topic,name=testTopic">
+ <depends optional-attribute-name="ServerPeer">
+ jboss.messaging:service=ServerPeer
+ </depends>
+ <depends>jboss.messaging:service=PostOffice</depends>
+ </mbean>
+
+ <mbean code="org.jboss.mq.server.jmx.Queue"
+ name="jboss.mq.destination:service=Queue,name=testQueue">
+ <depends optional-attribute-name="ServerPeer">
+ jboss.messaging:service=ServerPeer
+ </depends>
+ <depends>jboss.messaging:service=PostOffice</depends>
+ </mbean>
+</server>
Added: branches/community/Seam_2_3/seam-integration-tests-ee6/src/test/resources/testProcess1.jpdl.xml
===================================================================
--- branches/community/Seam_2_3/seam-integration-tests-ee6/src/test/resources/testProcess1.jpdl.xml (rev 0)
+++ branches/community/Seam_2_3/seam-integration-tests-ee6/src/test/resources/testProcess1.jpdl.xml 2012-02-28 13:53:30 UTC (rev 14333)
@@ -0,0 +1,12 @@
+<process-definition name="TestProcess1"
+ xmlns="urn:jbpm.org:jpdl-3.2"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="urn:jbpm.org:jpdl-3.2 http://jbpm.org/xsd/jpdl-3.2.xsd">
+
+ <start-state name="start">
+ <transition to="done"/>
+ </start-state>
+
+ <end-state name="done"/>
+
+</process-definition>
Added: branches/community/Seam_2_3/seam-integration-tests-ee6/src/test/resources/testProcess2.jpdl.xml
===================================================================
--- branches/community/Seam_2_3/seam-integration-tests-ee6/src/test/resources/testProcess2.jpdl.xml (rev 0)
+++ branches/community/Seam_2_3/seam-integration-tests-ee6/src/test/resources/testProcess2.jpdl.xml 2012-02-28 13:53:30 UTC (rev 14333)
@@ -0,0 +1,17 @@
+<process-definition name="TestProcess2"
+ xmlns="urn:jbpm.org:jpdl-3.2"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="urn:jbpm.org:jpdl-3.2 http://jbpm.org/xsd/jpdl-3.2.xsd">
+
+ <start-state name="start">
+ <transition to="decision" />
+ </start-state>
+
+ <decision name="decision" expression="#{seamExpressionEvaluatorTestController.name eq 'foo'}">
+ <transition to="done" name="true" />
+ <transition to="done" name="false" />
+ </decision>
+
+ <end-state name="done"/>
+
+</process-definition>
Added: branches/community/Seam_2_3/seam-integration-tests-ee6/src/test/resources/testProcess3.jpdl.xml
===================================================================
--- branches/community/Seam_2_3/seam-integration-tests-ee6/src/test/resources/testProcess3.jpdl.xml (rev 0)
+++ branches/community/Seam_2_3/seam-integration-tests-ee6/src/test/resources/testProcess3.jpdl.xml 2012-02-28 13:53:30 UTC (rev 14333)
@@ -0,0 +1,14 @@
+<process-definition name="TestProcess3"
+ xmlns="urn:jbpm.org:jpdl-3.2"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="urn:jbpm.org:jpdl-3.2 http://jbpm.org/xsd/jpdl-3.2.xsd">
+
+ <start-state name="start">
+ <transition to="done">
+ <action expression="#{seamExpressionEvaluatorTestController.nonExistentMethod}" />
+ </transition>
+ </start-state>
+
+ <end-state name="done"/>
+
+</process-definition>
Added: branches/community/Seam_2_3/seam-integration-tests-ee6/src/test/resources/testProcess4.jpdl.xml
===================================================================
--- branches/community/Seam_2_3/seam-integration-tests-ee6/src/test/resources/testProcess4.jpdl.xml (rev 0)
+++ branches/community/Seam_2_3/seam-integration-tests-ee6/src/test/resources/testProcess4.jpdl.xml 2012-02-28 13:53:30 UTC (rev 14333)
@@ -0,0 +1,19 @@
+<process-definition name="TestProcess4"
+ xmlns="urn:jbpm.org:jpdl-3.2"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="urn:jbpm.org:jpdl-3.2 http://jbpm.org/xsd/jpdl-3.2.xsd">
+
+ <start-state name="start">
+ <transition to="decision" />
+ </start-state>
+
+ <decision name="decision" expression="#{testBoolean}">
+ <transition to="done" name="true">
+ <action expression="#{seamExpressionEvaluatorTestController.logTrue}" />
+ </transition>
+ <transition to="done" name="false" />
+ </decision>
+
+ <end-state name="done"/>
+
+</process-definition>
Added: branches/community/Seam_2_3/seam-integration-tests-ee6/src/test/resources-jbossas-7/arquillian.xml
===================================================================
--- branches/community/Seam_2_3/seam-integration-tests-ee6/src/test/resources-jbossas-7/arquillian.xml (rev 0)
+++ branches/community/Seam_2_3/seam-integration-tests-ee6/src/test/resources-jbossas-7/arquillian.xml 2012-02-28 13:53:30 UTC (rev 14333)
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<arquillian xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns="http://jboss.org/schema/arquillian"
+ xsi:schemaLocation="http://jboss.org/schema/arquillian http://jboss.org/schema/arquillian/arquillian_1_0.xsd">
+
+ <engine>
+ <property name="deploymentExportPath">target/</property>
+ </engine>
+
+ <container qualifier="jboss" default="true">
+ <configuration>
+ <property name="javaVmArguments">-Xmx1024m -XX:MaxPermSize=512m</property>
+ <property name="jbossHome">target/jboss-as-${version.jbossas7}</property>
+ </configuration>
+ </container>
+
+</arquillian>
More information about the seam-commits
mailing list