[seam-commits] Seam SVN: r14341 - in branches/community/Seam_2_3/examples-ee6: booking and 7 other directories.

seam-commits at lists.jboss.org seam-commits at lists.jboss.org
Tue Feb 28 12:22:30 EST 2012


Author: maschmid
Date: 2012-02-28 12:22:29 -0500 (Tue, 28 Feb 2012)
New Revision: 14341

Added:
   branches/community/Seam_2_3/examples-ee6/booking/booking-tests/src/test/java/org/jboss/seam/example/booking/test/Deployments.java
   branches/community/Seam_2_3/examples-ee6/booking/booking-tests/src/test/resources-integration/arquillian.xml
   branches/community/Seam_2_3/examples-ee6/booking/booking-tests/src/test/resources-integration/test-ds.xml
   branches/community/Seam_2_3/examples-ee6/mail/mail-tests/src/test/resources-integration/arquillian.xml
Modified:
   branches/community/Seam_2_3/examples-ee6/booking/booking-ds.cli
   branches/community/Seam_2_3/examples-ee6/booking/booking-tests/pom.xml
   branches/community/Seam_2_3/examples-ee6/booking/booking-tests/src/test/java/org/jboss/seam/example/booking/test/BookingTest.java
   branches/community/Seam_2_3/examples-ee6/booking/booking-tests/src/test/java/org/jboss/seam/example/booking/test/ChangePasswordTest.java
   branches/community/Seam_2_3/examples-ee6/booking/booking-tests/src/test/java/org/jboss/seam/example/booking/test/LoginTest.java
   branches/community/Seam_2_3/examples-ee6/booking/pom.xml
   branches/community/Seam_2_3/examples-ee6/mail/mail-tests/pom.xml
   branches/community/Seam_2_3/examples-ee6/mail/mail-tests/src/test/java/org/jboss/seam/example/mail/test/MailTest.java
   branches/community/Seam_2_3/examples-ee6/mail/mail-web/pom.xml
   branches/community/Seam_2_3/examples-ee6/pom.xml
Log:
ee6 examples arquillian integration tests for booking and mail


Modified: branches/community/Seam_2_3/examples-ee6/booking/booking-ds.cli
===================================================================
--- branches/community/Seam_2_3/examples-ee6/booking/booking-ds.cli	2012-02-28 16:56:52 UTC (rev 14340)
+++ branches/community/Seam_2_3/examples-ee6/booking/booking-ds.cli	2012-02-28 17:22:29 UTC (rev 14341)
@@ -1,3 +1,3 @@
 connect
-add-data-source --jndi-name=java:/bookingDatasource --connection-url=jdbc:h2:mem:test;DB_CLOSE_DELAY=-1 --username=sa --password=sa --pool-name=BookingDS_pool --driver-name=h2
-/subsystem=datasources/data-source="java\:\/bookingDatasource":enable
+data-source add --name=bookingDS --jndi-name=java:/bookingDatasource --connection-url=jdbc:h2:mem:test;DB_CLOSE_DELAY=-1 --user-name=sa --password=sa --driver-name=h2
+/subsystem=datasources/data-source="bookingDS":enable

Modified: branches/community/Seam_2_3/examples-ee6/booking/booking-tests/pom.xml
===================================================================
--- branches/community/Seam_2_3/examples-ee6/booking/booking-tests/pom.xml	2012-02-28 16:56:52 UTC (rev 14340)
+++ branches/community/Seam_2_3/examples-ee6/booking/booking-tests/pom.xml	2012-02-28 17:22:29 UTC (rev 14341)
@@ -14,33 +14,6 @@
     
     <dependencies>
         <dependency>
-            <groupId>org.jboss.embedded</groupId>
-            <artifactId>jboss-embedded-all</artifactId>
-            <exclusions>
-                <exclusion>
-                    <groupId>org.jboss.microcontainer</groupId>
-                    <artifactId>jboss-deployers-client-spi</artifactId>
-                </exclusion>
-                <exclusion>
-                    <groupId>org.jboss.microcontainer</groupId>
-                    <artifactId>jboss-deployers-core-spi</artifactId>
-                </exclusion>
-            </exclusions>
-        </dependency>
-        <dependency>
-            <groupId>org.jboss.seam.embedded</groupId>
-            <artifactId>thirdparty-all</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.jboss.seam.embedded</groupId>
-            <artifactId>hibernate-all</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.testng</groupId>
-            <artifactId>testng</artifactId>
-            <classifier>jdk15</classifier>
-        </dependency>
-        <dependency>
             <groupId>org.jboss.seam.examples-ee6.booking</groupId>
             <artifactId>booking-ejb</artifactId>
             <type>ejb</type>
