[seam-commits] Seam SVN: r14840 - in branches/community/Seam_2_3/examples-ee6/seamdiscs: seamdiscs-ear and 8 other directories.

seam-commits at lists.jboss.org seam-commits at lists.jboss.org
Wed Jun 6 10:24:39 EDT 2012


Author: maschmid
Date: 2012-06-06 10:24:38 -0400 (Wed, 06 Jun 2012)
New Revision: 14840

Added:
   branches/community/Seam_2_3/examples-ee6/seamdiscs/seamdiscs-tests/src/test/java/org/jboss/seam/example/seamdiscs/test/Deployments.java
   branches/community/Seam_2_3/examples-ee6/seamdiscs/seamdiscs-tests/src/test/resources-integration/arquillian.xml
   branches/community/Seam_2_3/examples-ee6/seamdiscs/seamdiscs-tests/src/test/resources-integration/web.xml
Removed:
   branches/community/Seam_2_3/examples-ee6/seamdiscs/seamdiscs-tests/src/test/resources-integration/testng.xml
   branches/community/Seam_2_3/examples-ee6/seamdiscs/seamdiscs-tests/src/test/resources/WEB-INF/
   branches/community/Seam_2_3/examples-ee6/seamdiscs/seamdiscs-tests/src/test/resources/seam.properties
Modified:
   branches/community/Seam_2_3/examples-ee6/seamdiscs/pom.xml
   branches/community/Seam_2_3/examples-ee6/seamdiscs/seamdiscs-ear/pom.xml
   branches/community/Seam_2_3/examples-ee6/seamdiscs/seamdiscs-ear/src/main/application/META-INF/jboss-seam-seambay-ds.xml
   branches/community/Seam_2_3/examples-ee6/seamdiscs/seamdiscs-ejb/pom.xml
   branches/community/Seam_2_3/examples-ee6/seamdiscs/seamdiscs-ejb/src/main/java/org/jboss/seam/example/seamdiscs/action/BandMemberFinder.java
   branches/community/Seam_2_3/examples-ee6/seamdiscs/seamdiscs-tests/pom.xml
   branches/community/Seam_2_3/examples-ee6/seamdiscs/seamdiscs-tests/src/test/java/org/jboss/seam/example/seamdiscs/test/DisplayArtistTest.java
   branches/community/Seam_2_3/examples-ee6/seamdiscs/seamdiscs-tests/src/test/java/org/jboss/seam/example/seamdiscs/test/DisplayDiscTest.java
   branches/community/Seam_2_3/examples-ee6/seamdiscs/seamdiscs-tests/src/test/java/org/jboss/seam/example/seamdiscs/test/EditArtistTest.java
   branches/community/Seam_2_3/examples-ee6/seamdiscs/seamdiscs-tests/src/test/java/org/jboss/seam/example/seamdiscs/test/EditDiscTest.java
   branches/community/Seam_2_3/examples-ee6/seamdiscs/seamdiscs-tests/src/test/java/org/jboss/seam/example/seamdiscs/test/LoginTest.java
   branches/community/Seam_2_3/examples-ee6/seamdiscs/seamdiscs-web/pom.xml
Log:
seamdiscs integration tests


Modified: branches/community/Seam_2_3/examples-ee6/seamdiscs/pom.xml
===================================================================
--- branches/community/Seam_2_3/examples-ee6/seamdiscs/pom.xml	2012-06-06 14:21:12 UTC (rev 14839)
+++ branches/community/Seam_2_3/examples-ee6/seamdiscs/pom.xml	2012-06-06 14:24:38 UTC (rev 14840)
@@ -19,7 +19,7 @@
         <module>seamdiscs-ear</module>
         <module>seamdiscs-ejb</module>
         <module>seamdiscs-web</module>
-<!--         <module>seamdiscs-tests</module> -->
+        <module>seamdiscs-tests</module>
     </modules>
     
     <dependencyManagement>

