[seam-commits] Seam SVN: r14591 - in branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-tests: src/test/java/org/jboss/seam/example/nestedbooking/test and 1 other directories.
seam-commits at lists.jboss.org
seam-commits at lists.jboss.org
Mon Apr 16 11:46:08 EDT 2012
Author: maschmid
Date: 2012-04-16 11:46:07 -0400 (Mon, 16 Apr 2012)
New Revision: 14591
Added:
branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-tests/src/test/java/org/jboss/seam/example/nestedbooking/test/Deployments.java
branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-tests/src/test/resources-integration/arquillian.xml
branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-tests/src/test/resources-integration/web.xml
Modified:
branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-tests/pom.xml
branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-tests/src/test/java/org/jboss/seam/example/nestedbooking/test/BookingTest.java
branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-tests/src/test/java/org/jboss/seam/example/nestedbooking/test/ChangePasswordTest.java
branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-tests/src/test/java/org/jboss/seam/example/nestedbooking/test/LoginTest.java
Log:
update nestedbooking seamtest
Modified: branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-tests/pom.xml
===================================================================
--- branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-tests/pom.xml 2012-04-16 15:29:26 UTC (rev 14590)
+++ branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-tests/pom.xml 2012-04-16 15:46:07 UTC (rev 14591)
@@ -53,7 +53,20 @@
<artifactId>functional-tests</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.hibernate.javax.persistence</groupId>
<artifactId>hibernate-jpa-2.0-api</artifactId>
</dependency>
@@ -69,14 +82,9 @@
<directory>src/test/resources</directory>
<filtering>true</filtering>
</testResource>
- <testResource> <!-- this takes datasource nestedbooking-ds.xml -->
- <directory>${basedir}/../nestedbooking-ear/src/main/resources</directory>
- <filtering>true</filtering>
- </testResource>
- <testResource> <!-- this takes themes aka *.properties -->
- <directory>${basedir}/../nestedbooking-web/src/main/resources</directory>
- <filtering>true</filtering>
- </testResource>
+ <testResource>
+ <directory>src/test/resources-integration</directory>
+ </testResource>
</testResources>
<plugins>
<plugin>
@@ -91,6 +99,43 @@
<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-nestedbooking</example.context.path>
Modified: branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-tests/src/test/java/org/jboss/seam/example/nestedbooking/test/BookingTest.java
===================================================================
--- branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-tests/src/test/java/org/jboss/seam/example/nestedbooking/test/BookingTest.java 2012-04-16 15:29:26 UTC (rev 14590)
+++ branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-tests/src/test/java/org/jboss/seam/example/nestedbooking/test/BookingTest.java 2012-04-16 15:46:07 UTC (rev 14591)
@@ -10,20 +10,35 @@
import javax.faces.model.DataModel;
import javax.faces.model.ListDataModel;
+import org.jboss.arquillian.container.test.api.Deployment;
+import org.jboss.arquillian.container.test.api.OverProtocol;
+import org.jboss.arquillian.junit.Arquillian;
import org.jboss.seam.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.junit.Ignore;
+import org.jboss.seam.mock.JUnitSeamTest;
+import org.jboss.shrinkwrap.api.Archive;
+import org.jboss.shrinkwrap.api.spec.EnterpriseArchive;
+import org.jboss.shrinkwrap.api.spec.WebArchive;
+import org.junit.Test;
+import org.junit.runner.RunWith;
- at Ignore
-public class BookingTest extends SeamTest
+ at RunWith(Arquillian.class)
+public class BookingTest extends JUnitSeamTest
{
-
+ @Deployment(name="BookingTest")
+ @OverProtocol("Servlet 3.0")
+ public static Archive<?> createDeployment()
+ {
+ EnterpriseArchive er = Deployments.nestedBookingDeployment();
+ WebArchive web = er.getAsType(WebArchive.class, "nestedbooking-web.war");
+ web.addClasses(BookingTest.class);
+ return er;
+ }
+
@Test
public void testBookHotel() throws Exception
{
@@ -35,7 +50,7 @@
{
Contexts.getSessionContext().set("user", new User("Gavin King", "foobar", "gavin"));
setValue("#{identity.username}", "gavin");
- setValue("#{identity.password}", "foobar");
+ setValue("#{identity.password}", "foobar");
invokeMethod("#{identity.login}");
}
Modified: branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-tests/src/test/java/org/jboss/seam/example/nestedbooking/test/ChangePasswordTest.java
===================================================================
--- branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-tests/src/test/java/org/jboss/seam/example/nestedbooking/test/ChangePasswordTest.java 2012-04-16 15:29:26 UTC (rev 14590)
+++ branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-tests/src/test/java/org/jboss/seam/example/nestedbooking/test/ChangePasswordTest.java 2012-04-16 15:46:07 UTC (rev 14591)
@@ -1,16 +1,31 @@
//$Id: ChangePasswordTest.java 6826 2007-11-25 13:12:07Z pmuir $
package org.jboss.seam.example.nestedbooking.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.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.junit.Ignore;
+import org.jboss.seam.mock.JUnitSeamTest;
+import org.jboss.shrinkwrap.api.Archive;
+import org.jboss.shrinkwrap.api.spec.EnterpriseArchive;
+import org.jboss.shrinkwrap.api.spec.WebArchive;
+import org.junit.Test;
+import org.junit.runner.RunWith;
- at Ignore
-public class ChangePasswordTest extends SeamTest
+ at RunWith(Arquillian.class)
+public class ChangePasswordTest extends JUnitSeamTest
{
+ @Deployment(name="ChangePasswordTest")
+ @OverProtocol("Servlet 3.0")
+ public static Archive<?> createDeployment()
+ {
+ EnterpriseArchive er = Deployments.nestedBookingDeployment();
+ WebArchive web = er.getAsType(WebArchive.class, "nestedbooking-web.war");
+ web.addClasses(ChangePasswordTest.class);
+ return er;
+ }
@Test
public void testChangePassword() throws Exception
Added: branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-tests/src/test/java/org/jboss/seam/example/nestedbooking/test/Deployments.java
===================================================================
--- branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-tests/src/test/java/org/jboss/seam/example/nestedbooking/test/Deployments.java (rev 0)
+++ branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-tests/src/test/java/org/jboss/seam/example/nestedbooking/test/Deployments.java 2012-04-16 15:46:07 UTC (rev 14591)
@@ -0,0 +1,22 @@
+package org.jboss.seam.example.nestedbooking.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.WebArchive;
+
+import java.io.File;
+
+public class Deployments {
+ public static EnterpriseArchive nestedBookingDeployment() {
+ EnterpriseArchive ear = ShrinkWrap.create(ZipImporter.class, "seam-nestedbooking.ear").importFrom(new File("../nestedbooking-ear/target/seam-nestedbooking.ear"))
+ .as(EnterpriseArchive.class);
+
+ // Install org.jboss.seam.mock.MockSeamListener
+ WebArchive web = ear.getAsType(WebArchive.class, "nestedbooking-web.war");
+ web.delete("/WEB-INF/web.xml");
+ web.addAsWebInfResource("web.xml");
+
+ return ear;
+ }
+}
Modified: branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-tests/src/test/java/org/jboss/seam/example/nestedbooking/test/LoginTest.java
===================================================================
--- branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-tests/src/test/java/org/jboss/seam/example/nestedbooking/test/LoginTest.java 2012-04-16 15:29:26 UTC (rev 14590)
+++ branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-tests/src/test/java/org/jboss/seam/example/nestedbooking/test/LoginTest.java 2012-04-16 15:46:07 UTC (rev 14591)
@@ -1,15 +1,30 @@
//$Id: LoginTest.java 6826 2007-11-25 13:12:07Z pmuir $
package org.jboss.seam.example.nestedbooking.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.Seam;
import org.jboss.seam.core.Manager;
-import org.jboss.seam.mock.SeamTest;
-import org.testng.annotations.Test;
-import org.junit.Ignore;
+import org.jboss.seam.mock.JUnitSeamTest;
+import org.jboss.shrinkwrap.api.Archive;
+import org.jboss.shrinkwrap.api.spec.EnterpriseArchive;
+import org.jboss.shrinkwrap.api.spec.WebArchive;
+import org.junit.Test;
+import org.junit.runner.RunWith;
- at Ignore
-public class LoginTest extends SeamTest
+ at RunWith(Arquillian.class)
+public class LoginTest extends JUnitSeamTest
{
+ @Deployment(name="LoginTest")
+ @OverProtocol("Servlet 3.0")
+ public static Archive<?> createDeployment()
+ {
+ EnterpriseArchive er = Deployments.nestedBookingDeployment();
+ WebArchive web = er.getAsType(WebArchive.class, "nestedbooking-web.war");
+ web.addClasses(LoginTest.class);
+ return er;
+ }
@Test
public void testLogin() throws Exception
Added: branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-tests/src/test/resources-integration/arquillian.xml
===================================================================
--- branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-tests/src/test/resources-integration/arquillian.xml (rev 0)
+++ branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-tests/src/test/resources-integration/arquillian.xml 2012-04-16 15:46:07 UTC (rev 14591)
@@ -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/nestedbooking/nestedbooking-tests/src/test/resources-integration/web.xml
===================================================================
--- branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-tests/src/test/resources-integration/web.xml (rev 0)
+++ branches/community/Seam_2_3/examples-ee6/nestedbooking/nestedbooking-tests/src/test/resources-integration/web.xml 2012-04-16 15:46:07 UTC (rev 14591)
@@ -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>
More information about the seam-commits
mailing list