@@ -79,6 +52,42 @@
             <artifactId>functional-tests</artifactId>
             <scope>test</scope>
         </dependency>
+        <dependency>
+            <groupId>org.jboss.spec</groupId>
+            <artifactId>jboss-javaee-6.0</artifactId>
+            <type>pom</type>
+            <scope>provided</scope>
+        </dependency>
+        
+        <dependency>
+            <groupId>junit</groupId>
+            <artifactId>junit</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>
     </dependencies>
     
     <build>
@@ -87,65 +96,68 @@
                 <directory>src/test/resources</directory>
                 <filtering>true</filtering>
             </testResource>
+            <testResource> <!-- this takes datasource booking-ds.xml -->
+                <directory>${basedir}/src/main/resources</directory>
+                <filtering>true</filtering>
+            </testResource>
+            <testResource> <!-- this takes themes aka *.properties -->
+                 <directory>${basedir}/../booking-web/src/main/resources</directory>
+                 <filtering>true</filtering>
+            </testResource>
             <testResource>
-                <directory>src/test/bootstrap</directory>
-                <filtering>false</filtering>
+                <directory>src/test/resources-integration</directory>
             </testResource>
-			<testResource> <!-- this takes datasource booking-ds.xml -->
-				<directory>${basedir}/src/main/resources</directory>
-				<filtering>true</filtering>
-			</testResource>
-			<testResource> <!-- this takes themes aka *.properties -->
-			     <directory>${basedir}/../booking-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}/../booking-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-booking</example.context.path>

Modified: branches/community/Seam_2_3/examples-ee6/booking/booking-tests/src/test/java/org/jboss/seam/example/booking/test/BookingTest.java
===================================================================
--- branches/community/Seam_2_3/examples-ee6/booking/booking-tests/src/test/java/org/jboss/seam/example/booking/test/BookingTest.java	2012-02-28 16:56:52 UTC (rev 14340)
+++ branches/community/Seam_2_3/examples-ee6/booking/booking-tests/src/test/java/org/jboss/seam/example/booking/test/BookingTest.java	2012-02-28 17:22:29 UTC (rev 14341)
@@ -10,17 +10,38 @@
 import javax.faces.model.DataModel;
 import javax.faces.model.ListDataModel;
 
+import org.jboss.shrinkwrap.api.asset.Asset; 
+import org.jboss.shrinkwrap.api.Archive;
+import org.jboss.shrinkwrap.api.spec.EnterpriseArchive;
+import org.jboss.shrinkwrap.api.spec.WebArchive;
+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.core.Manager;
 import org.jboss.seam.example.booking.Booking;
 import org.jboss.seam.example.booking.Hotel;
 import org.jboss.seam.example.booking.HotelBooking;
 import org.jboss.seam.example.booking.User;
-import org.jboss.seam.mock.SeamTest;
-import org.testng.annotations.Test;
+import org.jboss.seam.mock.JUnitSeamTest;
 