Modified: branches/community/Seam_2_3/examples-ee6/seamdiscs/seamdiscs-ear/pom.xml
===================================================================
--- branches/community/Seam_2_3/examples-ee6/seamdiscs/seamdiscs-ear/pom.xml	2012-06-06 14:21:12 UTC (rev 14839)
+++ branches/community/Seam_2_3/examples-ee6/seamdiscs/seamdiscs-ear/pom.xml	2012-06-06 14:24:38 UTC (rev 14840)
@@ -30,10 +30,6 @@
             <type>ejb</type>
             <scope>compile</scope>
         </dependency>
-        <dependency>
-            <groupId>org.apache.myfaces.trinidad</groupId>
-            <artifactId>trinidad-api</artifactId>
-        </dependency>      
     </dependencies>
 
     <build>

Modified: branches/community/Seam_2_3/examples-ee6/seamdiscs/seamdiscs-ear/src/main/application/META-INF/jboss-seam-seambay-ds.xml
===================================================================
--- branches/community/Seam_2_3/examples-ee6/seamdiscs/seamdiscs-ear/src/main/application/META-INF/jboss-seam-seambay-ds.xml	2012-06-06 14:21:12 UTC (rev 14839)
+++ branches/community/Seam_2_3/examples-ee6/seamdiscs/seamdiscs-ear/src/main/application/META-INF/jboss-seam-seambay-ds.xml	2012-06-06 14:24:38 UTC (rev 14840)
@@ -4,7 +4,7 @@
         jndi-name="java:/jboss/seamdiscsDatasource" 
         enabled="true" 
         use-java-context="true" pool-name="seamdiscs">
-        <connection-url>jdbc:h2:mem:seambaydb;DB_CLOSE_DELAY=-1</connection-url>
+        <connection-url>jdbc:h2:mem:seamdiscsdb;DB_CLOSE_DELAY=-1</connection-url>
         <driver>h2</driver>
         <security>
             <user-name>sa</user-name>

Modified: branches/community/Seam_2_3/examples-ee6/seamdiscs/seamdiscs-ejb/pom.xml
===================================================================
--- branches/community/Seam_2_3/examples-ee6/seamdiscs/seamdiscs-ejb/pom.xml	2012-06-06 14:21:12 UTC (rev 14839)
+++ branches/community/Seam_2_3/examples-ee6/seamdiscs/seamdiscs-ejb/pom.xml	2012-06-06 14:24:38 UTC (rev 14840)
@@ -48,7 +48,6 @@
         <dependency>
             <groupId>org.apache.myfaces.trinidad</groupId>
             <artifactId>trinidad-api</artifactId>
-            <scope>provided</scope>
         </dependency>
     </dependencies>
    

Modified: branches/community/Seam_2_3/examples-ee6/seamdiscs/seamdiscs-ejb/src/main/java/org/jboss/seam/example/seamdiscs/action/BandMemberFinder.java
===================================================================
--- branches/community/Seam_2_3/examples-ee6/seamdiscs/seamdiscs-ejb/src/main/java/org/jboss/seam/example/seamdiscs/action/BandMemberFinder.java	2012-06-06 14:21:12 UTC (rev 14839)
+++ branches/community/Seam_2_3/examples-ee6/seamdiscs/seamdiscs-ejb/src/main/java/org/jboss/seam/example/seamdiscs/action/BandMemberFinder.java	2012-06-06 14:24:38 UTC (rev 14840)
@@ -14,7 +14,7 @@
    @Transactional
    public List<BandMember> getBandMembers(Object name)
    {
-      return getEntityManager().createQuery("select bm from BandMember bm where lower(bm.name) like lower(:name + '%')").setParameter("name", name).getResultList();
+      return getEntityManager().createQuery("select bm from BandMember bm where lower(bm.name) like lower(:name || '%')").setParameter("name", name).getResultList();
    }
    
 }

Modified: branches/community/Seam_2_3/examples-ee6/seamdiscs/seamdiscs-tests/pom.xml
===================================================================
--- branches/community/Seam_2_3/examples-ee6/seamdiscs/seamdiscs-tests/pom.xml	2012-06-06 14:21:12 UTC (rev 14839)
+++ branches/community/Seam_2_3/examples-ee6/seamdiscs/seamdiscs-tests/pom.xml	2012-06-06 14:24:38 UTC (rev 14840)
@@ -24,14 +24,8 @@
             <artifactId>jboss-seam</artifactId>
             <type>ejb</type>
             <scope>test</scope>
