Author: manaRH
Date: 2012-06-07 07:00:18 -0400 (Thu, 07 Jun 2012)
New Revision: 14874
Added:
branches/enterprise/WFK-2_0/examples-ee6/seamdiscs/seamdiscs-ear/src/main/application/META-INF/jboss-seam-seamdiscs-ds.xml
branches/enterprise/WFK-2_0/examples-ee6/seamdiscs/seamdiscs-tests/src/test/java/org/jboss/seam/example/seamdiscs/test/Deployments.java
branches/enterprise/WFK-2_0/examples-ee6/seamdiscs/seamdiscs-tests/src/test/resources-integration/arquillian.xml
branches/enterprise/WFK-2_0/examples-ee6/seamdiscs/seamdiscs-tests/src/test/resources-integration/web.xml
Removed:
branches/enterprise/WFK-2_0/examples-ee6/seamdiscs/seamdiscs-ear/src/main/application/META-INF/jboss-seam-seambay-ds.xml
Modified:
branches/enterprise/WFK-2_0/examples-ee6/seamdiscs/pom.xml
branches/enterprise/WFK-2_0/examples-ee6/seamdiscs/seamdiscs-ear/pom.xml
branches/enterprise/WFK-2_0/examples-ee6/seamdiscs/seamdiscs-ejb/pom.xml
branches/enterprise/WFK-2_0/examples-ee6/seamdiscs/seamdiscs-ejb/src/main/java/org/jboss/seam/example/seamdiscs/action/BandMemberFinder.java
branches/enterprise/WFK-2_0/examples-ee6/seamdiscs/seamdiscs-tests/pom.xml
branches/enterprise/WFK-2_0/examples-ee6/seamdiscs/seamdiscs-tests/src/test/java/org/jboss/seam/example/seamdiscs/test/DisplayArtistTest.java
branches/enterprise/WFK-2_0/examples-ee6/seamdiscs/seamdiscs-tests/src/test/java/org/jboss/seam/example/seamdiscs/test/DisplayDiscTest.java
branches/enterprise/WFK-2_0/examples-ee6/seamdiscs/seamdiscs-tests/src/test/java/org/jboss/seam/example/seamdiscs/test/EditArtistTest.java
branches/enterprise/WFK-2_0/examples-ee6/seamdiscs/seamdiscs-tests/src/test/java/org/jboss/seam/example/seamdiscs/test/EditDiscTest.java
branches/enterprise/WFK-2_0/examples-ee6/seamdiscs/seamdiscs-tests/src/test/java/org/jboss/seam/example/seamdiscs/test/LoginTest.java
branches/enterprise/WFK-2_0/examples-ee6/seamdiscs/seamdiscs-web/pom.xml
Log:
enabled seamdiscs integration tests
Modified: branches/enterprise/WFK-2_0/examples-ee6/seamdiscs/pom.xml
===================================================================
--- branches/enterprise/WFK-2_0/examples-ee6/seamdiscs/pom.xml 2012-06-07 10:59:45 UTC
(rev 14873)
+++ branches/enterprise/WFK-2_0/examples-ee6/seamdiscs/pom.xml 2012-06-07 11:00:18 UTC
(rev 14874)
@@ -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/enterprise/WFK-2_0/examples-ee6/seamdiscs/seamdiscs-ear/pom.xml
===================================================================
--- branches/enterprise/WFK-2_0/examples-ee6/seamdiscs/seamdiscs-ear/pom.xml 2012-06-07
10:59:45 UTC (rev 14873)
+++ branches/enterprise/WFK-2_0/examples-ee6/seamdiscs/seamdiscs-ear/pom.xml 2012-06-07
11:00:18 UTC (rev 14874)
@@ -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>
Deleted:
branches/enterprise/WFK-2_0/examples-ee6/seamdiscs/seamdiscs-ear/src/main/application/META-INF/jboss-seam-seambay-ds.xml
===================================================================
---
branches/enterprise/WFK-2_0/examples-ee6/seamdiscs/seamdiscs-ear/src/main/application/META-INF/jboss-seam-seambay-ds.xml 2012-06-07
10:59:45 UTC (rev 14873)
+++
branches/enterprise/WFK-2_0/examples-ee6/seamdiscs/seamdiscs-ear/src/main/application/META-INF/jboss-seam-seambay-ds.xml 2012-06-07
11:00:18 UTC (rev 14874)
@@ -1,14 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<datasources
xmlns="http://www.jboss.org/ironjacamar/schema">
- <datasource
- 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>
- <driver>h2</driver>
- <security>
- <user-name>sa</user-name>
- <password>sa</password>
- </security>
- </datasource>
-</datasources>
Copied:
branches/enterprise/WFK-2_0/examples-ee6/seamdiscs/seamdiscs-ear/src/main/application/META-INF/jboss-seam-seamdiscs-ds.xml
(from rev 14873,
branches/enterprise/WFK-2_0/examples-ee6/seamdiscs/seamdiscs-ear/src/main/application/META-INF/jboss-seam-seambay-ds.xml)
===================================================================
---
branches/enterprise/WFK-2_0/examples-ee6/seamdiscs/seamdiscs-ear/src/main/application/META-INF/jboss-seam-seamdiscs-ds.xml
(rev 0)
+++
branches/enterprise/WFK-2_0/examples-ee6/seamdiscs/seamdiscs-ear/src/main/application/META-INF/jboss-seam-seamdiscs-ds.xml 2012-06-07
11:00:18 UTC (rev 14874)
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<datasources
xmlns="http://www.jboss.org/ironjacamar/schema">
+ <datasource
+ jndi-name="java:/jboss/seamdiscsDatasource"
+ enabled="true"
+ use-java-context="true" pool-name="seamdiscs">
+
<connection-url>jdbc:h2:mem:seamdiscsdb;DB_CLOSE_DELAY=-1</connection-url>
+ <driver>h2</driver>
+ <security>
+ <user-name>sa</user-name>
+ <password>sa</password>
+ </security>
+ </datasource>
+</datasources>
Modified: branches/enterprise/WFK-2_0/examples-ee6/seamdiscs/seamdiscs-ejb/pom.xml
===================================================================
--- branches/enterprise/WFK-2_0/examples-ee6/seamdiscs/seamdiscs-ejb/pom.xml 2012-06-07
10:59:45 UTC (rev 14873)
+++ branches/enterprise/WFK-2_0/examples-ee6/seamdiscs/seamdiscs-ejb/pom.xml 2012-06-07
11:00:18 UTC (rev 14874)
@@ -48,7 +48,6 @@
<dependency>
<groupId>org.apache.myfaces.trinidad</groupId>
<artifactId>trinidad-api</artifactId>
- <scope>provided</scope>
</dependency>
</dependencies>
Modified:
branches/enterprise/WFK-2_0/examples-ee6/seamdiscs/seamdiscs-ejb/src/main/java/org/jboss/seam/example/seamdiscs/action/BandMemberFinder.java
===================================================================
---
branches/enterprise/WFK-2_0/examples-ee6/seamdiscs/seamdiscs-ejb/src/main/java/org/jboss/seam/example/seamdiscs/action/BandMemberFinder.java 2012-06-07
10:59:45 UTC (rev 14873)
+++
branches/enterprise/WFK-2_0/examples-ee6/seamdiscs/seamdiscs-ejb/src/main/java/org/jboss/seam/example/seamdiscs/action/BandMemberFinder.java 2012-06-07
11:00:18 UTC (rev 14874)
@@ -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/enterprise/WFK-2_0/examples-ee6/seamdiscs/seamdiscs-tests/pom.xml
===================================================================
--- branches/enterprise/WFK-2_0/examples-ee6/seamdiscs/seamdiscs-tests/pom.xml 2012-06-07
10:59:45 UTC (rev 14873)
+++ branches/enterprise/WFK-2_0/examples-ee6/seamdiscs/seamdiscs-tests/pom.xml 2012-06-07
11:00:18 UTC (rev 14874)
@@ -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.1_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/enterprise/WFK-2_0/examples-ee6/seamdiscs/seamdiscs-tests/src/test/java/org/jboss/seam/example/seamdiscs/test/Deployments.java
===================================================================
---
branches/enterprise/WFK-2_0/examples-ee6/seamdiscs/seamdiscs-tests/src/test/java/org/jboss/seam/example/seamdiscs/test/Deployments.java
(rev 0)
+++
branches/enterprise/WFK-2_0/examples-ee6/seamdiscs/seamdiscs-tests/src/test/java/org/jboss/seam/example/seamdiscs/test/Deployments.java 2012-06-07
11:00:18 UTC (rev 14874)
@@ -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/enterprise/WFK-2_0/examples-ee6/seamdiscs/seamdiscs-tests/src/test/java/org/jboss/seam/example/seamdiscs/test/DisplayArtistTest.java
===================================================================
---
branches/enterprise/WFK-2_0/examples-ee6/seamdiscs/seamdiscs-tests/src/test/java/org/jboss/seam/example/seamdiscs/test/DisplayArtistTest.java 2012-06-07
10:59:45 UTC (rev 14873)
+++
branches/enterprise/WFK-2_0/examples-ee6/seamdiscs/seamdiscs-tests/src/test/java/org/jboss/seam/example/seamdiscs/test/DisplayArtistTest.java 2012-06-07
11:00:18 UTC (rev 14874)
@@ -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;
+(a)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/enterprise/WFK-2_0/examples-ee6/seamdiscs/seamdiscs-tests/src/test/java/org/jboss/seam/example/seamdiscs/test/DisplayDiscTest.java
===================================================================
---
branches/enterprise/WFK-2_0/examples-ee6/seamdiscs/seamdiscs-tests/src/test/java/org/jboss/seam/example/seamdiscs/test/DisplayDiscTest.java 2012-06-07
10:59:45 UTC (rev 14873)
+++
branches/enterprise/WFK-2_0/examples-ee6/seamdiscs/seamdiscs-tests/src/test/java/org/jboss/seam/example/seamdiscs/test/DisplayDiscTest.java 2012-06-07
11:00:18 UTC (rev 14874)
@@ -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
+(a)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/enterprise/WFK-2_0/examples-ee6/seamdiscs/seamdiscs-tests/src/test/java/org/jboss/seam/example/seamdiscs/test/EditArtistTest.java
===================================================================
---
branches/enterprise/WFK-2_0/examples-ee6/seamdiscs/seamdiscs-tests/src/test/java/org/jboss/seam/example/seamdiscs/test/EditArtistTest.java 2012-06-07
10:59:45 UTC (rev 14873)
+++
branches/enterprise/WFK-2_0/examples-ee6/seamdiscs/seamdiscs-tests/src/test/java/org/jboss/seam/example/seamdiscs/test/EditArtistTest.java 2012-06-07
11:00:18 UTC (rev 14874)
@@ -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
+(a)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/enterprise/WFK-2_0/examples-ee6/seamdiscs/seamdiscs-tests/src/test/java/org/jboss/seam/example/seamdiscs/test/EditDiscTest.java
===================================================================
---
branches/enterprise/WFK-2_0/examples-ee6/seamdiscs/seamdiscs-tests/src/test/java/org/jboss/seam/example/seamdiscs/test/EditDiscTest.java 2012-06-07
10:59:45 UTC (rev 14873)
+++
branches/enterprise/WFK-2_0/examples-ee6/seamdiscs/seamdiscs-tests/src/test/java/org/jboss/seam/example/seamdiscs/test/EditDiscTest.java 2012-06-07
11:00:18 UTC (rev 14874)
@@ -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{
-
+(a)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/enterprise/WFK-2_0/examples-ee6/seamdiscs/seamdiscs-tests/src/test/java/org/jboss/seam/example/seamdiscs/test/LoginTest.java
===================================================================
---
branches/enterprise/WFK-2_0/examples-ee6/seamdiscs/seamdiscs-tests/src/test/java/org/jboss/seam/example/seamdiscs/test/LoginTest.java 2012-06-07
10:59:45 UTC (rev 14873)
+++
branches/enterprise/WFK-2_0/examples-ee6/seamdiscs/seamdiscs-tests/src/test/java/org/jboss/seam/example/seamdiscs/test/LoginTest.java 2012-06-07
11:00:18 UTC (rev 14874)
@@ -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 {
-
+(a)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")
);
Added:
branches/enterprise/WFK-2_0/examples-ee6/seamdiscs/seamdiscs-tests/src/test/resources-integration/arquillian.xml
===================================================================
---
branches/enterprise/WFK-2_0/examples-ee6/seamdiscs/seamdiscs-tests/src/test/resources-integration/arquillian.xml
(rev 0)
+++
branches/enterprise/WFK-2_0/examples-ee6/seamdiscs/seamdiscs-tests/src/test/resources-integration/arquillian.xml 2012-06-07
11:00:18 UTC (rev 14874)
@@ -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/enterprise/WFK-2_0/examples-ee6/seamdiscs/seamdiscs-tests/src/test/resources-integration/web.xml
===================================================================
---
branches/enterprise/WFK-2_0/examples-ee6/seamdiscs/seamdiscs-tests/src/test/resources-integration/web.xml
(rev 0)
+++
branches/enterprise/WFK-2_0/examples-ee6/seamdiscs/seamdiscs-tests/src/test/resources-integration/web.xml 2012-06-07
11:00:18 UTC (rev 14874)
@@ -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/enterprise/WFK-2_0/examples-ee6/seamdiscs/seamdiscs-web/pom.xml
===================================================================
--- branches/enterprise/WFK-2_0/examples-ee6/seamdiscs/seamdiscs-web/pom.xml 2012-06-07
10:59:45 UTC (rev 14873)
+++ branches/enterprise/WFK-2_0/examples-ee6/seamdiscs/seamdiscs-web/pom.xml 2012-06-07
11:00:18 UTC (rev 14874)
@@ -72,6 +72,7 @@
<dependency>
<groupId>org.apache.myfaces.trinidad</groupId>
<artifactId>trinidad-api</artifactId>
+ <scope>provided</scope>
</dependency>
</dependencies>