-public class BookingTest extends SeamTest
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+ at RunWith(Arquillian.class)
+public class BookingTest extends JUnitSeamTest
 {
+   @Deployment(name="BookingTest")
+   @OverProtocol("Servlet 3.0") 
+   public static Archive<?> createDeployment()
+   {
+      EnterpriseArchive er = Deployments.bookingDeployment();
+      WebArchive web = er.getAsType(WebArchive.class, "booking-web.war");
+      
+      web.addClasses(BookingTest.class);
+      	  
+      return er;
+   }
    
    @Test
    public void testBookHotel() throws Exception

Modified: branches/community/Seam_2_3/examples-ee6/booking/booking-tests/src/test/java/org/jboss/seam/example/booking/test/ChangePasswordTest.java
===================================================================
--- branches/community/Seam_2_3/examples-ee6/booking/booking-tests/src/test/java/org/jboss/seam/example/booking/test/ChangePasswordTest.java	2012-02-28 16:56:52 UTC (rev 14340)
+++ branches/community/Seam_2_3/examples-ee6/booking/booking-tests/src/test/java/org/jboss/seam/example/booking/test/ChangePasswordTest.java	2012-02-28 17:22:29 UTC (rev 14341)
@@ -1,14 +1,35 @@
 //$Id: ChangePasswordTest.java 5810 2007-07-16 06:46:47Z gavin $
 package org.jboss.seam.example.booking.test;
 
+import org.jboss.shrinkwrap.api.Archive;
+import org.jboss.shrinkwrap.api.asset.Asset; 
+import org.jboss.shrinkwrap.api.spec.EnterpriseArchive;
+import org.jboss.shrinkwrap.api.spec.WebArchive;
+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.core.Manager;
 import org.jboss.seam.example.booking.User;
-import org.jboss.seam.mock.SeamTest;
-import org.testng.annotations.Test;
+import org.jboss.seam.mock.JUnitSeamTest;
 
-public class ChangePasswordTest extends SeamTest
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+ at RunWith(Arquillian.class)
+public class ChangePasswordTest extends JUnitSeamTest
 {
+   @Deployment(name="ChangePasswordTest")
+   @OverProtocol("Servlet 3.0") 
+   public static Archive<?> createDeployment()
+   {
+	   EnterpriseArchive er = Deployments.bookingDeployment();
+	      WebArchive web = er.getAsType(WebArchive.class, "booking-web.war");
+	      
+	      web.addClasses(ChangePasswordTest.class);
+	    		  
+	      return er;
+   }
    
    @Test
    public void testChangePassword() throws Exception

Added: branches/community/Seam_2_3/examples-ee6/booking/booking-tests/src/test/java/org/jboss/seam/example/booking/test/Deployments.java
===================================================================
--- branches/community/Seam_2_3/examples-ee6/booking/booking-tests/src/test/java/org/jboss/seam/example/booking/test/Deployments.java	                        (rev 0)
+++ branches/community/Seam_2_3/examples-ee6/booking/booking-tests/src/test/java/org/jboss/seam/example/booking/test/Deployments.java	2012-02-28 17:22:29 UTC (rev 14341)
@@ -0,0 +1,24 @@
+package org.jboss.seam.example.booking.test;
+
+import java.io.File;
+
+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.EnterpriseArchive;
+import org.jboss.shrinkwrap.api.spec.WebArchive;
+import org.jboss.shrinkwrap.api.spec.JavaArchive;
+import org.jboss.shrinkwrap.api.importer.ZipImporter;
+import org.jboss.seam.example.booking.Booking;
+
+import org.jboss.shrinkwrap.resolver.api.DependencyResolvers;
+import org.jboss.shrinkwrap.resolver.api.maven.MavenDependencyResolver;
+
+public class Deployments {
+	public static EnterpriseArchive bookingDeployment() {
+		
+		return ShrinkWrap.create(ZipImporter.class, "seam-booking.ear").importFrom(new File("../booking-ear/target/seam-booking.ear"))
+				.as(EnterpriseArchive.class)
+				.addAsResource("test-ds.xml", "test-ds.xml");
+	}
+}

Modified: branches/community/Seam_2_3/examples-ee6/booking/booking-tests/src/test/java/org/jboss/seam/example/booking/test/LoginTest.java
===================================================================
--- branches/community/Seam_2_3/examples-ee6/booking/booking-tests/src/test/java/org/jboss/seam/example/booking/test/LoginTest.java	2012-02-28 16:56:52 UTC (rev 14340)
+++ branches/community/Seam_2_3/examples-ee6/booking/booking-tests/src/test/java/org/jboss/seam/example/booking/test/LoginTest.java	2012-02-28 17:22:29 UTC (rev 14341)
@@ -1,13 +1,35 @@
 //$Id: LoginTest.java 5810 2007-07-16 06:46:47Z gavin $
 package org.jboss.seam.example.booking.test;
 
+import org.jboss.shrinkwrap.api.asset.Asset; 
+import org.jboss.shrinkwrap.api.Archive;
+import org.jboss.shrinkwrap.api.spec.EnterpriseArchive;
+import org.jboss.shrinkwrap.api.spec.WebArchive;
+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.Manager;
 import org.jboss.seam.web.Session;
-import org.jboss.seam.mock.SeamTest;
-import org.testng.annotations.Test;
+import org.jboss.seam.mock.JUnitSeamTest;
 
-public class LoginTest extends SeamTest
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+ at RunWith(Arquillian.class)
+public class LoginTest extends JUnitSeamTest
 {
+   @Deployment(name="LoginTest")
+   @OverProtocol("Servlet 3.0") 
+   public static Archive<?> createDeployment()
+   {
+	      EnterpriseArchive er = Deployments.bookingDeployment();
+	      WebArchive web = er.getAsType(WebArchive.class, "booking-web.war");
+	      
+	      //  
+	      web.addClasses(LoginTest.class);
+	      
+	      return er;
+   }
    
    @Test
    public void testLoginComponent() throws Exception

Added: branches/community/Seam_2_3/examples-ee6/booking/booking-tests/src/test/resources-integration/arquillian.xml
===================================================================
--- branches/community/Seam_2_3/examples-ee6/booking/booking-tests/src/test/resources-integration/arquillian.xml	                        (rev 0)
+++ branches/community/Seam_2_3/examples-ee6/booking/booking-tests/src/test/resources-integration/arquillian.xml	2012-02-28 17:22:29 UTC (rev 14341)
@@ -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>

Added: branches/community/Seam_2_3/examples-ee6/booking/booking-tests/src/test/resources-integration/test-ds.xml
===================================================================
--- branches/community/Seam_2_3/examples-ee6/booking/booking-tests/src/test/resources-integration/test-ds.xml	                        (rev 0)
+++ branches/community/Seam_2_3/examples-ee6/booking/booking-tests/src/test/resources-integration/test-ds.xml	2012-02-28 17:22:29 UTC (rev 14341)
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>  
+<datasources>  
+   <datasource jndi-name="java:/bookingDatasource" enabled="true" use-java-context="true"  
+         pool-name="BookingDS_pool">  
+     <connection-url>jdbc:h2:mem:test;DB_CLOSE_DELAY=-1</connection-url>  
+     <driver>h2</driver>  
+     <security>  
+       <user-name>sa</user-name>  
+       <password>sa</password>  
+     </security>  
+   </datasource>  
+</datasources> 

Modified: branches/community/Seam_2_3/examples-ee6/booking/pom.xml
===================================================================
--- branches/community/Seam_2_3/examples-ee6/booking/pom.xml	2012-02-28 16:56:52 UTC (rev 14340)
+++ branches/community/Seam_2_3/examples-ee6/booking/pom.xml	2012-02-28 17:22:29 UTC (rev 14341)
@@ -41,6 +41,7 @@
                 <groupId>org.jboss.seam.examples-ee6.booking</groupId>
                 <artifactId>booking-ear</artifactId>
                 <version>${project.version}</version>
+                <type>ear</type>
             </dependency>
             <dependency>
             	<groupId>org.hibernate</groupId>

Modified: branches/community/Seam_2_3/examples-ee6/mail/mail-tests/pom.xml
===================================================================
--- branches/community/Seam_2_3/examples-ee6/mail/mail-tests/pom.xml	2012-02-28 16:56:52 UTC (rev 14340)
+++ branches/community/Seam_2_3/examples-ee6/mail/mail-tests/pom.xml	2012-02-28 17:22:29 UTC (rev 14341)
@@ -14,33 +14,6 @@
     
     <dependencies>
         <dependency>
-            <groupId>org.jboss.embedded</groupId>
-            <artifactId>jboss-embedded-all</artifactId>
-            <exclusions>
-                <exclusion>
-                    <groupId>org.jboss.microcontainer</groupId>
-                    <artifactId>jboss-deployers-client-spi</artifactId>
-                </exclusion>
-                <exclusion>
-                    <groupId>org.jboss.microcontainer</groupId>
-                    <artifactId>jboss-deployers-core-spi</artifactId>
-                </exclusion>
-            </exclusions>
-        </dependency>
-        <dependency>
-            <groupId>org.jboss.seam.embedded</groupId>
-            <artifactId>thirdparty-all</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.jboss.seam.embedded</groupId>
-            <artifactId>hibernate-all</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.testng</groupId>
-            <artifactId>testng</artifactId>
-            <classifier>jdk15</classifier>
-        </dependency>
-        <dependency>
             <groupId>org.jboss.seam.examples-ee6.mail</groupId>
             <artifactId>mail-ejb</artifactId>
             <type>ejb</type>
@@ -48,7 +21,7 @@
         </dependency>        
         <dependency>
             <groupId>org.jboss.seam</groupId>
-            <artifactId>jboss-seam</artifactId>
+            <artifactId>jboss-seam-jsf2</artifactId>
             <type>ejb</type>
             <scope>test</scope>
         </dependency>
@@ -69,14 +42,10 @@
         </dependency>     
         <dependency>
             <groupId>org.jboss.seam</groupId>
-            <artifactId>jboss-seam-ui</artifactId>
+            <artifactId>jboss-seam-ui-jsf2</artifactId>
             <scope>test</scope>
         </dependency>
         <dependency>
-            <groupId>javax.faces</groupId>
-            <artifactId>jsf-api</artifactId>
-        </dependency>
-        <dependency>
             <groupId>javax.mail</groupId>
             <artifactId>mail</artifactId>
         </dependency>
@@ -88,17 +57,61 @@
         <dependency>
             <groupId>org.seleniumhq.selenium.client-drivers</groupId>
             <artifactId>selenium-java-client-driver</artifactId>
+        </dependency>                
+        <dependency>
+            <groupId>org.subethamail</groupId>
+            <artifactId>subethasmtp-wiser</artifactId>
+            <version>1.2</version>
         </dependency>
+        
         <dependency>
+            <groupId>org.jboss.spec</groupId>
+            <artifactId>jboss-javaee-6.0</artifactId>
+            <type>pom</type>
+            <scope>provided</scope>
+        </dependency>
+        
+        <dependency>
             <groupId>org.jboss.seam</groupId>
             <artifactId>functional-tests</artifactId>
             <scope>test</scope>
         </dependency>
-         <dependency>
-            <groupId>org.subethamail</groupId>
-            <artifactId>subethasmtp-wiser</artifactId>
-            <version>1.2</version>
+        
+        <dependency>
+            <groupId>org.testng</groupId>
+            <artifactId>testng</artifactId>
+            <classifier>jdk15</classifier>
         </dependency>
+        
+        <dependency>
+            <groupId>junit</groupId>
+            <artifactId>junit</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>
     </dependencies>
     
     <build>
@@ -107,10 +120,6 @@
                 <directory>src/test/resources</directory>
                 <filtering>true</filtering>
             </testResource>
-            <testResource>
-                <directory>src/test/bootstrap</directory>
-                <filtering>false</filtering>
-            </testResource>
 			<testResource> <!-- this takes datasource mail-ds.xml -->
 				<directory>${basedir}/../mail-ear/src/main/resources</directory>
 				<filtering>true</filtering>
@@ -119,53 +128,60 @@
 			     <directory>${basedir}/../mail-web/src/main/resources</directory>
 			     <filtering>true</filtering>
 			</testResource>
+            <testResource>
+                <directory>src/test/resources-integration</directory>
+            </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}/../mail-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-mail</example.context.path>
@@ -174,17 +190,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}/../mail-ear/target/seam-mail.ear</param>
-                            </fileNames>
-                        </configuration>
-                    </plugin>
-                    <plugin>
-                        <groupId>org.codehaus.mojo</groupId>
                         <artifactId>selenium-maven-plugin</artifactId>
                     </plugin>
                     <plugin>

Modified: branches/community/Seam_2_3/examples-ee6/mail/mail-tests/src/test/java/org/jboss/seam/example/mail/test/MailTest.java
===================================================================
--- branches/community/Seam_2_3/examples-ee6/mail/mail-tests/src/test/java/org/jboss/seam/example/mail/test/MailTest.java	2012-02-28 16:56:52 UTC (rev 14340)
+++ branches/community/Seam_2_3/examples-ee6/mail/mail-tests/src/test/java/org/jboss/seam/example/mail/test/MailTest.java	2012-02-28 17:22:29 UTC (rev 14341)
@@ -3,6 +3,7 @@
 import static javax.mail.Message.RecipientType.BCC;
 import static javax.mail.Message.RecipientType.CC;
 
+import java.io.File;
 import java.io.InputStream;
 
 import javax.faces.FacesException;
@@ -13,6 +14,17 @@
 import javax.mail.internet.MimeMessage;
 import javax.mail.internet.MimeMultipart;
 
+import org.jboss.shrinkwrap.api.Archive;
+import org.jboss.shrinkwrap.api.ShrinkWrap;
+import org.jboss.shrinkwrap.api.asset.Asset;
+import org.jboss.shrinkwrap.api.asset.StringAsset;
+import org.jboss.shrinkwrap.api.importer.ZipImporter;
+import org.jboss.shrinkwrap.api.spec.EnterpriseArchive;
+import org.jboss.shrinkwrap.api.spec.WebArchive;
+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.document.ByteArrayDocumentData;
 import org.jboss.seam.document.DocumentData;
@@ -21,16 +33,39 @@
 import org.jboss.seam.mail.ui.UIAttachment;
 import org.jboss.seam.mail.ui.UIMessage;
 import org.jboss.seam.mock.MockTransport;
-import org.jboss.seam.mock.SeamTest;
-import org.testng.Assert;
-import org.testng.annotations.Test;
+import org.jboss.seam.mock.JUnitSeamTest;
 
+
+import org.junit.Ignore;
+import org.junit.Test;
+import org.junit.Assert;
+import org.junit.runner.RunWith;
+
 /**
  * @author Pete Muir
  *
  */
-public class MailTest extends SeamTest
+ at RunWith(Arquillian.class)
+public class MailTest extends JUnitSeamTest
 {
+	@Deployment(name="MailTest")
+	@OverProtocol("Servlet 3.0") 
+	public static Archive<?> createDeployment()
+	{
+      EnterpriseArchive er = ShrinkWrap.create(ZipImporter.class, "seam-mail.ear").importFrom(new File("../mail-ear/target/seam-mail.ear"))
+				.as(EnterpriseArchive.class);
+      WebArchive web = er.getAsType(WebArchive.class, "mail-web.war");      
+      web.addClasses(MailTest.class);
+      //web.addAsWebInfResource(new StringAsset("org.jboss.seam.mock.MockApplicationFactory"), "classes/META-INF/services/javax.faces.application.ApplicationFactory");
+      web.addAsWebInfResource(new StringAsset("org.jboss.seam.mock.MockFacesContextFactory"), "classes/META-INF/services/javax.faces.context.FacesContextFactory");
+      web.addAsWebResource("org/jboss/seam/example/mail/test/errors1.xhtml", "org/jboss/seam/example/mail/test/errors1.xhtml");
+      web.addAsWebResource("org/jboss/seam/example/mail/test/errors2.xhtml", "org/jboss/seam/example/mail/test/errors2.xhtml");
+      web.addAsWebResource("org/jboss/seam/example/mail/test/errors3.xhtml", "org/jboss/seam/example/mail/test/errors3.xhtml");
+      web.addAsWebResource("org/jboss/seam/example/mail/test/errors4.xhtml", "org/jboss/seam/example/mail/test/errors4.xhtml");
+      web.addAsWebResource("org/jboss/seam/example/mail/test/sanitization.xhtml", "org/jboss/seam/example/mail/test/sanitization.xhtml");
+     
+      return er;
+   }
     
     @Test
     public void testSimple() throws Exception
@@ -91,6 +126,7 @@
        
     }    
         
+    @Ignore
     @Test
     public void testAttachment() throws Exception
     {
@@ -122,7 +158,7 @@
                 Assert.assertEquals(renderedMessage.getSubject(), "Try out Seam!");
                 MimeMultipart body = (MimeMultipart) renderedMessage.getContent();                
     
-                Assert.assertEquals(body.getCount(), 4); //3 Attachments and 1 MimeMultipart                
+                Assert.assertEquals(body.getCount(), 6); //3 Attachments and 1 MimeMultipart                
                 
                 // The root multipart/related
                 Assert.assertNotNull(body.getBodyPart(0));
@@ -152,6 +188,7 @@
                 Assert.assertNotNull(bodyPart.getContent());
                 Assert.assertTrue(bodyPart.getContent() instanceof InputStream);
                 Assert.assertEquals(bodyPart.getFileName(), "jboss.jpg");
+                                
                 Assert.assertTrue(bodyPart.isMimeType("image/jpeg"));
                 Assert.assertEquals(bodyPart.getDisposition(), "inline");
                 Assert.assertNotNull(bodyPart.getContentID());

Added: branches/community/Seam_2_3/examples-ee6/mail/mail-tests/src/test/resources-integration/arquillian.xml
===================================================================
--- branches/community/Seam_2_3/examples-ee6/mail/mail-tests/src/test/resources-integration/arquillian.xml	                        (rev 0)
+++ branches/community/Seam_2_3/examples-ee6/mail/mail-tests/src/test/resources-integration/arquillian.xml	2012-02-28 17:22:29 UTC (rev 14341)
@@ -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>

Modified: branches/community/Seam_2_3/examples-ee6/mail/mail-web/pom.xml
===================================================================
--- branches/community/Seam_2_3/examples-ee6/mail/mail-web/pom.xml	2012-02-28 16:56:52 UTC (rev 14340)
+++ branches/community/Seam_2_3/examples-ee6/mail/mail-web/pom.xml	2012-02-28 17:22:29 UTC (rev 14341)
@@ -46,6 +46,10 @@
             		<artifactId>jboss-seam</artifactId>
             		<groupId>org.jboss.seam</groupId>
             	</exclusion>
+                <exclusion>
+                    <groupId>javax.faces</groupId>
+                    <artifactId>jsf-api</artifactId>
+                </exclusion>
             </exclusions>
         </dependency>
         <dependency>
@@ -78,6 +82,10 @@
             		<artifactId>jboss-seam</artifactId>
             		<groupId>org.jboss.seam</groupId>
             	</exclusion>
+                <exclusion>
+                    <groupId>javax.faces</groupId>
+                    <artifactId>jsf-api</artifactId>
+                </exclusion>
             </exclusions>
         </dependency>
         <dependency>
@@ -96,6 +104,10 @@
             		<artifactId>jboss-seam</artifactId>
             		<groupId>org.jboss.seam</groupId>
             	</exclusion>
+                <exclusion>
+                    <groupId>javax.faces</groupId>
+                    <artifactId>jsf-api</artifactId>
+                </exclusion>
             </exclusions>
         </dependency>
 <!--         <dependency> -->
@@ -138,7 +150,7 @@
                 </dependency>
                 <dependency>
                     <groupId>org.jboss.seam</groupId>
-                    <artifactId>jboss-seam</artifactId>
+                    <artifactId>jboss-seam-jsf2</artifactId>
                     <type>ejb</type>
                     <scope>compile</scope>
                     <exclusions>

Modified: branches/community/Seam_2_3/examples-ee6/pom.xml
===================================================================
--- branches/community/Seam_2_3/examples-ee6/pom.xml	2012-02-28 16:56:52 UTC (rev 14340)
+++ branches/community/Seam_2_3/examples-ee6/pom.xml	2012-02-28 17:22:29 UTC (rev 14341)
@@ -22,7 +22,6 @@
     </modules>
 
     <build>
-        <finalName>examples-ee6</finalName>
         <pluginManagement>
             <plugins>
                 <plugin>
@@ -96,19 +95,6 @@
                 </exclusions>
             </dependency>
             <dependency>
-                <groupId>org.jboss.seam</groupId>
-                <artifactId>jboss-seam-jsf2</artifactId>
-                <version>${project.version}</version>
-                <type>ejb</type>
-                <scope>provided</scope>
-                <exclusions>
-                    <exclusion>
-                        <groupId>jboss</groupId>
-                        <artifactId>javassist</artifactId>
-                    </exclusion>
-                </exclusions>
-            </dependency>
-            <dependency>
                 <groupId>com.sun.faces</groupId>
                 <artifactId>jsf-api</artifactId>
                 <version>${version.jsf2}</version>
@@ -134,51 +120,19 @@
             </dependency>
 
             <dependency>
-	            <groupId>org.hibernate</groupId>
-	            <artifactId>hibernate-core</artifactId>
-	            <version>4.0.1.Final</version>
+                <groupId>org.hibernate</groupId>
+                <artifactId>hibernate-core</artifactId>
+                <version>4.0.1.Final</version>
             </dependency>
             
-	        <dependency>
-	            <groupId>org.hibernate</groupId>
-	            <artifactId>hibernate-validator</artifactId>
-	            <version>4.2.0.Final</version>
-	        </dependency>          
-	          
+            <dependency>
+                <groupId>org.hibernate</groupId>
+                <artifactId>hibernate-validator</artifactId>
+                <version>4.2.0.Final</version>
+            </dependency>          
+              
             <!-- common test scope dependencies -->
             <dependency>
-                <groupId>org.testng</groupId>
-                <artifactId>testng</artifactId>
-                <version>5.10</version>
-                <type>jar</type>
-                <scope>test</scope>
-                <classifier>jdk15</classifier>
-                <exclusions>
-                    <exclusion>
-                        <groupId>org.junit</groupId>
-                        <artifactId>junit</artifactId>
-                    </exclusion>
-                </exclusions>
-            </dependency>
-             <dependency>
-                <groupId>org.jboss.embedded</groupId>
-                <artifactId>jboss-embedded-all</artifactId>
-                <version>${version.jbossembedded}</version>
-                <scope>test</scope>
-             </dependency>
-             <dependency>
-                <groupId>org.jboss.seam.embedded</groupId>
-                <artifactId>thirdparty-all</artifactId>
-                <version>${version.jbossembedded}</version>
-                <scope>test</scope>
-             </dependency>
-             <dependency>
-                <groupId>org.jboss.seam.embedded</groupId>
-                <artifactId>hibernate-all</artifactId>
-                <version>${version.jbossembedded}</version>
-                <scope>test</scope>
-             </dependency>
-            <dependency>
                 <groupId>org.slf4j</groupId>
                 <artifactId>slf4j-log4j12</artifactId>
                 <version>${slf4j.version}</version>
@@ -194,32 +148,141 @@
     </dependencyManagement>
 
     <profiles>
-   	   <profile>
-           <id>distribution</id>
-           <build>
-           	<plugins>
-	           	<plugin>
-                    <artifactId>maven-assembly-plugin</artifactId>
-                    <executions>
-                        <execution>
-                            <id>distribution</id>
-                            <phase>package</phase>
-                            <goals>
-                                <goal>single</goal>
-                            </goals>
+        <profile>
+            <id>distribution</id>
+            <build>
+                <plugins>
+                    <plugin>
+                        <artifactId>maven-assembly-plugin</artifactId>
+                        <executions>
+                            <execution>
+                                <id>distribution</id>
+                                <phase>package</phase>
+                                <goals>
+                                    <goal>single</goal>
+                                </goals>
+                                <configuration>
+                                    <descriptorRefs>
+                                        <descriptorRef>project</descriptorRef>
+                                    </descriptorRefs>
+                                </configuration>
+                            </execution>
+                        </executions>
+                    </plugin>               
+                </plugins>               
+            </build>
+        </profile>
+
+        <profile>
+            <id>integration-tests</id>
+            <activation>
+                <property>
+                    <name>arquillian</name>
+                </property>
+            </activation>
+            <build>
+                <pluginManagement>
+                    <plugins>
+                        <plugin>
+                            <groupId>org.apache.maven.plugins</groupId>
+                            <artifactId>maven-surefire-plugin</artifactId>
                             <configuration>
-                      			<descriptorRefs>
-                      				<descriptorRef>project</descriptorRef>
-                      			</descriptorRefs>
+                                <skip>true</skip>
                             </configuration>
-                        </execution>
-                    </executions>
-                </plugin>           	
-           	</plugins>           	
-           </build>
+                            <executions>
+                                <execution>
+                                    <id>integration-test</id>
+                                    <phase>integration-test</phase>
+                                    <goals>
+                                        <goal>test</goal>
+                                    </goals>
+                                    <configuration>
+                                        <skip>false</skip>
+                                        <!-- Needed as we have both junit and testng -->
+                                        <testNGArtifactName>none:none</testNGArtifactName>
+                                        <!-- exclude selenium tests -->
+                                        <excludes>
+                                            <exclude>**/selenium/*</exclude>
+                                        </excludes>
+                                        <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>
+                </pluginManagement>
+            </build>
+        </profile>
+
+        <profile>
+            <id>arq-jbossas-7-managed</id>
+            <activation>
+                <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>
+                    <scope>test</scope>
+                </dependency>
+            </dependencies>
+            <build>
+                <pluginManagement>
+                <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>
+                </pluginManagement>
+            </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>
+                    <scope>test</scope>
+                </dependency>
+            </dependencies>
+        </profile>
+
+        <profile>
             <id>ftest-jbossas</id>
             <properties>
                 <testng.suite>testng.xml</testng.suite>
@@ -276,6 +339,7 @@
                             <artifactId>failsafe-maven-plugin</artifactId>
                             <version>2.4.3-alpha-1</version>
                             <configuration>
+                                <junitArtifactName>none:node</junitArtifactName> 
                                 <suiteXmlFiles>
                                     <suiteXmlFile>${ftest.resources.dir}/${testng.suite}</suiteXmlFile>
                                 </suiteXmlFiles>



More information about the seam-commits mailing list