-        </dependency>        
+        </dependency>
         <dependency>
-            <groupId>org.jboss.seam</groupId>
-            <artifactId>jboss-seam</artifactId>
-            <type>ejb</type>
-            <scope>test</scope>
-        </dependency>        
-        <dependency>
             <groupId>org.slf4j</groupId>
             <artifactId>slf4j-log4j12</artifactId>
             <scope>test</scope>
@@ -41,13 +35,16 @@
             <artifactId>jboss-jsf-api_2.0_spec</artifactId>
         </dependency>
         <dependency>
-            <groupId>org.seleniumhq.selenium.server</groupId>
+            <groupId>org.hibernate.javax.persistence</groupId>
+            <artifactId>hibernate-jpa-2.0-api</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.seleniumhq.selenium</groupId>
             <artifactId>selenium-server</artifactId>
-            <classifier>standalone</classifier>
         </dependency>
         <dependency>
-            <groupId>org.seleniumhq.selenium.client-drivers</groupId>
-            <artifactId>selenium-java-client-driver</artifactId>
+            <groupId>org.seleniumhq.selenium</groupId>
+            <artifactId>selenium-java</artifactId>
         </dependency>
         <dependency>
             <groupId>org.jboss.seam</groupId>
@@ -61,15 +58,37 @@
         <dependency>
             <groupId>org.apache.myfaces.trinidad</groupId>
             <artifactId>trinidad-api</artifactId>
+            <scope>test</scope>
         </dependency>
         <dependency>
-            <groupId>org.apache.myfaces.trinidad</groupId>
-            <artifactId>trinidad-impl</artifactId>
-        </dependency>
-        <dependency>
             <groupId>org.dbunit</groupId>
             <artifactId>dbunit</artifactId>
         </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>
+
     </dependencies>
     
     <build>
@@ -79,68 +98,60 @@
                 <filtering>true</filtering>
             </testResource>
             <testResource>
-                <directory>src/test/bootstrap</directory>
-                <filtering>false</filtering>
+                <directory>src/test/resources-integration</directory>
             </testResource>
-            <testResource>
-                <directory>${basedir}/../seamdiscs-ear/src/main/application</directory>
-                <filtering>true</filtering>
-            </testResource>
-            <testResource>
-                <directory>${basedir}/../seamdiscs-ear/src/main/resources</directory>
-                <filtering>true</filtering>
-            </testResource>
-            <testResource>
-                 <directory>${basedir}/../seamdiscs-web/src/main/resources</directory>
-                 <filtering>true</filtering>
-            </testResource>
         </testResources>
         <plugins>
             <plugin>
                 <groupId>org.apache.maven.plugins</groupId>
                 <artifactId>maven-surefire-plugin</artifactId>
                 <configuration>
-                    <skipTests>false</skipTests>
-                    <argLine>-Dsun.lang.ClassLoader.allowArraySyntax=true -Xms512m -Xmx512m</argLine>             
-                    <additionalClasspathElements>
-                        <additionalClasspathElement>${basedir}/../seamdiscs-web/src/main/webapp</additionalClasspathElement>
-                        <additionalClasspathElement>${project.build.directory}/dependency/bootstrap</additionalClasspathElement>
-                    </additionalClasspathElements>
-                    <suiteXmlFiles>
-                        <suiteXmlFile>src/test/resources-integration/testng.xml</suiteXmlFile>
-                    </suiteXmlFiles>
+                    <skip>true</skip>
                 </configuration>
             </plugin>
-            <plugin>
-                <groupId>org.apache.maven.plugins</groupId>
-                <artifactId>maven-dependency-plugin</artifactId>
-                <executions>
-                    <execution>
-                       <id>copy-seam-bootstrap</id>
-                       <phase>process-resources</phase>
-                       <goals>
-                          <goal>unpack</goal>
-                       </goals>
-                       <configuration>
-                          <includes>bootstrap/**</includes>
-                          <artifactItems>
-                              <artifactItem>
-                                   <groupId>org.jboss.seam</groupId>
-                                   <artifactId>jboss-embedded-bootstrap</artifactId>
-                                   <version>${project.version}</version>
-                                   <type>jar</type>
-                                   <overWrite>false</overWrite>
-                              </artifactItem>
-                          </artifactItems>
-                       </configuration>
-                    </execution>
-                </executions>
-            </plugin>
         </plugins>     
     </build>    
 
     <profiles>
+
         <profile>
+            <id>integration-tests</id>
+            <activation>
+                <property>
+                    <name>arquillian</name>
+                </property>
+            </activation>
+        </profile>
+
+        <profile>
+            <id>arq-jbossas-7-managed</id>
+            <activation>
+                <property>
+                    <name>arquillian</name>
+                    <value>jbossas-managed-7</value>
+                </property>
+            </activation>
+            <build>
+                <plugins>
+                    <plugin>
+                        <groupId>org.apache.maven.plugins</groupId>
+                        <artifactId>maven-dependency-plugin</artifactId>
+                    </plugin>
+                </plugins>
+            </build>
+        </profile>
+
+        <profile>
+            <id>arq-jbossas-7-remote</id>
+            <activation>
+                <property>
+                    <name>arquillian</name>
+                    <value>jbossas-remote-7</value>
+                </property>
+            </activation>
+        </profile>
+
+        <profile>
             <id>ftest-jbossas</id>
             <properties>
                 <example.context.path>seam-seamdiscs</example.context.path>
@@ -149,18 +160,6 @@
                 <plugins>
                     <plugin>
                         <groupId>org.codehaus.mojo</groupId>
-                        <artifactId>jboss-maven-plugin</artifactId>
-                        <configuration>
-                            <jbossHome>${jboss.home}</jbossHome>
-                            <serverName>${jboss.domain}</serverName>
-                            <fileNames>
-                                <param>${basedir}/../seamdiscs-ear/src/main/resources/jboss-seam-seamdiscs-ds.xml</param>
-                                <param>${basedir}/../seamdiscs-ear/target/seam-seamdiscs.ear</param>
-                            </fileNames>
-                        </configuration>
-                    </plugin>
-                    <plugin>
-                        <groupId>org.codehaus.mojo</groupId>
                         <artifactId>selenium-maven-plugin</artifactId>
                     </plugin>
                     <plugin>

Added: branches/community/Seam_2_3/examples-ee6/seamdiscs/seamdiscs-tests/src/test/java/org/jboss/seam/example/seamdiscs/test/Deployments.java
===================================================================
--- branches/community/Seam_2_3/examples-ee6/seamdiscs/seamdiscs-tests/src/test/java/org/jboss/seam/example/seamdiscs/test/Deployments.java	                        (rev 0)
+++ branches/community/Seam_2_3/examples-ee6/seamdiscs/seamdiscs-tests/src/test/java/org/jboss/seam/example/seamdiscs/test/Deployments.java	2012-06-06 14:24:38 UTC (rev 14840)
@@ -0,0 +1,37 @@
+package org.jboss.seam.example.seamdiscs.test;
+
+import org.jboss.shrinkwrap.api.ShrinkWrap;
+import org.jboss.shrinkwrap.api.importer.ZipImporter;
+import org.jboss.shrinkwrap.api.spec.EnterpriseArchive;
+import org.jboss.shrinkwrap.api.spec.JavaArchive;
+import org.jboss.shrinkwrap.api.spec.WebArchive;
+import org.jboss.shrinkwrap.resolver.api.DependencyResolvers;
+import org.jboss.shrinkwrap.resolver.api.maven.MavenDependencyResolver;
+
+import java.io.File;
+
+public class Deployments {
+    public static EnterpriseArchive seamdiscsDeployment() {
+        EnterpriseArchive ear = ShrinkWrap.create(ZipImporter.class, "seam-seamdiscs.ear").importFrom(new File("../seamdiscs-ear/target/seam-seamdiscs.ear"))
+              .as(EnterpriseArchive.class);
+
+        // Install org.jboss.seam.mock.MockSeamListener
+        WebArchive web = ear.getAsType(WebArchive.class, "seamdiscs-web.war");
+        web.delete("/WEB-INF/web.xml");
+        web.addAsWebInfResource("web.xml");
+        
+        web.delete("/WEB-INF/faces-config.xml");
+        
+        web.addAsResource("org/jboss/seam/example/seamdiscs/test/BaseData.xml", "org/jboss/seam/example/seamdiscs/test/BaseData.xml");
+        
+        JavaArchive ejb =  ear.getAsType(JavaArchive.class, "seamdiscs-ejb.jar");
+        ejb.addClasses(TestStrings.class);
+        
+        ear.addAsLibraries(DependencyResolvers.use(MavenDependencyResolver.class)
+              .configureFrom("pom.xml")
+              .artifact("org.dbunit:dbunit:jar:2.2")
+              .resolveAsFiles());
+
+        return ear;
+    }
+}

Modified: branches/community/Seam_2_3/examples-ee6/seamdiscs/seamdiscs-tests/src/test/java/org/jboss/seam/example/seamdiscs/test/DisplayArtistTest.java
===================================================================
--- branches/community/Seam_2_3/examples-ee6/seamdiscs/seamdiscs-tests/src/test/java/org/jboss/seam/example/seamdiscs/test/DisplayArtistTest.java	2012-06-06 14:21:12 UTC (rev 14839)
+++ branches/community/Seam_2_3/examples-ee6/seamdiscs/seamdiscs-tests/src/test/java/org/jboss/seam/example/seamdiscs/test/DisplayArtistTest.java	2012-06-06 14:24:38 UTC (rev 14840)
@@ -14,17 +14,39 @@
 
 import org.apache.myfaces.trinidad.model.CollectionModel;
 import org.apache.myfaces.trinidad.model.SortCriterion;
+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.example.seamdiscs.model.Artist;
 import org.jboss.seam.example.seamdiscs.model.Band;
-import org.jboss.seam.mock.DBUnitSeamTest;
-import org.testng.annotations.Test;
+import org.jboss.seam.mock.DBJUnitSeamTest;
+import org.jboss.seam.trinidad.SeamCollectionModel;
+import org.jboss.shrinkwrap.api.Archive;
+import org.jboss.shrinkwrap.api.spec.EnterpriseArchive;
+import org.jboss.shrinkwrap.api.spec.WebArchive;
+import org.junit.runner.RunWith;
+import org.junit.Test;
 
+ at RunWith(Arquillian.class)
+public class DisplayArtistTest extends DBJUnitSeamTest
+{
+    @Deployment(name="DisplayArtistTest")
+    @OverProtocol("Servlet 3.0")
+    public static Archive<?> createDeployment()
+    {
+        EnterpriseArchive er = Deployments.seamdiscsDeployment();
+        WebArchive web = er.getAsType(WebArchive.class, "seamdiscs-web.war");
+        web.addClasses(DisplayArtistTest.class);
 
-public class DisplayArtistTest extends DBUnitSeamTest
-{
+        return er;
+    }
     
     @Override
     protected void prepareDBUnitOperations() {
+       
+        setDatabase("HSQL");
+        setDatasourceJndiName("java:/jboss/seamdiscsDatasource");
+       
         beforeTestOperations.add(
                 new DataSetOperation("org/jboss/seam/example/seamdiscs/test/BaseData.xml")
         );
@@ -123,6 +145,7 @@
             protected void renderResponse() throws Exception 
             {
                 Object artists = getValue("#{artists.dataModel}");
+                
                 assert artists instanceof CollectionModel;
                 CollectionModel collectionModel = (CollectionModel) artists;
                 

Modified: branches/community/Seam_2_3/examples-ee6/seamdiscs/seamdiscs-tests/src/test/java/org/jboss/seam/example/seamdiscs/test/DisplayDiscTest.java
===================================================================
--- branches/community/Seam_2_3/examples-ee6/seamdiscs/seamdiscs-tests/src/test/java/org/jboss/seam/example/seamdiscs/test/DisplayDiscTest.java	2012-06-06 14:21:12 UTC (rev 14839)
+++ branches/community/Seam_2_3/examples-ee6/seamdiscs/seamdiscs-tests/src/test/java/org/jboss/seam/example/seamdiscs/test/DisplayDiscTest.java	2012-06-06 14:24:38 UTC (rev 14840)
@@ -15,16 +15,35 @@
 
 import javax.faces.model.DataModel;
 
+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.example.seamdiscs.model.Disc;
-import org.jboss.seam.mock.DBUnitSeamTest;
-import org.testng.annotations.Test;
+import org.jboss.seam.mock.DBJUnitSeamTest;
+import org.jboss.shrinkwrap.api.Archive;
+import org.jboss.shrinkwrap.api.spec.EnterpriseArchive;
+import org.jboss.shrinkwrap.api.spec.WebArchive;
+import org.junit.runner.RunWith;
+import org.junit.Test;
 
-
-public class DisplayDiscTest extends DBUnitSeamTest
+ at RunWith(Arquillian.class)
+public class DisplayDiscTest extends DBJUnitSeamTest
 {
+    @Deployment(name="DisplayDiscTest")
+    @OverProtocol("Servlet 3.0")
+    public static Archive<?> createDeployment()
+    {
+        EnterpriseArchive er = Deployments.seamdiscsDeployment();
+        WebArchive web = er.getAsType(WebArchive.class, "seamdiscs-web.war");
+        web.addClasses(DisplayDiscTest.class);
+        return er;
+    }
     
     @Override
     protected void prepareDBUnitOperations() {
+        setDatabase("HSQL");
+        setDatasourceJndiName("java:/jboss/seamdiscsDatasource");
+        
         beforeTestOperations.add(
                 new DataSetOperation("org/jboss/seam/example/seamdiscs/test/BaseData.xml")
         );

Modified: branches/community/Seam_2_3/examples-ee6/seamdiscs/seamdiscs-tests/src/test/java/org/jboss/seam/example/seamdiscs/test/EditArtistTest.java
===================================================================
--- branches/community/Seam_2_3/examples-ee6/seamdiscs/seamdiscs-tests/src/test/java/org/jboss/seam/example/seamdiscs/test/EditArtistTest.java	2012-06-06 14:21:12 UTC (rev 14839)
+++ branches/community/Seam_2_3/examples-ee6/seamdiscs/seamdiscs-tests/src/test/java/org/jboss/seam/example/seamdiscs/test/EditArtistTest.java	2012-06-06 14:24:38 UTC (rev 14840)
@@ -19,22 +19,40 @@
 
 import javax.el.PropertyNotFoundException;
 
+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.example.seamdiscs.model.BandMember;
-import org.jboss.seam.mock.DBUnitSeamTest;
-import org.testng.annotations.Test;
+import org.jboss.seam.mock.DBJUnitSeamTest;
+import org.jboss.shrinkwrap.api.Archive;
+import org.jboss.shrinkwrap.api.spec.EnterpriseArchive;
+import org.jboss.shrinkwrap.api.spec.WebArchive;
+import org.junit.runner.RunWith;
+import org.junit.Test;
 
 /**
  * @author Pete Muir
  *
  */
-public class EditArtistTest extends DBUnitSeamTest
+ at RunWith(Arquillian.class)
+public class EditArtistTest extends DBJUnitSeamTest
 {
-    
-    
+    @Deployment(name="EditArtistTest")
+    @OverProtocol("Servlet 3.0")
+    public static Archive<?> createDeployment()
+    {
+        EnterpriseArchive er = Deployments.seamdiscsDeployment();
+        WebArchive web = er.getAsType(WebArchive.class, "seamdiscs-web.war");
+        web.addClasses(EditArtistTest.class);
+        return er;
+    }
 
     @Override
     protected void prepareDBUnitOperations() 
     {
+        setDatabase("HSQL");
+        setDatasourceJndiName("java:/jboss/seamdiscsDatasource");
+        
         beforeTestOperations.add(
                 new DataSetOperation("org/jboss/seam/example/seamdiscs/test/BaseData.xml")
         );

Modified: branches/community/Seam_2_3/examples-ee6/seamdiscs/seamdiscs-tests/src/test/java/org/jboss/seam/example/seamdiscs/test/EditDiscTest.java
===================================================================
--- branches/community/Seam_2_3/examples-ee6/seamdiscs/seamdiscs-tests/src/test/java/org/jboss/seam/example/seamdiscs/test/EditDiscTest.java	2012-06-06 14:21:12 UTC (rev 14839)
+++ branches/community/Seam_2_3/examples-ee6/seamdiscs/seamdiscs-tests/src/test/java/org/jboss/seam/example/seamdiscs/test/EditDiscTest.java	2012-06-06 14:24:38 UTC (rev 14840)
@@ -13,19 +13,40 @@
 
 import javax.faces.model.DataModel;
 
+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.example.seamdiscs.model.Artist;
 import org.jboss.seam.example.seamdiscs.model.Disc;
-import org.jboss.seam.mock.DBUnitSeamTest;
-import org.testng.annotations.Test;
+import org.jboss.seam.mock.DBJUnitSeamTest;
+import org.jboss.shrinkwrap.api.Archive;
+import org.jboss.shrinkwrap.api.spec.EnterpriseArchive;
+import org.jboss.shrinkwrap.api.spec.WebArchive;
+import org.junit.runner.RunWith;
+import org.junit.Test;
 
 /**
  * @author Pete Muir
  *
  */
-public class EditDiscTest extends DBUnitSeamTest{
-    
+ at RunWith(Arquillian.class)
+public class EditDiscTest extends DBJUnitSeamTest{
+
+    @Deployment(name="EditDiscTest")
+    @OverProtocol("Servlet 3.0")
+    public static Archive<?> createDeployment()
+    {
+        EnterpriseArchive er = Deployments.seamdiscsDeployment();
+        WebArchive web = er.getAsType(WebArchive.class, "seamdiscs-web.war");
+        web.addClasses(EditDiscTest.class);
+        return er;
+    }
+
     @Override
     protected void prepareDBUnitOperations() {
+        setDatabase("HSQL");
+        setDatasourceJndiName("java:/jboss/seamdiscsDatasource");
+        
         beforeTestOperations.add(
                 new DataSetOperation("org/jboss/seam/example/seamdiscs/test/BaseData.xml")
         );

Modified: branches/community/Seam_2_3/examples-ee6/seamdiscs/seamdiscs-tests/src/test/java/org/jboss/seam/example/seamdiscs/test/LoginTest.java
===================================================================
--- branches/community/Seam_2_3/examples-ee6/seamdiscs/seamdiscs-tests/src/test/java/org/jboss/seam/example/seamdiscs/test/LoginTest.java	2012-06-06 14:21:12 UTC (rev 14839)
+++ branches/community/Seam_2_3/examples-ee6/seamdiscs/seamdiscs-tests/src/test/java/org/jboss/seam/example/seamdiscs/test/LoginTest.java	2012-06-06 14:24:38 UTC (rev 14840)
@@ -5,17 +5,38 @@
 import static org.jboss.seam.example.seamdiscs.test.TestStrings.WRONG_PASSWORD;
 import static org.jboss.seam.example.seamdiscs.test.TestStrings.WRONG_USERNAME;
 
-import org.jboss.seam.mock.DBUnitSeamTest;
-import org.testng.annotations.Test;
+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.DBJUnitSeamTest;
+import org.jboss.shrinkwrap.api.Archive;
+import org.jboss.shrinkwrap.api.spec.EnterpriseArchive;
+import org.jboss.shrinkwrap.api.spec.WebArchive;
+import org.junit.runner.RunWith;
+import org.junit.Test;
 
 /**
  * @author Pete Muir
  *
  */
-public class LoginTest extends DBUnitSeamTest {
-    
+ at RunWith(Arquillian.class)
+public class LoginTest extends DBJUnitSeamTest {
+
+    @Deployment(name="LoginTest")
+    @OverProtocol("Servlet 3.0")
+    public static Archive<?> createDeployment()
+    {
+        EnterpriseArchive er = Deployments.seamdiscsDeployment();
+        WebArchive web = er.getAsType(WebArchive.class, "seamdiscs-web.war");
+        web.addClasses(LoginTest.class);
+        return er;
+    }
+
     @Override
     protected void prepareDBUnitOperations() {
+        setDatabase("HSQL");
+        setDatasourceJndiName("java:/jboss/seamdiscsDatasource");
+        
         beforeTestOperations.add(
                 new DataSetOperation("org/jboss/seam/example/seamdiscs/test/BaseData.xml")
         );

Deleted: branches/community/Seam_2_3/examples-ee6/seamdiscs/seamdiscs-tests/src/test/resources/seam.properties
===================================================================
Added: branches/community/Seam_2_3/examples-ee6/seamdiscs/seamdiscs-tests/src/test/resources-integration/arquillian.xml
===================================================================
--- branches/community/Seam_2_3/examples-ee6/seamdiscs/seamdiscs-tests/src/test/resources-integration/arquillian.xml	                        (rev 0)
+++ branches/community/Seam_2_3/examples-ee6/seamdiscs/seamdiscs-tests/src/test/resources-integration/arquillian.xml	2012-06-06 14:24:38 UTC (rev 14840)
@@ -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>

Deleted: branches/community/Seam_2_3/examples-ee6/seamdiscs/seamdiscs-tests/src/test/resources-integration/testng.xml
===================================================================
--- branches/community/Seam_2_3/examples-ee6/seamdiscs/seamdiscs-tests/src/test/resources-integration/testng.xml	2012-06-06 14:21:12 UTC (rev 14839)
+++ branches/community/Seam_2_3/examples-ee6/seamdiscs/seamdiscs-tests/src/test/resources-integration/testng.xml	2012-06-06 14:24:38 UTC (rev 14840)
@@ -1,39 +0,0 @@
-<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" >
-<suite name="SeamDiscs" verbose="2" parallel="false">
-    <test name="SeamDiscs Artist Tests">
-      
-        <parameter name="datasourceJndiName" value="java:/seamdiscsDatasource"/>
-        <parameter name="database" value="HSQL" />
-    
-        <classes>
-            <class name="org.jboss.seam.example.seamdiscs.test.DisplayArtistTest" />
-            <class name="org.jboss.seam.example.seamdiscs.test.EditArtistTest" />
-        </classes>
-    
-    </test>
-    
-    <test name="SeamDiscs Disc Tests">
-      
-        <parameter name="datasourceJndiName" value="java:/seamdiscsDatasource"/>
-        <parameter name="database" value="HSQL" />
-        <parameter name="binaryDir" value="" />
-    
-        <classes>
-            <class name="org.jboss.seam.example.seamdiscs.test.DisplayDiscTest" />
-            <class name="org.jboss.seam.example.seamdiscs.test.EditDiscTest" />
-        </classes>
-        
-    </test>
-    
-    <test name="SeamDiscs Login Test">
-    
-        <parameter name="datasourceJndiName" value="java:/seamdiscsDatasource"/>
-        <parameter name="database" value="HSQL" />
-        <parameter name="binaryDir" value="" />
-    
-        <classes>
-            <class name="org.jboss.seam.example.seamdiscs.test.LoginTest" />
-        </classes>
-    
-    </test>
-</suite>

Added: branches/community/Seam_2_3/examples-ee6/seamdiscs/seamdiscs-tests/src/test/resources-integration/web.xml
===================================================================
--- branches/community/Seam_2_3/examples-ee6/seamdiscs/seamdiscs-tests/src/test/resources-integration/web.xml	                        (rev 0)
+++ branches/community/Seam_2_3/examples-ee6/seamdiscs/seamdiscs-tests/src/test/resources-integration/web.xml	2012-06-06 14:24:38 UTC (rev 14840)
@@ -0,0 +1,12 @@
+<?xml version="1.0" ?>
+
+<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.mock.MockSeamListener</listener-class>
+    </listener>
+
+</web-app>

Modified: branches/community/Seam_2_3/examples-ee6/seamdiscs/seamdiscs-web/pom.xml
===================================================================
--- branches/community/Seam_2_3/examples-ee6/seamdiscs/seamdiscs-web/pom.xml	2012-06-06 14:21:12 UTC (rev 14839)
+++ branches/community/Seam_2_3/examples-ee6/seamdiscs/seamdiscs-web/pom.xml	2012-06-06 14:24:38 UTC (rev 14840)
@@ -72,6 +72,7 @@
         <dependency>
          	<groupId>org.apache.myfaces.trinidad</groupId>
          	<artifactId>trinidad-api</artifactId>
+            <scope>provided</scope>
          </dependency>
     </dependencies>
   



More information about the seam-commits mailing list