Author: tremes
Date: 2013-06-03 11:13:18 -0400 (Mon, 03 Jun 2013)
New Revision: 15523
Added:
branches/enterprise/WFK-2_1/examples/contactlist/contactlist-ejb/src/test/
branches/enterprise/WFK-2_1/examples/contactlist/contactlist-ejb/src/test/java/
branches/enterprise/WFK-2_1/examples/contactlist/contactlist-ejb/src/test/java/org/
branches/enterprise/WFK-2_1/examples/contactlist/contactlist-ejb/src/test/java/org/jboss/
branches/enterprise/WFK-2_1/examples/contactlist/contactlist-ejb/src/test/java/org/jboss/seam/
branches/enterprise/WFK-2_1/examples/contactlist/contactlist-ejb/src/test/java/org/jboss/seam/example/
branches/enterprise/WFK-2_1/examples/contactlist/contactlist-ejb/src/test/java/org/jboss/seam/example/contactlist/
branches/enterprise/WFK-2_1/examples/contactlist/contactlist-ejb/src/test/java/org/jboss/seam/example/contactlist/test/
branches/enterprise/WFK-2_1/examples/contactlist/contactlist-ejb/src/test/java/org/jboss/seam/example/contactlist/test/ContactListTest.java
branches/enterprise/WFK-2_1/examples/contactlist/contactlist-ejb/src/test/java/org/jboss/seam/example/contactlist/test/Deployments.java
branches/enterprise/WFK-2_1/examples/contactlist/contactlist-ejb/src/test/resources/
branches/enterprise/WFK-2_1/examples/contactlist/contactlist-ejb/src/test/resources/arquillian.xml
branches/enterprise/WFK-2_1/examples/contactlist/contactlist-ejb/src/test/resources/components.xml
branches/enterprise/WFK-2_1/examples/contactlist/contactlist-ejb/src/test/resources/jboss-deployment-structure.xml
branches/enterprise/WFK-2_1/examples/contactlist/contactlist-ejb/src/test/resources/persistence.xml
branches/enterprise/WFK-2_1/examples/contactlist/contactlist-ejb/src/test/resources/web.xml
branches/enterprise/WFK-2_1/examples/excel/excel-ejb/src/test/
branches/enterprise/WFK-2_1/examples/excel/excel-ejb/src/test/java/
branches/enterprise/WFK-2_1/examples/excel/excel-ejb/src/test/java/org/
branches/enterprise/WFK-2_1/examples/excel/excel-ejb/src/test/java/org/jboss/
branches/enterprise/WFK-2_1/examples/excel/excel-ejb/src/test/java/org/jboss/seam/
branches/enterprise/WFK-2_1/examples/excel/excel-ejb/src/test/java/org/jboss/seam/example/
branches/enterprise/WFK-2_1/examples/excel/excel-ejb/src/test/java/org/jboss/seam/example/excel/
branches/enterprise/WFK-2_1/examples/excel/excel-ejb/src/test/java/org/jboss/seam/example/excel/test/
branches/enterprise/WFK-2_1/examples/excel/excel-ejb/src/test/java/org/jboss/seam/example/excel/test/Deployments.java
branches/enterprise/WFK-2_1/examples/excel/excel-ejb/src/test/java/org/jboss/seam/example/excel/test/RenderTest.java
branches/enterprise/WFK-2_1/examples/excel/excel-ejb/src/test/resources/
branches/enterprise/WFK-2_1/examples/excel/excel-ejb/src/test/resources/arquillian.xml
branches/enterprise/WFK-2_1/examples/excel/excel-ejb/src/test/resources/components.xml
branches/enterprise/WFK-2_1/examples/excel/excel-ejb/src/test/resources/ejb-jar.xml
branches/enterprise/WFK-2_1/examples/excel/excel-ejb/src/test/resources/jboss-deployment-structure.xml
branches/enterprise/WFK-2_1/examples/excel/excel-ejb/src/test/resources/persistence.xml
branches/enterprise/WFK-2_1/examples/excel/excel-ejb/src/test/resources/seam.properties
branches/enterprise/WFK-2_1/examples/excel/excel-ejb/src/test/resources/simple.xhtml
branches/enterprise/WFK-2_1/examples/excel/excel-ejb/src/test/resources/web.xml
Removed:
branches/enterprise/WFK-2_1/examples/contactlist/contactlist-tests/pom.xml
branches/enterprise/WFK-2_1/examples/contactlist/contactlist-tests/src/test/java/org/jboss/seam/example/contactlist/test/ContactListTest.java
branches/enterprise/WFK-2_1/examples/contactlist/contactlist-tests/src/test/java/org/jboss/seam/example/contactlist/test/Deployments.java
branches/enterprise/WFK-2_1/examples/contactlist/contactlist-tests/src/test/java/org/jboss/seam/example/contactlist/test/selenium/CommentTest.java
branches/enterprise/WFK-2_1/examples/contactlist/contactlist-tests/src/test/java/org/jboss/seam/example/contactlist/test/selenium/ContactCRUDTest.java
branches/enterprise/WFK-2_1/examples/contactlist/contactlist-tests/src/test/java/org/jboss/seam/example/contactlist/test/selenium/ContactlistConstants.java
branches/enterprise/WFK-2_1/examples/contactlist/contactlist-tests/src/test/java/org/jboss/seam/example/contactlist/test/selenium/Person.java
branches/enterprise/WFK-2_1/examples/contactlist/contactlist-tests/src/test/java/org/jboss/seam/example/contactlist/test/selenium/SeleniumContactlistTest.java
branches/enterprise/WFK-2_1/examples/contactlist/contactlist-tests/src/test/resources-ftest/testng.xml
branches/enterprise/WFK-2_1/examples/contactlist/contactlist-tests/src/test/resources-integration/arquillian.xml
branches/enterprise/WFK-2_1/examples/excel/excel-tests/pom.xml
branches/enterprise/WFK-2_1/examples/excel/excel-tests/src/test/java/org/jboss/seam/example/excel/test/RenderTest.java
branches/enterprise/WFK-2_1/examples/excel/excel-tests/src/test/java/org/jboss/seam/example/excel/test/selenium/SeleniumExcelTest.java
branches/enterprise/WFK-2_1/examples/excel/excel-tests/src/test/resources-ftest/testng.xml
branches/enterprise/WFK-2_1/examples/excel/excel-tests/src/test/resources-integration/arquillian.xml
Modified:
branches/enterprise/WFK-2_1/examples/contactlist/contactlist-ear/pom.xml
branches/enterprise/WFK-2_1/examples/contactlist/contactlist-ejb/pom.xml
branches/enterprise/WFK-2_1/examples/contactlist/contactlist-web/pom.xml
branches/enterprise/WFK-2_1/examples/contactlist/pom.xml
branches/enterprise/WFK-2_1/examples/excel/excel-ear/pom.xml
branches/enterprise/WFK-2_1/examples/excel/excel-ejb/pom.xml
branches/enterprise/WFK-2_1/examples/excel/excel-web/pom.xml
branches/enterprise/WFK-2_1/examples/excel/pom.xml
Log:
Contactlist,Excel quickstartification
Modified: branches/enterprise/WFK-2_1/examples/contactlist/contactlist-ear/pom.xml
===================================================================
--- branches/enterprise/WFK-2_1/examples/contactlist/contactlist-ear/pom.xml 2013-06-03
13:46:19 UTC (rev 15522)
+++ branches/enterprise/WFK-2_1/examples/contactlist/contactlist-ear/pom.xml 2013-06-03
15:13:18 UTC (rev 15523)
@@ -57,6 +57,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-ear-plugin</artifactId>
+ <version>${version.ear.plugin}</version>
<configuration>
<version>6</version>
<defaultLibBundleDir>lib</defaultLibBundleDir>
Modified: branches/enterprise/WFK-2_1/examples/contactlist/contactlist-ejb/pom.xml
===================================================================
--- branches/enterprise/WFK-2_1/examples/contactlist/contactlist-ejb/pom.xml 2013-06-03
13:46:19 UTC (rev 15522)
+++ branches/enterprise/WFK-2_1/examples/contactlist/contactlist-ejb/pom.xml 2013-06-03
15:13:18 UTC (rev 15523)
@@ -1,43 +1,154 @@
<?xml version="1.0" encoding="UTF-8"?>
-<project
xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd">
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <artifactId>contactlist</artifactId>
- <groupId>org.jboss.seam.examples</groupId>
- <version>2.3.1.Final-redhat-2</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
-
- <groupId>org.jboss.seam.examples.contactlist</groupId>
- <artifactId>contactlist-ejb</artifactId>
- <packaging>ejb</packaging>
- <name>Contact List EJB Module (EE6)</name>
-
- <dependencies>
- <dependency>
- <groupId>org.jboss.seam</groupId>
- <artifactId>jboss-seam</artifactId>
- <type>ejb</type>
- </dependency>
- <dependency>
- <groupId>org.hibernate.javax.persistence</groupId>
- <artifactId>hibernate-jpa-2.0-api</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.hibernate</groupId>
- <artifactId>hibernate-validator</artifactId>
- </dependency>
- <dependency>
- <groupId>org.jboss.spec.javax.ejb</groupId>
- <artifactId>jboss-ejb-api_3.1_spec</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.jboss.spec.javax.faces</groupId>
- <artifactId>jboss-jsf-api_2.1_spec</artifactId>
- <scope>provided</scope>
- </dependency>
- </dependencies>
-
+<project
xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.jboss.seam.examples</groupId>
+ <artifactId>contactlist</artifactId>
+ <version>2.3.1.Final-redhat-2</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+
+ <groupId>org.jboss.seam.examples.contactlist</groupId>
+ <artifactId>contactlist-ejb</artifactId>
+ <packaging>ejb</packaging>
+ <name>Contact List EJB Module (EE6)</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.jboss.seam</groupId>
+ <artifactId>jboss-seam</artifactId>
+ <type>ejb</type>
+ <scope>provided</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.hibernate.javax.persistence</groupId>
+ <artifactId>hibernate-jpa-2.0-api</artifactId>
+ <scope>provided</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.hibernate</groupId>
+ <artifactId>hibernate-validator</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.spec.javax.ejb</groupId>
+ <artifactId>jboss-ejb-api_3.1_spec</artifactId>
+ <scope>provided</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.spec.javax.faces</groupId>
+ <artifactId>jboss-jsf-api_2.1_spec</artifactId>
+ <scope>provided</scope>
+ </dependency>
+
+ <!-- Test dependencies -->
+ <dependency>
+ <groupId>org.jboss.shrinkwrap.resolver</groupId>
+ <artifactId>shrinkwrap-resolver-depchain</artifactId>
+ <type>pom</type>
+ <scope>test</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>
+ </dependencies>
+
+ <profiles>
+ <profile>
+ <id>integration-tests</id>
+ <activation>
+ <property>
+ <name>arquillian</name>
+ </property>
+ </activation>
+ <properties>
+ <jndiPattern>java:app/seam-contactlist/#{ejbName}</jndiPattern>
+ <distributable>false</distributable>
+ </properties>
+ <build>
+ <testResources>
+ <testResource>
+ <directory>src/test/resources</directory>
+ <filtering>true</filtering>
+ </testResource>
+ </testResources>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <skip>false</skip>
+ </configuration>
+ </plugin>
+ </plugins>
+ </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>
+ </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>
+ </profiles>
+
+ <build>
+ <plugins>
+ <!-- Skip tests by default -->
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <skip>true</skip>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
</project>
Copied:
branches/enterprise/WFK-2_1/examples/contactlist/contactlist-ejb/src/test/java/org/jboss/seam/example/contactlist/test/ContactListTest.java
(from rev 15522,
branches/enterprise/WFK-2_1/examples/contactlist/contactlist-tests/src/test/java/org/jboss/seam/example/contactlist/test/ContactListTest.java)
===================================================================
---
branches/enterprise/WFK-2_1/examples/contactlist/contactlist-ejb/src/test/java/org/jboss/seam/example/contactlist/test/ContactListTest.java
(rev 0)
+++
branches/enterprise/WFK-2_1/examples/contactlist/contactlist-ejb/src/test/java/org/jboss/seam/example/contactlist/test/ContactListTest.java 2013-06-03
15:13:18 UTC (rev 15523)
@@ -0,0 +1,108 @@
+package org.jboss.seam.example.contactlist.test;
+
+import static org.junit.Assert.*;
+
+import java.util.List;
+
+import org.jboss.arquillian.container.test.api.Deployment;
+import org.jboss.arquillian.container.test.api.OverProtocol;
+import org.jboss.arquillian.junit.Arquillian;
+import org.jboss.seam.Component;
+import org.jboss.seam.contexts.Lifecycle;
+import org.jboss.seam.example.contactlist.Contact;
+import org.jboss.seam.framework.EntityHome;
+import org.jboss.seam.framework.EntityQuery;
+import org.jboss.shrinkwrap.api.Archive;
+import org.jboss.shrinkwrap.api.spec.WebArchive;
+
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+(a)RunWith(Arquillian.class)
+public class ContactListTest
+{
+
+ @Deployment(name = "ContactListTest")
+ @OverProtocol("Servlet 3.0")
+ public static Archive<?> createDeployment()
+ {
+ WebArchive web = Deployments.contactListDeployment();
+ web.addClasses(ContactListTest.class);
+
+ return web;
+ }
+
+ @Test
+ public void testList() throws Exception
+ {
+ Lifecycle.beginCall();
+
+ EntityQuery<Contact> contacts = (EntityQuery<Contact>)
Component.getInstance("contacts");
+ List<Contact> contactsList = (List<Contact>)
(contacts.getResultList());
+ assertEquals(5, contactsList.size());
+
+ Lifecycle.endCall();
+ }
+
+ @Test
+ public void testSearch() throws Exception
+ {
+ Lifecycle.beginCall();
+
+ Contact exampleContact = (Contact)
Component.getInstance("exampleContact");
+ exampleContact.setFirstName("Norman");
+
+ EntityQuery<Contact> contacts = (EntityQuery<Contact>)
Component.getInstance("contacts");
+ List<Contact> contactsList = (List<Contact>)
(contacts.getResultList());
+ assertEquals(1, contactsList.size());
+
+ Lifecycle.endCall();
+
+ Lifecycle.beginCall();
+
+ exampleContact = (Contact) Component.getInstance("exampleContact");
+ exampleContact.setLastName("King");
+
+ contacts = (EntityQuery<Contact>)
Component.getInstance("contacts");
+ contactsList = (List<Contact>) (contacts.getResultList());
+ assertEquals(1, contactsList.size());
+
+ Lifecycle.endCall();
+ }
+
+ Long contactId;
+
+ @Test
+ public void testCreateDeleteContact() throws Exception
+ {
+ Lifecycle.beginCall();
+
+ Contact contact = (Contact) Component.getInstance("contact");
+ contact.setFirstName("Emmanuel");
+ contact.setLastName("Bernard");
+ contact.setCity("Paris");
+
+ EntityHome<Contact> contactHome = (EntityHome<Contact>)
Component.getInstance("contactHome");
+ assertEquals("persisted", contactHome.persist());
+ contactId = (Long) contactHome.getId();
+
+ Lifecycle.endCall();
+ Lifecycle.beginCall();
+
+ contactHome = (EntityHome<Contact>)
Component.getInstance("contactHome");
+ contactHome.setId(contactId);
+ contact = (Contact) Component.getInstance("contact");
+ assertEquals("Emmanuel", contact.getFirstName());
+ assertEquals("Bernard", contact.getLastName());
+ assertEquals("Paris", contact.getCity());
+
+ Lifecycle.endCall();
+ Lifecycle.beginCall();
+
+ contactHome = (EntityHome<Contact>)
Component.getInstance("contactHome");
+ contactHome.setId(contactId);
+ assertEquals("removed", contactHome.remove());
+
+ Lifecycle.endCall();
+ }
+}
Added:
branches/enterprise/WFK-2_1/examples/contactlist/contactlist-ejb/src/test/java/org/jboss/seam/example/contactlist/test/Deployments.java
===================================================================
---
branches/enterprise/WFK-2_1/examples/contactlist/contactlist-ejb/src/test/java/org/jboss/seam/example/contactlist/test/Deployments.java
(rev 0)
+++
branches/enterprise/WFK-2_1/examples/contactlist/contactlist-ejb/src/test/java/org/jboss/seam/example/contactlist/test/Deployments.java 2013-06-03
15:13:18 UTC (rev 15523)
@@ -0,0 +1,35 @@
+package org.jboss.seam.example.contactlist.test;
+
+import org.jboss.seam.example.contactlist.Contact;
+import org.jboss.shrinkwrap.api.ShrinkWrap;
+import org.jboss.shrinkwrap.api.spec.WebArchive;
+import org.jboss.shrinkwrap.resolver.api.maven.Maven;
+
+import java.io.File;
+
+public class Deployments {
+ public static WebArchive contactListDeployment() {
+
+ // use profiles defined in 'maven.profiles' property in pom.xml
+ String profilesString = System.getProperty("maven.profiles");
+ String[] profiles = profilesString != null ? profilesString.split(", ?")
: new String[0];
+ File[] libs = Maven.resolver().loadPomFromFile("pom.xml", profiles)
+ .importCompileAndRuntimeDependencies()
+ // force resolve jboss-seam, because it is provided-scoped in the pom, but
we need it bundled in the WAR
+
.resolve("org.jboss.seam:jboss-seam").withTransitivity().asFile();
+
+
+ return ShrinkWrap.create(WebArchive.class, "seam-contactlist.war")
+ .addPackage(Contact.class.getPackage())
+ .addAsWebInfResource("META-INF/ejb-jar.xml",
"ejb-jar.xml")
+ .addAsWebInfResource("import.sql",
"classes/import.sql")
+ .addAsWebInfResource("persistence.xml",
"classes/META-INF/persistence.xml")
+ .addAsWebInfResource("components.xml",
"components.xml")
+ .addAsWebInfResource("jboss-deployment-structure.xml",
"jboss-deployment-structure.xml")
+ .addAsWebInfResource("seam.properties",
"classes/seam.properties")
+ .addAsWebInfResource("web.xml", "web.xml")
+ .addAsLibraries(libs);
+
+
+ }
+}
\ No newline at end of file
Added:
branches/enterprise/WFK-2_1/examples/contactlist/contactlist-ejb/src/test/resources/arquillian.xml
===================================================================
---
branches/enterprise/WFK-2_1/examples/contactlist/contactlist-ejb/src/test/resources/arquillian.xml
(rev 0)
+++
branches/enterprise/WFK-2_1/examples/contactlist/contactlist-ejb/src/test/resources/arquillian.xml 2013-06-03
15:13:18 UTC (rev 15523)
@@ -0,0 +1,24 @@
+<?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>
+ <!-- These properties are only valid for arquillian managed container,
+ but don't cause a problem for the remote container, so they
+ can be left in. -->
+ <!-- To use jacoco, set jacoco.agent system property to something like
+
-javaagent:/path/to/jacocoagent.jar=append=true,destfile=/path/to/output/jacoco.exec
-->
+ <property name="javaVmArguments">-Xmx1024m
-XX:MaxPermSize=1024m ${jacoco.agent}</property>
+ <property
name="serverConfig">standalone.xml</property>
+ <!-- If jbossHome property is not set, the JBOSS_HOME environment variable
is used -->
+ <!--<property
name="jbossHome">/path/to/jboss/as</property>-->
+ </configuration>
+ </container>
+
+</arquillian>
\ No newline at end of file
Added:
branches/enterprise/WFK-2_1/examples/contactlist/contactlist-ejb/src/test/resources/components.xml
===================================================================
---
branches/enterprise/WFK-2_1/examples/contactlist/contactlist-ejb/src/test/resources/components.xml
(rev 0)
+++
branches/enterprise/WFK-2_1/examples/contactlist/contactlist-ejb/src/test/resources/components.xml 2013-06-03
15:13:18 UTC (rev 15523)
@@ -0,0 +1,48 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<components
xmlns="http://jboss.org/schema/seam/components"
+
xmlns:core="http://jboss.org/schema/seam/core"
+
xmlns:fwk="http://jboss.org/schema/seam/framework"
+
xmlns:persistence="http://jboss.org/schema/seam/persistence"
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation=
+ "http://jboss.org/schema/seam/core
http://jboss.org/schema/seam/core-2.3.xsd
+
http://jboss.org/schema/seam/framework
http://jboss.org/schema/seam/framework-2.3.xsd
+
http://jboss.org/schema/seam/persistence
http://jboss.org/schema/seam/persistence-2.3.xsd
+
http://jboss.org/schema/seam/components
http://jboss.org/schema/seam/components-2.3.xsd">
+
+ <persistence:managed-persistence-context name="entityManager"
+
persistence-unit-jndi-name="java:/contactlistEntityManagerFactory"/>
+
+ <core:init jndi-pattern="${jndiPattern}"/>
+
+ <factory name="contact" value="#{contactHome.instance}"/>
+ <fwk:entity-home name="contactHome"
+ entity-class="org.jboss.seam.example.contactlist.Contact"/>
+
+
+ <factory name="comment" value="#{commentHome.instance}"/>
+ <fwk:entity-home name="commentHome"
+ entity-class="org.jboss.seam.example.contactlist.Comment"
+ new-instance="#{newComment}"/>
+
+ <component name="newComment"
+ class="org.jboss.seam.example.contactlist.Comment">
+ <property name="contact">#{contact}</property>
+ <property name="created">#{currentDatetime}</property>
+ </component>
+
+
+ <fwk:entity-query name="contacts"
+ max-results="5">
+ <fwk:ejbql>select c from Contact c</fwk:ejbql>
+ <fwk:order>lastName</fwk:order>
+ <fwk:restrictions>
+ <value>lower(c.firstName) like lower( concat(
#{exampleContact.firstName}, '%' ) )</value>
+ <value>lower(c.lastName) like lower( concat(
#{exampleContact.lastName}, '%' ) )</value>
+ </fwk:restrictions>
+ </fwk:entity-query>
+
+ <component name="exampleContact"
+ class="org.jboss.seam.example.contactlist.Contact"/>
+
+</components>
Added:
branches/enterprise/WFK-2_1/examples/contactlist/contactlist-ejb/src/test/resources/jboss-deployment-structure.xml
===================================================================
---
branches/enterprise/WFK-2_1/examples/contactlist/contactlist-ejb/src/test/resources/jboss-deployment-structure.xml
(rev 0)
+++
branches/enterprise/WFK-2_1/examples/contactlist/contactlist-ejb/src/test/resources/jboss-deployment-structure.xml 2013-06-03
15:13:18 UTC (rev 15523)
@@ -0,0 +1,14 @@
+<jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.0">
+ <deployment>
+ <dependencies>
+ <module name="org.apache.log4j" export="true"/>
+ <module name="org.javassist" export="true"/>
+ <module name="org.hibernate" export="true"/>
+ <module name="org.dom4j" export="true"/>
+ <module name="org.apache.commons.logging"
export="true"/>
+ <module name="org.apache.commons.collections"
export="true"/>
+ <module name="javax.faces.api" export="true"/>
+ <module name="com.sun.jsf-impl" export="true"/>
+ </dependencies>
+ </deployment>
+</jboss-deployment-structure>
Added:
branches/enterprise/WFK-2_1/examples/contactlist/contactlist-ejb/src/test/resources/persistence.xml
===================================================================
---
branches/enterprise/WFK-2_1/examples/contactlist/contactlist-ejb/src/test/resources/persistence.xml
(rev 0)
+++
branches/enterprise/WFK-2_1/examples/contactlist/contactlist-ejb/src/test/resources/persistence.xml 2013-06-03
15:13:18 UTC (rev 15523)
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<persistence
xmlns="http://java.sun.com/xml/ns/persistence"
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence
http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd"
+ version="2.0">
+ <persistence-unit name="userDatabase" transaction-type="JTA">
+ <provider>org.hibernate.ejb.HibernatePersistence</provider>
+ <jta-data-source>java:jboss/datasources/ExampleDS</jta-data-source>
+ <properties>
+ <property name="hibernate.hbm2ddl.auto"
value="create-drop"/>
+ <property name="hibernate.show_sql" value="true"/>
+ <property name="jboss.entity.manager.factory.jndi.name"
value="java:/contactlistEntityManagerFactory"/>
+ </properties>
+ </persistence-unit>
+</persistence>
Added:
branches/enterprise/WFK-2_1/examples/contactlist/contactlist-ejb/src/test/resources/web.xml
===================================================================
---
branches/enterprise/WFK-2_1/examples/contactlist/contactlist-ejb/src/test/resources/web.xml
(rev 0)
+++
branches/enterprise/WFK-2_1/examples/contactlist/contactlist-ejb/src/test/resources/web.xml 2013-06-03
15:13:18 UTC (rev 15523)
@@ -0,0 +1,53 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<web-app version="3.0"
+
xmlns="http://java.sun.com/xml/ns/javaee"
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd">
+
+ <display-name>Seam Contact List Example</display-name>
+
+ <!-- Seam -->
+
+ <listener>
+ <listener-class>org.jboss.seam.servlet.SeamListener</listener-class>
+ </listener>
+
+ <filter>
+ <filter-name>Seam Filter</filter-name>
+ <filter-class>org.jboss.seam.servlet.SeamFilter</filter-class>
+ </filter>
+
+ <filter-mapping>
+ <filter-name>Seam Filter</filter-name>
+ <url-pattern>/*</url-pattern>
+ </filter-mapping>
+
+ <!-- Facelets -->
+
+ <context-param>
+ <param-name>javax.faces.DEFAULT_SUFFIX</param-name>
+ <param-value>.xhtml</param-value>
+ </context-param>
+
+ <context-param>
+ <param-name>facelets.DEVELOPMENT</param-name>
+ <param-value>false</param-value>
+ </context-param>
+
+ <servlet>
+ <servlet-name>Faces Servlet</servlet-name>
+ <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
+ <load-on-startup>1</load-on-startup>
+ </servlet>
+
+ <servlet-mapping>
+ <servlet-name>Faces Servlet</servlet-name>
+ <url-pattern>*.seam</url-pattern>
+ </servlet-mapping>
+
+ <session-config>
+ <session-timeout>10</session-timeout>
+ </session-config>
+
+</web-app>
Deleted: branches/enterprise/WFK-2_1/examples/contactlist/contactlist-tests/pom.xml
===================================================================
--- branches/enterprise/WFK-2_1/examples/contactlist/contactlist-tests/pom.xml 2013-06-03
13:46:19 UTC (rev 15522)
+++ branches/enterprise/WFK-2_1/examples/contactlist/contactlist-tests/pom.xml 2013-06-03
15:13:18 UTC (rev 15523)
@@ -1,182 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project
xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd">
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <artifactId>contactlist</artifactId>
- <groupId>org.jboss.seam.examples</groupId>
- <version>2.3.1.Final-redhat-2</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
-
- <groupId>org.jboss.seam.examples.contactlist</groupId>
- <artifactId>contactlist-tests</artifactId>
- <name>Contact List Integration Tests Module (EE6)</name>
-
- <dependencies>
-
- <dependency>
- <groupId>org.jboss.seam.examples.contactlist</groupId>
- <artifactId>contactlist-ejb</artifactId>
- <type>ejb</type>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-log4j12</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.hibernate.javax.persistence</groupId>
- <artifactId>hibernate-jpa-2.0-api</artifactId>
- </dependency>
- <dependency>
- <groupId>org.hibernate</groupId>
- <artifactId>hibernate-core</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.jboss.spec.javax.faces</groupId>
- <artifactId>jboss-jsf-api_2.1_spec</artifactId>
- </dependency>
- <dependency>
- <groupId>javax.mail</groupId>
- <artifactId>mail</artifactId>
- </dependency>
- <dependency>
- <groupId>org.seleniumhq.selenium</groupId>
- <artifactId>selenium-server</artifactId>
- </dependency>
- <dependency>
- <groupId>org.seleniumhq.selenium</groupId>
- <artifactId>selenium-java</artifactId>
- </dependency>
- <dependency>
- <groupId>org.jboss.seam</groupId>
- <artifactId>functional-tests</artifactId>
- <scope>test</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.spec.javax.el</groupId>
- <artifactId>jboss-el-api_2.2_spec</artifactId>
- </dependency>
-
- <dependency>
- <groupId>dom4j</groupId>
- <artifactId>dom4j</artifactId>
- </dependency>
-
- <dependency>
- <groupId>org.javassist</groupId>
- <artifactId>javassist</artifactId>
- </dependency>
-
- <dependency>
- <groupId>org.hibernate</groupId>
- <artifactId>hibernate-validator</artifactId>
- <scope>provided</scope>
- </dependency>
- </dependencies>
-
- <build>
- <testResources>
- <testResource>
- <directory>src/test/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>
- <skip>true</skip>
- </configuration>
- </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-contactlist</example.context.path>
- </properties>
- <build>
- <plugins>
- <plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>selenium-maven-plugin</artifactId>
- </plugin>
- <plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>failsafe-maven-plugin</artifactId>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-antrun-plugin</artifactId>
- </plugin>
- </plugins>
- </build>
- </profile>
- </profiles>
-</project>
Deleted:
branches/enterprise/WFK-2_1/examples/contactlist/contactlist-tests/src/test/java/org/jboss/seam/example/contactlist/test/ContactListTest.java
===================================================================
---
branches/enterprise/WFK-2_1/examples/contactlist/contactlist-tests/src/test/java/org/jboss/seam/example/contactlist/test/ContactListTest.java 2013-06-03
13:46:19 UTC (rev 15522)
+++
branches/enterprise/WFK-2_1/examples/contactlist/contactlist-tests/src/test/java/org/jboss/seam/example/contactlist/test/ContactListTest.java 2013-06-03
15:13:18 UTC (rev 15523)
@@ -1,111 +0,0 @@
-package org.jboss.seam.example.contactlist.test;
-
-import static org.junit.Assert.*;
-
-import java.util.List;
-
-import org.jboss.arquillian.container.test.api.Deployment;
-import org.jboss.arquillian.container.test.api.OverProtocol;
-import org.jboss.arquillian.junit.Arquillian;
-import org.jboss.seam.Component;
-import org.jboss.seam.contexts.Lifecycle;
-import org.jboss.seam.example.contactlist.Contact;
-import org.jboss.seam.framework.EntityHome;
-import org.jboss.seam.framework.EntityQuery;
-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;
-
-(a)RunWith(Arquillian.class)
-public class ContactListTest
-{
-
- @Deployment(name="ContactListTest")
- @OverProtocol("Servlet 3.0")
- public static Archive<?> createDeployment()
- {
- EnterpriseArchive er = Deployments.contactListDeployment();
- WebArchive web = er.getAsType(WebArchive.class, "contactlist-web.war");
-
- web.addClasses(ContactListTest.class);
-
- return er;
- }
-
- @Test
- public void testList() throws Exception
- {
- Lifecycle.beginCall();
-
- EntityQuery<Contact> contacts =
(EntityQuery<Contact>)Component.getInstance("contacts");
- List<Contact> contactsList = (List<Contact>)
(contacts.getResultList());
- assertEquals(5, contactsList.size());
-
- Lifecycle.endCall();
- }
-
- @Test
- public void testSearch() throws Exception
- {
- Lifecycle.beginCall();
-
- Contact exampleContact =
(Contact)Component.getInstance("exampleContact");
- exampleContact.setFirstName("Norman");
-
- EntityQuery<Contact> contacts =
(EntityQuery<Contact>)Component.getInstance("contacts");
- List<Contact> contactsList = (List<Contact>)
(contacts.getResultList());
- assertEquals(1, contactsList.size());
-
- Lifecycle.endCall();
-
- Lifecycle.beginCall();
-
- exampleContact = (Contact)Component.getInstance("exampleContact");
- exampleContact.setLastName("King");
-
- contacts =
(EntityQuery<Contact>)Component.getInstance("contacts");
- contactsList = (List<Contact>) (contacts.getResultList());
- assertEquals(1, contactsList.size());
-
- Lifecycle.endCall();
- }
-
- Long contactId;
-
- @Test
- public void testCreateDeleteContact() throws Exception
- {
- Lifecycle.beginCall();
-
- Contact contact = (Contact) Component.getInstance("contact");
- contact.setFirstName("Emmanuel");
- contact.setLastName("Bernard");
- contact.setCity("Paris");
-
- EntityHome<Contact> contactHome =
(EntityHome<Contact>)Component.getInstance("contactHome");
- assertEquals("persisted", contactHome.persist());
- contactId = (Long)contactHome.getId();
-
- Lifecycle.endCall();
- Lifecycle.beginCall();
-
- contactHome =
(EntityHome<Contact>)Component.getInstance("contactHome");
- contactHome.setId(contactId);
- contact = (Contact) Component.getInstance("contact");
- assertEquals("Emmanuel", contact.getFirstName());
- assertEquals("Bernard", contact.getLastName());
- assertEquals("Paris", contact.getCity());
-
- Lifecycle.endCall();
- Lifecycle.beginCall();
-
- contactHome =
(EntityHome<Contact>)Component.getInstance("contactHome");
- contactHome.setId(contactId);
- assertEquals("removed", contactHome.remove());
-
- Lifecycle.endCall();
- }
-}
Deleted:
branches/enterprise/WFK-2_1/examples/contactlist/contactlist-tests/src/test/java/org/jboss/seam/example/contactlist/test/Deployments.java
===================================================================
---
branches/enterprise/WFK-2_1/examples/contactlist/contactlist-tests/src/test/java/org/jboss/seam/example/contactlist/test/Deployments.java 2013-06-03
13:46:19 UTC (rev 15522)
+++
branches/enterprise/WFK-2_1/examples/contactlist/contactlist-tests/src/test/java/org/jboss/seam/example/contactlist/test/Deployments.java 2013-06-03
15:13:18 UTC (rev 15523)
@@ -1,14 +0,0 @@
-package org.jboss.seam.example.contactlist.test;
-
-import org.jboss.shrinkwrap.api.ShrinkWrap;
-import org.jboss.shrinkwrap.api.importer.ZipImporter;
-import org.jboss.shrinkwrap.api.spec.EnterpriseArchive;
-
-import java.io.File;
-
-public class Deployments {
- public static EnterpriseArchive contactListDeployment() {
- return ShrinkWrap.create(ZipImporter.class,
"seam-contactlist.ear").importFrom(new
File("../contactlist-ear/target/seam-contactlist.ear"))
- .as(EnterpriseArchive.class);
- }
-}
\ No newline at end of file
Deleted:
branches/enterprise/WFK-2_1/examples/contactlist/contactlist-tests/src/test/java/org/jboss/seam/example/contactlist/test/selenium/CommentTest.java
===================================================================
---
branches/enterprise/WFK-2_1/examples/contactlist/contactlist-tests/src/test/java/org/jboss/seam/example/contactlist/test/selenium/CommentTest.java 2013-06-03
13:46:19 UTC (rev 15522)
+++
branches/enterprise/WFK-2_1/examples/contactlist/contactlist-tests/src/test/java/org/jboss/seam/example/contactlist/test/selenium/CommentTest.java 2013-06-03
15:13:18 UTC (rev 15523)
@@ -1,62 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.jboss.seam.example.contactlist.test.selenium;
-
-import org.testng.annotations.Test;
-import static org.testng.AssertJUnit.*;
-
-import com.thoughtworks.selenium.Wait;
-
-public class CommentTest extends SeleniumContactlistTest {
-
- @Test
- public void testComment() {
- String firstName = "Gavin";
- String lastName = "King";
- String message = "founder of the Hibernate open source object/relational mapping
project";
- // find contact
- browser.open(CONTEXT_PATH + START_PAGE);
- new Wait() {
- @Override
- public boolean until() {
- return browser.isElementPresent(SEARCH_SUBMIT);
- }
- }.wait("Search submit link not found.");
- search(firstName, lastName);
- assertTrue("Contact not found. Application is in unexpected state.",
- searchResultPresent(firstName, lastName));
- browser.click(SEARCH_RESULT_FIRST_ROW_LINK);
- browser.waitForPageToLoad(TIMEOUT);
- // submit comment
- browser.type(COMMENT_TEXTAREA, message);
- browser.click(COMMENT_SUBMIT);
- browser.waitForPageToLoad(TIMEOUT);
- // assert comment is stored
- browser.click(SEARCH_CONTACT_PAGE);
- browser.waitForPageToLoad(TIMEOUT);
- search(firstName, lastName);
- browser.click(SEARCH_RESULT_FIRST_ROW_LINK);
- browser.waitForPageToLoad(TIMEOUT);
- assertTrue("Comment is not stored.", browser
- .isTextPresent(message));
- }
-}
Deleted:
branches/enterprise/WFK-2_1/examples/contactlist/contactlist-tests/src/test/java/org/jboss/seam/example/contactlist/test/selenium/ContactCRUDTest.java
===================================================================
---
branches/enterprise/WFK-2_1/examples/contactlist/contactlist-tests/src/test/java/org/jboss/seam/example/contactlist/test/selenium/ContactCRUDTest.java 2013-06-03
13:46:19 UTC (rev 15522)
+++
branches/enterprise/WFK-2_1/examples/contactlist/contactlist-tests/src/test/java/org/jboss/seam/example/contactlist/test/selenium/ContactCRUDTest.java 2013-06-03
15:13:18 UTC (rev 15523)
@@ -1,154 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.jboss.seam.example.contactlist.test.selenium;
-
-import org.testng.annotations.Test;
-import static org.testng.AssertJUnit.*;
-import com.thoughtworks.selenium.Wait;
-
-public class ContactCRUDTest extends SeleniumContactlistTest {
-
- // used for creation test
- private Person john = new Person("John", "Doe",
"0123456789", "0123456789",
- "Street", "City", "State", "01234",
"US");
- private Person jane = new Person("Jane", "Doe",
"0123456789", "0123456789",
- "Street", "City", "State", "01234",
"US");
- // used for edit test
- private Person jozef = new Person("Jozef", "Hartinger",
"0123456789",
- "0123456789", "Cervinkova 99", "Brno",
"Czech Republic", "01234",
- "CZ");
-
- @Test
- public void testCreateContact() {
- browser.open(CONTEXT_PATH + START_PAGE);
- new Wait() {
- @Override
- public boolean until() {
- return browser.isElementPresent(CREATE_CONTACT_PAGE);
- }
- }.wait("Create contact link not found.");
- browser.click(CREATE_CONTACT_PAGE);
- browser.waitForPageToLoad(TIMEOUT);
- fillCreateContactForm(john);
- browser.click(CREATE_CONTACT_SUBMIT);
- new Wait() {
- @Override
- public boolean until() {
- return browser.isElementPresent(SEARCH_CONTACT_PAGE);
- }
- }.wait("Search link not found.");
- browser.click(SEARCH_CONTACT_PAGE);
- browser.waitForPageToLoad(TIMEOUT);
- search(john);
- assertTrue("Creating new contact failed.", searchResultPresent(john));
- }
-
- @Test
- public void testCreationCanceling() {
- browser.open(CONTEXT_PATH + START_PAGE);
- new Wait() {
- @Override
- public boolean until() {
- return browser.isElementPresent(CREATE_CONTACT_PAGE);
- }
- }.wait("Create contact link not found.");
- browser.click(CREATE_CONTACT_PAGE);
- browser.waitForPageToLoad(TIMEOUT);
- fillCreateContactForm(jane);
- browser.click(CREATE_CONTACT_CANCEL);
- new Wait() {
- @Override
- public boolean until() {
- return browser.isElementPresent(SEARCH_CONTACT_PAGE);
- }
- }.wait("Search link not found.");
- browser.click(SEARCH_CONTACT_PAGE);
- browser.waitForPageToLoad(TIMEOUT);
- browser.type(SEARCH_FIRST_NAME_FIELD, jane.getFirstName());
- browser.type(SEARCH_LAST_NAME_FIELD, jane.getLastName());
- browser.click(SEARCH_SUBMIT);
- browser.waitForPageToLoad(TIMEOUT);
- assertFalse("New contact created despite cancel.",
searchResultPresent(jane));
- }
-
- @Test
- public void testEditContact() {
- String firstName = "Shane";
- String lastName = "Bryzak";
- // find contact
- browser.open(CONTEXT_PATH + START_PAGE);
- new Wait() {
- @Override
- public boolean until() {
- return browser.isElementPresent(SEARCH_SUBMIT);
- }
- }.wait("Search submit link not found.");
- search(firstName, lastName);
- assertTrue("Contact not found. Application is in unexpected state.",
- searchResultPresent(firstName, lastName));
- browser.click(SEARCH_RESULT_FIRST_ROW_LINK);
- browser.waitForPageToLoad(TIMEOUT);
- browser.click(EDIT_CONTACT_LINK);
- browser.waitForPageToLoad(TIMEOUT);
- // update form fields
- fillCreateContactForm(jozef);
- browser.click(UPDATE_CONTACT_SUBMIT);
- browser.waitForPageToLoad(TIMEOUT);
- // make sure new values are present
- browser.click(SEARCH_CONTACT_PAGE);
- browser.waitForPageToLoad(TIMEOUT);
- search(jozef);
- assertTrue("Contact update failed. New values missing",
searchResultPresent(jozef));
- // make sure old values are not present
- browser.click(SEARCH_CONTACT_PAGE);
- browser.waitForPageToLoad(TIMEOUT);
- search(firstName, lastName);
- assertFalse("Contact update failed. Old values still present",
searchResultPresent(firstName, lastName));
- }
-
- @Test
- public void testRemoveContact() {
- String firstName = "Norman";
- String lastName = "Richards";
- // find contact
- browser.open(CONTEXT_PATH + START_PAGE);
- new Wait() {
- @Override
- public boolean until() {
- return browser.isElementPresent(SEARCH_SUBMIT);
- }
- }.wait("Search submit link not found.");
- search(firstName, lastName);
- assertTrue("Contact not found. Application is in unexpected state.",
- searchResultPresent(firstName, lastName));
- browser.click(SEARCH_RESULT_FIRST_ROW_LINK);
- browser.waitForPageToLoad(TIMEOUT);
- // remove contact
- browser.click(REMOVE_CONTACT_LINK);
- browser.waitForPageToLoad(TIMEOUT);
- // assert contact is removed
- browser.click(SEARCH_CONTACT_PAGE);
- browser.waitForPageToLoad(TIMEOUT);
- search(firstName, lastName);
- assertFalse("Contact present despite it should be removed.",
searchResultPresent(firstName, lastName));
- }
-}
Deleted:
branches/enterprise/WFK-2_1/examples/contactlist/contactlist-tests/src/test/java/org/jboss/seam/example/contactlist/test/selenium/ContactlistConstants.java
===================================================================
---
branches/enterprise/WFK-2_1/examples/contactlist/contactlist-tests/src/test/java/org/jboss/seam/example/contactlist/test/selenium/ContactlistConstants.java 2013-06-03
13:46:19 UTC (rev 15522)
+++
branches/enterprise/WFK-2_1/examples/contactlist/contactlist-tests/src/test/java/org/jboss/seam/example/contactlist/test/selenium/ContactlistConstants.java 2013-06-03
15:13:18 UTC (rev 15523)
@@ -1,57 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.jboss.seam.example.contactlist.test.selenium;
-
-public interface ContactlistConstants {
-
- public static String START_PAGE = "/";
- public static String SEARCH_CONTACT_PAGE = "id=search";
- public static String SEARCH_FIRST_NAME_FIELD = "id=searchForm:firstName";
- public static String SEARCH_LAST_NAME_FIELD = "id=searchForm:lastName";
- public static String SEARCH_SUBMIT = "id=searchForm:submit";
- public static String CREATE_CONTACT_PAGE = "id=create";
- public static String CREATE_CONTACT_SUBMIT = "id=editForm:createContact";
- public static String CREATE_CONTACT_CANCEL = "id=editForm:cancel";
- public static String FIRST_NAME_FIELD =
"id=editForm:firstNameDecorate:firstName";
- public static String LAST_NAME_FIELD =
"id=editForm:lastNameDecorate:lastName";
- public static String CELL_PHONE_FIELD =
"id=editForm:cellPhoneDecorate:cellPhone";
- public static String HOME_PHONE_FIELD =
"id=editForm:homePhoneDecorate:homePhone";
- public static String ADDRESS_FIELD =
"id=editForm:addressDecorate:address";
- public static String CITY_FIELD = "id=editForm:cityDecorate:city";
- public static String STATE_FIELD = "id=editForm:stateDecorate:state";
- public static String ZIP_FIELD = "id=editForm:zipDecorate:zip";
- public static String COUNTRY_FIELD =
"id=editForm:countryDecorate:country";
- public static String EDIT_CONTACT_LINK = "editContact";
- public static String UPDATE_CONTACT_SUBMIT = "editForm:updateContact";
- public static String EDIT_FORM_REMOVE_CONTACT_LINK =
"id=editForm:deleteContact";
- public static String REMOVE_CONTACT_LINK = "id=deleteContact";
- public static String SEARCH_RESULT_FIRST_ROW_LINK =
"id=searchResult:0:link";
- public static String SEARCH_RESULT_FIRST_ROW_CELL_PHONE =
"id=searchResult:0:cellPhone";
- public static String SEARCH_RESULT_FIRST_ROW_HOME_PHONE =
"id=searchResult:0:homePhone";
- public static String SEARCH_RESULT_FIRST_ROW_ADDRESS =
"id=searchResult:0:address";
- public static String SEARCH_RESULT_FIRST_ROW_CITY =
"id=searchResult:0:city";
- public static String SEARCH_RESULT_FIRST_ROW_STATE =
"id=searchResult:0:state";
- public static String SEARCH_RESULT_FIRST_ROW_ZIP =
"id=searchResult:0:zip";
- public static String SEARCH_RESULT_FIRST_ROW_COUNTRY =
"id=searchResult:0:country";
- public static String COMMENT_TEXTAREA = "commentForm:text";
- public static String COMMENT_SUBMIT = "commentForm:submit";
-}
Deleted:
branches/enterprise/WFK-2_1/examples/contactlist/contactlist-tests/src/test/java/org/jboss/seam/example/contactlist/test/selenium/Person.java
===================================================================
---
branches/enterprise/WFK-2_1/examples/contactlist/contactlist-tests/src/test/java/org/jboss/seam/example/contactlist/test/selenium/Person.java 2013-06-03
13:46:19 UTC (rev 15522)
+++
branches/enterprise/WFK-2_1/examples/contactlist/contactlist-tests/src/test/java/org/jboss/seam/example/contactlist/test/selenium/Person.java 2013-06-03
15:13:18 UTC (rev 15523)
@@ -1,121 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.jboss.seam.example.contactlist.test.selenium;
-
-public class Person {
- private String firstName;
- private String lastName;
- private String cellPhone;
- private String homePhone;
- private String address;
- private String city;
- private String state;
- private String zip;
- private String country;
-
- public Person(String firstName, String lastName, String cellPhone, String homePhone,
- String address, String city, String state, String zip, String country) {
- this.firstName = firstName;
- this.lastName = lastName;
- this.cellPhone = cellPhone;
- this.homePhone = homePhone;
- this.address = address;
- this.city = city;
- this.state = state;
- this.zip = zip;
- this.country = country;
- }
-
- public String getFirstName() {
- return firstName;
- }
-
- public void setFirstName(String firstName) {
- this.firstName = firstName;
- }
-
- public String getLastName() {
- return lastName;
- }
-
- public void setLastName(String lastName) {
- this.lastName = lastName;
- }
-
-
- public String getCellPhone() {
- return cellPhone;
- }
-
- public void setCellPhone(String cellPhone) {
- this.cellPhone = cellPhone;
- }
-
- public String getHomePhone() {
- return homePhone;
- }
-
- public void setHomePhone(String homePhone) {
- this.homePhone = homePhone;
- }
-
- public String getAddress() {
- return address;
- }
-
- public void setAddress(String address) {
- this.address = address;
- }
-
- public String getCity() {
- return city;
- }
-
- public void setCity(String city) {
- this.city = city;
- }
-
- public String getState() {
- return state;
- }
-
- public void setState(String state) {
- this.state = state;
- }
-
- public String getZip() {
- return zip;
- }
-
- public void setZip(String zip) {
- this.zip = zip;
- }
-
- public String getCountry() {
- return country;
- }
-
- public void setCountry(String country) {
- this.country = country;
- }
-
-}
Deleted:
branches/enterprise/WFK-2_1/examples/contactlist/contactlist-tests/src/test/java/org/jboss/seam/example/contactlist/test/selenium/SeleniumContactlistTest.java
===================================================================
---
branches/enterprise/WFK-2_1/examples/contactlist/contactlist-tests/src/test/java/org/jboss/seam/example/contactlist/test/selenium/SeleniumContactlistTest.java 2013-06-03
13:46:19 UTC (rev 15522)
+++
branches/enterprise/WFK-2_1/examples/contactlist/contactlist-tests/src/test/java/org/jboss/seam/example/contactlist/test/selenium/SeleniumContactlistTest.java 2013-06-03
15:13:18 UTC (rev 15523)
@@ -1,66 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.jboss.seam.example.contactlist.test.selenium;
-
-import org.jboss.seam.example.common.test.selenium.SeamSeleniumTest;
-
-public class SeleniumContactlistTest extends SeamSeleniumTest implements
ContactlistConstants {
-
- public boolean searchResultPresent(String firstName, String lastName) {
- return browser.isElementPresent(SEARCH_RESULT_FIRST_ROW_LINK) &&
- browser.getText(SEARCH_RESULT_FIRST_ROW_LINK).equals(firstName + "
" + lastName);
- }
-
- public boolean searchResultPresent(Person person) {
- return searchResultPresent(person.getFirstName(), person.getLastName())
&&
-
browser.getText(SEARCH_RESULT_FIRST_ROW_CELL_PHONE).equals(person.getCellPhone())
&&
-
browser.getText(SEARCH_RESULT_FIRST_ROW_HOME_PHONE).equals(person.getHomePhone())
&&
- browser.getText(SEARCH_RESULT_FIRST_ROW_ADDRESS).equals(person.getAddress())
&&
- browser.getText(SEARCH_RESULT_FIRST_ROW_CITY).equals(person.getCity())
&&
- browser.getText(SEARCH_RESULT_FIRST_ROW_STATE).equals(person.getState())
&&
- browser.getText(SEARCH_RESULT_FIRST_ROW_ZIP).equals(person.getZip())
&&
-
browser.getText(SEARCH_RESULT_FIRST_ROW_COUNTRY).equals(person.getCountry());
- }
-
- public void fillCreateContactForm(Person person) {
- browser.type(FIRST_NAME_FIELD, person.getFirstName());
- browser.type(LAST_NAME_FIELD, person.getLastName());
- browser.type(CELL_PHONE_FIELD, person.getCellPhone());
- browser.type(HOME_PHONE_FIELD, person.getHomePhone());
- browser.type(ADDRESS_FIELD, person.getAddress());
- browser.type(CITY_FIELD, person.getCity());
- browser.type(STATE_FIELD, person.getState());
- browser.type(ZIP_FIELD, person.getZip());
- browser.type(COUNTRY_FIELD, person.getCountry());
- }
-
- public void search(String firstName, String lastName) {
- browser.type(SEARCH_FIRST_NAME_FIELD, firstName);
- browser.type(SEARCH_LAST_NAME_FIELD, lastName);
- browser.click(SEARCH_SUBMIT);
- browser.waitForPageToLoad(TIMEOUT);
- }
-
- public void search(Person person) {
- search(person.getFirstName(), person.getLastName());
- }
-}
Deleted:
branches/enterprise/WFK-2_1/examples/contactlist/contactlist-tests/src/test/resources-ftest/testng.xml
===================================================================
---
branches/enterprise/WFK-2_1/examples/contactlist/contactlist-tests/src/test/resources-ftest/testng.xml 2013-06-03
13:46:19 UTC (rev 15522)
+++
branches/enterprise/WFK-2_1/examples/contactlist/contactlist-tests/src/test/resources-ftest/testng.xml 2013-06-03
15:13:18 UTC (rev 15523)
@@ -1,28 +0,0 @@
-
- <!--
- JBoss, Home of Professional Open Source Copyright 2008, Red Hat
- Middleware LLC, and individual contributors by the @authors tag. See
- the copyright.txt in the distribution for a full listing of individual
- contributors. This is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public License as
- published by the Free Software Foundation; either version 2.1 of the
- License, or (at your option) any later version. This software is
- distributed in the hope that it will be useful, but WITHOUT ANY
- WARRANTY; without even the implied warranty of MERCHANTABILITY or
- FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
- License for more details. You should have received a copy of the GNU
- Lesser General Public License along with this software; if not, write
- to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
- Boston, MA 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- -->
-<!DOCTYPE suite SYSTEM "http://beust.com/testng/testng-1.0.dtd" >
-<suite name="Contactlist example" verbose="2"
parallel="false">
- <test name="contactlist_jboss5">
- <parameter name="PROPERTY_FILE" value="empty" />
- <classes>
- <class
- name="org.jboss.seam.example.contactlist.test.selenium.ContactCRUDTest"
/>
- <class
name="org.jboss.seam.example.contactlist.test.selenium.CommentTest" />
- </classes>
- </test>
-</suite>
\ No newline at end of file
Deleted:
branches/enterprise/WFK-2_1/examples/contactlist/contactlist-tests/src/test/resources-integration/arquillian.xml
===================================================================
---
branches/enterprise/WFK-2_1/examples/contactlist/contactlist-tests/src/test/resources-integration/arquillian.xml 2013-06-03
13:46:19 UTC (rev 15522)
+++
branches/enterprise/WFK-2_1/examples/contactlist/contactlist-tests/src/test/resources-integration/arquillian.xml 2013-06-03
15:13:18 UTC (rev 15523)
@@ -1,15 +0,0 @@
-<?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
${jacoco.agent}</property>
- </configuration>
- </container>
-</arquillian>
\ No newline at end of file
Modified: branches/enterprise/WFK-2_1/examples/contactlist/contactlist-web/pom.xml
===================================================================
--- branches/enterprise/WFK-2_1/examples/contactlist/contactlist-web/pom.xml 2013-06-03
13:46:19 UTC (rev 15522)
+++ branches/enterprise/WFK-2_1/examples/contactlist/contactlist-web/pom.xml 2013-06-03
15:13:18 UTC (rev 15523)
@@ -78,6 +78,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
+ <version>${version.war.plugin}</version>
<configuration>
<webResources>
<resource>
Modified: branches/enterprise/WFK-2_1/examples/contactlist/pom.xml
===================================================================
--- branches/enterprise/WFK-2_1/examples/contactlist/pom.xml 2013-06-03 13:46:19 UTC (rev
15522)
+++ branches/enterprise/WFK-2_1/examples/contactlist/pom.xml 2013-06-03 15:13:18 UTC (rev
15523)
@@ -1,48 +1,136 @@
<?xml version="1.0" encoding="UTF-8"?>
-<project
xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd">
- <parent>
- <artifactId>examples</artifactId>
- <groupId>org.jboss.seam</groupId>
- <version>2.3.1.Final-redhat-2</version>
- </parent>
-
- <modelVersion>4.0.0</modelVersion>
- <groupId>org.jboss.seam.examples</groupId>
- <artifactId>contactlist</artifactId>
- <packaging>pom</packaging>
- <name>Contact List Example (EE6)</name>
-
- <modules>
- <module>contactlist-ejb</module>
- <module>contactlist-web</module>
- <module>contactlist-ear</module>
- <module>contactlist-tests</module>
- </modules>
+<project
xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd">
- <properties>
- <example.name>contactlist</example.name>
- </properties>
-
- <dependencyManagement>
- <dependencies>
- <dependency>
- <groupId>org.jboss.seam.examples.contactlist</groupId>
- <artifactId>contactlist-ejb</artifactId>
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.jboss.seam.examples</groupId>
+ <artifactId>contactlist</artifactId>
+ <version>2.3.1.Final-redhat-2</version>
+ <packaging>pom</packaging>
+ <name>Contact List Example (EE6)</name>
+
+ <modules>
+ <module>contactlist-ejb</module>
+ <module>contactlist-web</module>
+ <module>contactlist-ear</module>
+ </modules>
+
+ <properties>
+ <example.name>contactlist</example.name>
+ <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+ <maven.compiler.target>1.6</maven.compiler.target>
+ <maven.compiler.source>1.6</maven.compiler.source>
+
+ <!-- To use jacoco, set jacoco.agent system property to something like
+ -javaagent:/path/to/jacocoagent.jar=append=true,destfile=/path/to/output/jacoco.exec
-->
+ <jacoco.agent />
+
+ <!-- To use custom Maven settings and profiles, uncomment and customize
+ the following properties. This is necessary for the ShrinkWrap resolver to
+ function properly. -->
+ <!--<maven.user.settings>/path/to/custom/settings.xml</maven.user.settings>
-->
+ <!--<maven.profiles>custom,profile</maven.profiles> -->
+
+ <version.commons.logging>1.1.1</version.commons.logging>
+ <version.shrinkwrap.resolver>2.0.0-beta-4</version.shrinkwrap.resolver>
+
+ <!-- Plugin versions -->
+ <version.dependency.plugin>2.5.1</version.dependency.plugin>
+ <version.surefire.plugin>2.10</version.surefire.plugin>
+ <version.compiler.plugin>2.3.1</version.compiler.plugin>
+ <version.ear.plugin>2.6</version.ear.plugin>
+ <version.war.plugin>2.1.1</version.war.plugin>
+ <version.jboss.maven.plugin>7.4.Final</version.jboss.maven.plugin>
+ </properties>
+
+ <dependencyManagement>
+ <dependencies>
+ <dependency>
+ <groupId>org.jboss.seam.examples.contactlist</groupId>
+ <artifactId>contactlist-ejb</artifactId>
+ <version>${project.version}</version>
+ <type>ejb</type>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.seam.examples.contactlist</groupId>
+ <artifactId>contactlist-web</artifactId>
+ <version>${project.version}</version>
+ <type>war</type>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.seam.examples.contactlist</groupId>
+ <artifactId>contactlist-ear</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+
+ <!-- BOMs -->
+ <dependency>
+ <groupId>org.jboss.shrinkwrap.resolver</groupId>
+ <artifactId>shrinkwrap-resolver-bom</artifactId>
+ <version>${version.shrinkwrap.resolver}</version>
+ <scope>import</scope>
+ <type>pom</type>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.seam</groupId>
+ <artifactId>bom</artifactId>
+ <version>${project.version}</version>
+ <type>pom</type>
+ <scope>import</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>commons-logging</groupId>
+ <artifactId>commons-logging</artifactId>
+ <version>${version.commons.logging}</version>
+ <scope>provided</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.seam</groupId>
+ <artifactId>jboss-seam</artifactId>
<version>${project.version}</version>
- <type>ejb</type>
+ <exclusions>
+ <exclusion>
+ <groupId>org.testng</groupId>
+ <artifactId>testng</artifactId>
+ </exclusion>
+ </exclusions>
</dependency>
- <dependency>
- <groupId>org.jboss.seam.examples.contactlist</groupId>
- <artifactId>contactlist-web</artifactId>
- <version>${project.version}</version>
- <type>war</type>
- </dependency>
- <dependency>
- <groupId>org.jboss.seam.examples.contactlist</groupId>
- <artifactId>contactlist-ear</artifactId>
- <version>${project.version}</version>
- </dependency>
- </dependencies>
- </dependencyManagement>
+ </dependencies>
+ </dependencyManagement>
+ <build>
+ <pluginManagement>
+ <plugins>
+ <!-- Manage plugin versions for build stability -->
+ <plugin>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <version>${version.surefire.plugin}</version>
+ <configuration>
+ <systemPropertyVariables>
+ <org.apache.maven.user-settings>${maven.user.settings}</org.apache.maven.user-settings>
+ <maven.profiles>${maven.profiles}</maven.profiles>
+ </systemPropertyVariables>
+ </configuration>
+ </plugin>
+ <plugin>
+ <artifactId>maven-dependency-plugin</artifactId>
+ <version>${version.dependency.plugin}</version>
+ </plugin>
+ <plugin>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <version>${version.compiler.plugin}</version>
+ <configuration>
+ <source>${maven.compiler.source}</source>
+ <target>${maven.compiler.target}</target>
+ </configuration>
+ </plugin>
+ </plugins>
+ </pluginManagement>
+ </build>
+
</project>
Modified: branches/enterprise/WFK-2_1/examples/excel/excel-ear/pom.xml
===================================================================
--- branches/enterprise/WFK-2_1/examples/excel/excel-ear/pom.xml 2013-06-03 13:46:19 UTC
(rev 15522)
+++ branches/enterprise/WFK-2_1/examples/excel/excel-ear/pom.xml 2013-06-03 15:13:18 UTC
(rev 15523)
@@ -2,8 +2,8 @@
<project
xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
+ <groupId>org.jboss.seam.examples</groupId>
<artifactId>excel</artifactId>
- <groupId>org.jboss.seam.examples</groupId>
<version>2.3.1.Final-redhat-2</version>
<relativePath>../pom.xml</relativePath>
</parent>
@@ -51,6 +51,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-ear-plugin</artifactId>
+ <version>${version.ear.plugin}</version>
<configuration>
<version>6</version>
<defaultLibBundleDir>lib</defaultLibBundleDir>
Modified: branches/enterprise/WFK-2_1/examples/excel/excel-ejb/pom.xml
===================================================================
--- branches/enterprise/WFK-2_1/examples/excel/excel-ejb/pom.xml 2013-06-03 13:46:19 UTC
(rev 15522)
+++ branches/enterprise/WFK-2_1/examples/excel/excel-ejb/pom.xml 2013-06-03 15:13:18 UTC
(rev 15523)
@@ -1,46 +1,186 @@
<?xml version="1.0" encoding="UTF-8"?>
-<project
xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd">
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <artifactId>excel</artifactId>
- <groupId>org.jboss.seam.examples</groupId>
- <version>2.3.1.Final-redhat-2</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
-
-
- <groupId>org.jboss.seam.examples.excel</groupId>
- <artifactId>excel-ejb</artifactId>
- <packaging>ejb</packaging>
- <name>Excel EJB Module (EE6)</name>
-
- <dependencies>
- <dependency>
- <groupId>org.jboss.seam</groupId>
- <artifactId>jboss-seam</artifactId>
- <type>ejb</type>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.hibernate.javax.persistence</groupId>
- <artifactId>hibernate-jpa-2.0-api</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.jboss.spec.javax.servlet</groupId>
- <artifactId>jboss-servlet-api_3.0_spec</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.jboss.spec.javax.ejb</groupId>
- <artifactId>jboss-ejb-api_3.1_spec</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.jboss.spec.javax.faces</groupId>
- <artifactId>jboss-jsf-api_2.1_spec</artifactId>
- <scope>provided</scope>
- </dependency>
- </dependencies>
+<project
xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.jboss.seam.examples</groupId>
+ <artifactId>excel</artifactId>
+ <version>2.3.1.Final-redhat-2</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+
+ <groupId>org.jboss.seam.examples.excel</groupId>
+ <artifactId>excel-ejb</artifactId>
+ <packaging>ejb</packaging>
+ <name>Excel EJB Module (EE6)</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.jboss.seam</groupId>
+ <artifactId>jboss-seam</artifactId>
+ <type>ejb</type>
+ <scope>provided</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.hibernate.javax.persistence</groupId>
+ <artifactId>hibernate-jpa-2.0-api</artifactId>
+ <scope>provided</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.spec.javax.servlet</groupId>
+ <artifactId>jboss-servlet-api_3.0_spec</artifactId>
+ <scope>provided</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.spec.javax.ejb</groupId>
+ <artifactId>jboss-ejb-api_3.1_spec</artifactId>
+ <scope>provided</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.spec.javax.faces</groupId>
+ <artifactId>jboss-jsf-api_2.1_spec</artifactId>
+ <scope>provided</scope>
+ </dependency>
+
+ <!-- Test dependencies -->
+ <dependency>
+ <groupId>org.jboss.shrinkwrap.resolver</groupId>
+ <artifactId>shrinkwrap-resolver-depchain</artifactId>
+ <type>pom</type>
+ <scope>test</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>
+
+ <!-- additional libraries needed just for this example -->
+ <dependency>
+ <groupId>net.sourceforge.jexcelapi</groupId>
+ <artifactId>jxl</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.seam</groupId>
+ <artifactId>jboss-seam-ui</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.seam</groupId>
+ <artifactId>jboss-seam-excel</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.seam</groupId>
+ <artifactId>jboss-seam-mail</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.seam</groupId>
+ <artifactId>jboss-seam-pdf</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.seam</groupId>
+ <artifactId>jboss-seam-rss</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.spec.javax.el</groupId>
+ <artifactId>jboss-el-api_2.2_spec</artifactId>
+ </dependency>
+ </dependencies>
+
+ <profiles>
+ <profile>
+ <id>integration-tests</id>
+ <activation>
+ <property>
+ <name>arquillian</name>
+ </property>
+ </activation>
+ <properties>
+ <jndiPattern>java:app/seam-excel/#{ejbName}</jndiPattern>
+ <distributable>false</distributable>
+ </properties>
+ <build>
+ <testResources>
+ <testResource>
+ <directory>src/test/resources</directory>
+ <filtering>true</filtering>
+ </testResource>
+ </testResources>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <skip>false</skip>
+ </configuration>
+ </plugin>
+ </plugins>
+ </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>
+ </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>
+ </profiles>
+
+ <build>
+ <plugins>
+ <!-- Skip tests by default -->
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <skip>true</skip>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
</project>
Added:
branches/enterprise/WFK-2_1/examples/excel/excel-ejb/src/test/java/org/jboss/seam/example/excel/test/Deployments.java
===================================================================
---
branches/enterprise/WFK-2_1/examples/excel/excel-ejb/src/test/java/org/jboss/seam/example/excel/test/Deployments.java
(rev 0)
+++
branches/enterprise/WFK-2_1/examples/excel/excel-ejb/src/test/java/org/jboss/seam/example/excel/test/Deployments.java 2013-06-03
15:13:18 UTC (rev 15523)
@@ -0,0 +1,39 @@
+package org.jboss.seam.example.excel.test;
+
+import java.io.File;
+
+import org.jboss.seam.example.excel.ExcelTest;
+import org.jboss.shrinkwrap.api.ShrinkWrap;
+import org.jboss.shrinkwrap.api.asset.StringAsset;
+import org.jboss.shrinkwrap.api.spec.WebArchive;
+import org.jboss.shrinkwrap.resolver.api.maven.Maven;
+
+public class Deployments
+{
+ public static WebArchive excelDeployment() {
+
+ // use profiles defined in 'maven.profiles' property in pom.xml
+ String profilesString = System.getProperty("maven.profiles");
+ String[] profiles = profilesString != null ? profilesString.split(", ?")
: new String[0];
+ File[] libs = Maven.resolver().loadPomFromFile("pom.xml", profiles)
+ .importCompileAndRuntimeDependencies()
+ // force resolve jboss-seam, because it is provided-scoped in the pom, but we
need it bundled in the WAR
+ .resolve("org.jboss.seam:jboss-seam").withTransitivity().asFile();
+
+
+
+ return ShrinkWrap.create(WebArchive.class, "seam-excel.war")
+ .addPackage(ExcelTest.class.getPackage())
+ .addAsWebInfResource("META-INF/ejb-jar.xml",
"ejb-jar.xml")
+ .addAsWebInfResource("persistence.xml",
"classes/META-INF/persistence.xml")
+ .addAsWebInfResource(new
StringAsset("org.jboss.seam.mock.MockFacesContextFactory"),
"classes/META-INF/services/javax.faces.context.FacesContextFactory")
+ .addAsWebInfResource("components.xml",
"components.xml")
+ .addAsWebInfResource("jboss-deployment-structure.xml",
"jboss-deployment-structure.xml")
+ .addAsWebInfResource("seam.properties",
"classes/seam.properties")
+ .addAsWebInfResource("web.xml", "web.xml")
+ .addAsWebResource("simple.xhtml")
+ .addAsLibraries(libs);
+
+ }
+
+}
Added:
branches/enterprise/WFK-2_1/examples/excel/excel-ejb/src/test/java/org/jboss/seam/example/excel/test/RenderTest.java
===================================================================
---
branches/enterprise/WFK-2_1/examples/excel/excel-ejb/src/test/java/org/jboss/seam/example/excel/test/RenderTest.java
(rev 0)
+++
branches/enterprise/WFK-2_1/examples/excel/excel-ejb/src/test/java/org/jboss/seam/example/excel/test/RenderTest.java 2013-06-03
15:13:18 UTC (rev 15523)
@@ -0,0 +1,85 @@
+package org.jboss.seam.example.excel.test;
+
+import java.io.ByteArrayInputStream;
+
+import jxl.Sheet;
+import jxl.Workbook;
+
+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;
+import org.jboss.seam.faces.Renderer;
+import org.jboss.seam.mock.JUnitSeamTest;
+import org.jboss.shrinkwrap.api.Archive;
+import org.jboss.shrinkwrap.api.spec.WebArchive;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+/**
+ * @author Daniel Roth
+ *
+ * Really small test. Renders an jxl excel file from jsf tags and
+ * verifies the content.
+ *
+ */
+(a)RunWith(Arquillian.class)
+public class RenderTest extends JUnitSeamTest
+{
+
+ @Deployment(name = "RenderTest")
+ @OverProtocol("Servlet 3.0")
+ public static Archive<?> createDeployment()
+ {
+
+ WebArchive web = Deployments.excelDeployment();
+ return web;
+ }
+
+ @Test
+ public void testSimple() throws Exception
+ {
+
+ new FacesRequest()
+ {
+
+ @Override
+ protected void updateModelValues() throws Exception
+ {
+ }
+
+ @Override
+ protected void invokeApplication() throws Exception
+ {
+
+ Renderer.instance().render("/simple.xhtml");
+
+ DocumentData data = (DocumentData)
Contexts.getEventContext().get("testExport");
+ Workbook workbook = Workbook.getWorkbook(new
ByteArrayInputStream(((ByteArrayDocumentData) data).getData()));
+ Sheet sheet = workbook.getSheet("Developers");
+
+ assert sheet != null;
+
+ assert "Daniel Roth".equals(sheet.getCell(0, 0).getContents());
+ assert "Nicklas Karlsson".equals(sheet.getCell(0,
1).getContents());
+
+ }
+ }.run();
+ }
+
+ public static void main(String[] args)
+ {
+ RenderTest t = new RenderTest();
+ try
+ {
+ t.testSimple();
+ }
+ catch (Exception e)
+ {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ }
+}
Added:
branches/enterprise/WFK-2_1/examples/excel/excel-ejb/src/test/resources/arquillian.xml
===================================================================
---
branches/enterprise/WFK-2_1/examples/excel/excel-ejb/src/test/resources/arquillian.xml
(rev 0)
+++
branches/enterprise/WFK-2_1/examples/excel/excel-ejb/src/test/resources/arquillian.xml 2013-06-03
15:13:18 UTC (rev 15523)
@@ -0,0 +1,24 @@
+<?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>
+ <!-- These properties are only valid for arquillian managed container,
+ but don't cause a problem for the remote container, so they
+ can be left in. -->
+ <!-- To use jacoco, set jacoco.agent system property to something like
+
-javaagent:/path/to/jacocoagent.jar=append=true,destfile=/path/to/output/jacoco.exec
-->
+ <property name="javaVmArguments">-Xmx1024m
-XX:MaxPermSize=1024m ${jacoco.agent}</property>
+ <property
name="serverConfig">standalone.xml</property>
+ <!-- If jbossHome property is not set, the JBOSS_HOME environment variable
is used -->
+ <!--<property
name="jbossHome">/path/to/jboss/as</property>-->
+ </configuration>
+ </container>
+
+</arquillian>
\ No newline at end of file
Added:
branches/enterprise/WFK-2_1/examples/excel/excel-ejb/src/test/resources/components.xml
===================================================================
---
branches/enterprise/WFK-2_1/examples/excel/excel-ejb/src/test/resources/components.xml
(rev 0)
+++
branches/enterprise/WFK-2_1/examples/excel/excel-ejb/src/test/resources/components.xml 2013-06-03
15:13:18 UTC (rev 15523)
@@ -0,0 +1,27 @@
+<components
xmlns="http://jboss.org/schema/seam/components"
+
xmlns:excel="http://jboss.org/schema/seam/excel"
+
xmlns:core="http://jboss.org/schema/seam/core"
+
xmlns:framework="http://jboss.org/schema/seam/framework"
+
xmlns:document="http://jboss.org/schema/seam/document"
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
xsi:schemaLocation="http://jboss.org/schema/seam/core
http://jboss.org/schema/seam/core-2.3.xsd
+
http://jboss.org/schema/seam/framework
http://jboss.org/schema/seam/framework-2.3.xsd
+
http://jboss.org/schema/seam/document
http://jboss.org/schema/seam/document-2.3.xsd
+
http://jboss.org/schema/seam/excel
http://jboss.org/schema/seam/excel-2.3.xsd
+
http://jboss.org/schema/seam/components
http://jboss.org/schema/seam/components-2.3.xsd">
+
+
+ <core:init debug="true" jndi-pattern="${jndiPattern}" />
+
+ <document:document-store
use-extensions="true"></document:document-store>
+
+ <!-- A sample on how a POI implementation could be added.
+ <excel:excelFactory>
+ <property name="implementations">
+ <key>poi</key>
+ <value>org.jboss.seam.excel.poi.POIExcelWorkbook</value>
+ </property>
+ </excel:excelFactory>
+ -->
+
+</components>
Added:
branches/enterprise/WFK-2_1/examples/excel/excel-ejb/src/test/resources/ejb-jar.xml
===================================================================
--- branches/enterprise/WFK-2_1/examples/excel/excel-ejb/src/test/resources/ejb-jar.xml
(rev 0)
+++
branches/enterprise/WFK-2_1/examples/excel/excel-ejb/src/test/resources/ejb-jar.xml 2013-06-03
15:13:18 UTC (rev 15523)
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ejb-jar
xmlns="http://java.sun.com/xml/ns/javaee"
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/ejb-jar_3_0.xsd"
+ version="3.0">
+
+ <interceptors>
+ <interceptor>
+
<interceptor-class>org.jboss.seam.ejb.SeamInterceptor</interceptor-class>
+ </interceptor>
+ </interceptors>
+
+ <assembly-descriptor>
+ <interceptor-binding>
+ <ejb-name>*</ejb-name>
+
<interceptor-class>org.jboss.seam.ejb.SeamInterceptor</interceptor-class>
+ </interceptor-binding>
+ </assembly-descriptor>
+</ejb-jar>
Added:
branches/enterprise/WFK-2_1/examples/excel/excel-ejb/src/test/resources/jboss-deployment-structure.xml
===================================================================
---
branches/enterprise/WFK-2_1/examples/excel/excel-ejb/src/test/resources/jboss-deployment-structure.xml
(rev 0)
+++
branches/enterprise/WFK-2_1/examples/excel/excel-ejb/src/test/resources/jboss-deployment-structure.xml 2013-06-03
15:13:18 UTC (rev 15523)
@@ -0,0 +1,9 @@
+<jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.0">
+ <deployment>
+ <dependencies>
+<!-- <module name="org.antlr"
export="true"/>-->
+ <module name="org.dom4j" export="true"/>
+ <module name="javax.faces.api" export="true"/>
+ </dependencies>
+ </deployment>
+</jboss-deployment-structure>
Added:
branches/enterprise/WFK-2_1/examples/excel/excel-ejb/src/test/resources/persistence.xml
===================================================================
---
branches/enterprise/WFK-2_1/examples/excel/excel-ejb/src/test/resources/persistence.xml
(rev 0)
+++
branches/enterprise/WFK-2_1/examples/excel/excel-ejb/src/test/resources/persistence.xml 2013-06-03
15:13:18 UTC (rev 15523)
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<persistence
xmlns="http://java.sun.com/xml/ns/persistence"
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence
http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd"
+ version="2.0">
+ <persistence-unit name="userDatabase">
+ <provider>org.hibernate.ejb.HibernatePersistence</provider>
+ <jta-data-source>java:jboss/datasources/ExampleDS</jta-data-source>
+ <properties>
+ <property name="hibernate.hbm2ddl.auto"
value="create-drop"/>
+ <property name="hibernate.show_sql" value="true"/>
+ <property name="jboss.entity.manager.factory.jndi.name"
+ value="java:/seamexcelEntityManagerFactory"/>
+ </properties>
+ </persistence-unit>
+</persistence>
Added:
branches/enterprise/WFK-2_1/examples/excel/excel-ejb/src/test/resources/seam.properties
===================================================================
---
branches/enterprise/WFK-2_1/examples/excel/excel-ejb/src/test/resources/seam.properties
(rev 0)
+++
branches/enterprise/WFK-2_1/examples/excel/excel-ejb/src/test/resources/seam.properties 2013-06-03
15:13:18 UTC (rev 15523)
@@ -0,0 +1 @@
+
Added:
branches/enterprise/WFK-2_1/examples/excel/excel-ejb/src/test/resources/simple.xhtml
===================================================================
--- branches/enterprise/WFK-2_1/examples/excel/excel-ejb/src/test/resources/simple.xhtml
(rev 0)
+++
branches/enterprise/WFK-2_1/examples/excel/excel-ejb/src/test/resources/simple.xhtml 2013-06-03
15:13:18 UTC (rev 15523)
@@ -0,0 +1,8 @@
+<e:workbook exportKey="testExport"
+
xmlns:e="http://jboss.org/schema/seam/excel"
+
xmlns:f="http://java.sun.com/jsf/core">
+ <e:worksheet name="Developers">
+ <e:cell column="0" row="0" value="Daniel Roth" />
+ <e:cell column="0" row="1" value="Nicklas Karlsson"
/>
+ </e:worksheet>
+</e:workbook>
Added: branches/enterprise/WFK-2_1/examples/excel/excel-ejb/src/test/resources/web.xml
===================================================================
--- branches/enterprise/WFK-2_1/examples/excel/excel-ejb/src/test/resources/web.xml
(rev 0)
+++
branches/enterprise/WFK-2_1/examples/excel/excel-ejb/src/test/resources/web.xml 2013-06-03
15:13:18 UTC (rev 15523)
@@ -0,0 +1,68 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<web-app
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
+
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
+ version="3.0">
+ <listener>
+ <listener-class>org.jboss.seam.servlet.SeamListener</listener-class>
+ </listener>
+ <filter>
+ <filter-name>Seam Filter</filter-name>
+ <filter-class>org.jboss.seam.servlet.SeamFilter</filter-class>
+ </filter>
+ <filter-mapping>
+ <filter-name>Seam Filter</filter-name>
+ <url-pattern>/*</url-pattern>
+ </filter-mapping>
+ <servlet>
+ <servlet-name>Seam Resource Servlet</servlet-name>
+ <servlet-class>org.jboss.seam.servlet.SeamResourceServlet</servlet-class>
+ </servlet>
+ <servlet-mapping>
+ <servlet-name>Seam Resource Servlet</servlet-name>
+ <url-pattern>/seam/resource/*</url-pattern>
+ </servlet-mapping>
+ <servlet>
+ <servlet-name>Document Store Servlet</servlet-name>
+ <servlet-class>org.jboss.seam.document.DocumentStoreServlet</servlet-class>
+ </servlet>
+ <servlet-mapping>
+ <servlet-name>Document Store Servlet</servlet-name>
+ <url-pattern>*.csv</url-pattern>
+ </servlet-mapping>
+ <servlet-mapping>
+ <servlet-name>Document Store Servlet</servlet-name>
+ <url-pattern>*.xls</url-pattern>
+ </servlet-mapping>
+ <servlet>
+ <servlet-name>Faces Servlet</servlet-name>
+ <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
+ <load-on-startup>1</load-on-startup>
+ </servlet>
+ <servlet-mapping>
+ <servlet-name>Faces Servlet</servlet-name>
+ <url-pattern>*.seam</url-pattern>
+ </servlet-mapping>
+ <context-param>
+ <param-name>javax.faces.DEFAULT_SUFFIX</param-name>
+ <param-value>.xhtml</param-value>
+ </context-param>
+ <context-param>
+ <param-name>webAppRootKey</param-name>
+ <param-value>seam-excel</param-value>
+ </context-param>
+ <context-param>
+ <param-name>facelets.DEVELOPMENT</param-name>
+ <param-value>true</param-value>
+ </context-param>
+
+ <!-- JSF2 requires to set this parameter, otherwise embedded text UI component
won't be rendered -->
+ <context-param>
+ <param-name>com.sun.faces.allowTextChildren</param-name>
+ <param-value>true</param-value>
+ </context-param>
+
+ <session-config>
+ <session-timeout>10</session-timeout>
+ </session-config>
+</web-app>
Deleted: branches/enterprise/WFK-2_1/examples/excel/excel-tests/pom.xml
===================================================================
--- branches/enterprise/WFK-2_1/examples/excel/excel-tests/pom.xml 2013-06-03 13:46:19 UTC
(rev 15522)
+++ branches/enterprise/WFK-2_1/examples/excel/excel-tests/pom.xml 2013-06-03 15:13:18 UTC
(rev 15523)
@@ -1,184 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project
xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd">
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <artifactId>excel</artifactId>
- <groupId>org.jboss.seam.examples</groupId>
- <version>2.3.1.Final-redhat-2</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
-
- <groupId>org.jboss.seam.examples.excel</groupId>
- <artifactId>excel-tests</artifactId>
- <name>Excel Integration Tests Module (EE6)</name>
-
- <dependencies>
- <dependency>
- <groupId>org.testng</groupId>
- <artifactId>testng</artifactId>
- </dependency>
- <dependency>
- <groupId>org.jboss.seam.examples.excel</groupId>
- <artifactId>excel-ejb</artifactId>
- <type>ejb</type>
- <scope>test</scope>
- </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>
- </dependency>
- <dependency>
- <groupId>org.jboss.spec.javax.faces</groupId>
- <artifactId>jboss-jsf-api_2.1_spec</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.seleniumhq.selenium</groupId>
- <artifactId>selenium-server</artifactId>
- </dependency>
- <dependency>
- <groupId>org.seleniumhq.selenium</groupId>
- <artifactId>selenium-java</artifactId>
- </dependency>
- <dependency>
- <groupId>org.jboss.seam</groupId>
- <artifactId>functional-tests</artifactId>
- <scope>test</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>
-
- <!-- additional libraries needed just for this example -->
- <dependency>
- <groupId>net.sourceforge.jexcelapi</groupId>
- <artifactId>jxl</artifactId>
- </dependency>
- <dependency>
- <groupId>org.jboss.seam</groupId>
- <artifactId>jboss-seam-ui</artifactId>
- </dependency>
- <dependency>
- <groupId>org.jboss.seam</groupId>
- <artifactId>jboss-seam-excel</artifactId>
- </dependency>
- <dependency>
- <groupId>org.jboss.seam</groupId>
- <artifactId>jboss-seam-mail</artifactId>
- </dependency>
- <dependency>
- <groupId>org.jboss.seam</groupId>
- <artifactId>jboss-seam-pdf</artifactId>
- </dependency>
- <dependency>
- <groupId>org.jboss.spec.javax.el</groupId>
- <artifactId>jboss-el-api_2.2_spec</artifactId>
- </dependency>
- </dependencies>
-
- <build>
- <testResources>
- <testResource>
- <directory>src/test/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>
- <skip>true</skip>
- </configuration>
- </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-excel</example.context.path>
- </properties>
- <build>
- <plugins>
- <plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>selenium-maven-plugin</artifactId>
- </plugin>
- <plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>failsafe-maven-plugin</artifactId>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-antrun-plugin</artifactId>
- </plugin>
- </plugins>
- </build>
- </profile>
- </profiles>
-
-</project>
Deleted:
branches/enterprise/WFK-2_1/examples/excel/excel-tests/src/test/java/org/jboss/seam/example/excel/test/RenderTest.java
===================================================================
---
branches/enterprise/WFK-2_1/examples/excel/excel-tests/src/test/java/org/jboss/seam/example/excel/test/RenderTest.java 2013-06-03
13:46:19 UTC (rev 15522)
+++
branches/enterprise/WFK-2_1/examples/excel/excel-tests/src/test/java/org/jboss/seam/example/excel/test/RenderTest.java 2013-06-03
15:13:18 UTC (rev 15523)
@@ -1,86 +0,0 @@
-package org.jboss.seam.example.excel.test;
-
-import java.io.File;
-import java.io.ByteArrayInputStream;
-
-import jxl.Sheet;
-import jxl.Workbook;
-
-import org.jboss.shrinkwrap.api.Archive;
-import org.jboss.shrinkwrap.api.ShrinkWrap;
-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;
-import org.jboss.seam.faces.Renderer;
-import org.jboss.seam.mock.JUnitSeamTest;
-import org.junit.runner.RunWith;
-import org.junit.Test;
-
-/**
- * @author Daniel Roth
- *
- * Really small test. Renders an jxl excel file from jsf tags and
- * verifies the content.
- *
- */
-(a)RunWith(Arquillian.class)
-public class RenderTest extends JUnitSeamTest {
-
- @Deployment(name="RenderTest")
- @OverProtocol("Servlet 3.0")
- public static Archive<?> createDeployment()
- {
- EnterpriseArchive er = ShrinkWrap.create(ZipImporter.class,
"seam-excel.ear").importFrom(new
File("../excel-ear/target/seam-excel.ear"))
- .as(EnterpriseArchive.class);
- WebArchive web = er.getAsType(WebArchive.class, "excel-web.war");
- web.addAsWebInfResource(new
StringAsset("org.jboss.seam.mock.MockFacesContextFactory"),
"classes/META-INF/services/javax.faces.context.FacesContextFactory");
- web.addClasses(RenderTest.class);
-
- return er;
- }
-
- @Test
- public void testSimple() throws Exception {
-
- new FacesRequest() {
-
- @Override
- protected void updateModelValues() throws Exception {
- }
-
- @Override
- protected void invokeApplication() throws Exception {
-
- Renderer.instance().render("/simple.xhtml");
-
- DocumentData data = (DocumentData)
Contexts.getEventContext().get("testExport");
- Workbook workbook = Workbook.getWorkbook(new
ByteArrayInputStream(((ByteArrayDocumentData)data).getData()));
- Sheet sheet = workbook.getSheet("Developers");
-
- assert sheet != null;
-
- assert "Daniel Roth".equals(sheet.getCell(0,
0).getContents());
- assert "Nicklas Karlsson".equals(sheet.getCell(0,
1).getContents());
-
- }
- }.run();
- }
-
- public static void main(String[] args) {
- RenderTest t = new RenderTest();
- try {
- t.testSimple();
- } catch (Exception e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- }
-}
Deleted:
branches/enterprise/WFK-2_1/examples/excel/excel-tests/src/test/java/org/jboss/seam/example/excel/test/selenium/SeleniumExcelTest.java
===================================================================
---
branches/enterprise/WFK-2_1/examples/excel/excel-tests/src/test/java/org/jboss/seam/example/excel/test/selenium/SeleniumExcelTest.java 2013-06-03
13:46:19 UTC (rev 15522)
+++
branches/enterprise/WFK-2_1/examples/excel/excel-tests/src/test/java/org/jboss/seam/example/excel/test/selenium/SeleniumExcelTest.java 2013-06-03
15:13:18 UTC (rev 15523)
@@ -1,27 +0,0 @@
-package org.jboss.seam.example.excel.test.selenium;
-
-import org.jboss.seam.example.common.test.selenium.SeamSeleniumTest;
-import org.testng.annotations.BeforeMethod;
-import org.testng.annotations.Test;
-import static org.testng.AssertJUnit.assertEquals;
-
-public class SeleniumExcelTest extends SeamSeleniumTest
-{
- public static final String HOME_PAGE = "/home.seam";
- public static final String HOME_PAGE_TITLE = "Microsoft® Excel® Export
examples";
-
- @BeforeMethod
- @Override
- public void setUp() {
- super.setUp();
- browser.open(CONTEXT_PATH + HOME_PAGE);
- }
-
- /**
- * Place holder - just verifies that example deploys
- */
- @Test
- public void homePageLoadTest() {
- assertEquals("Unexpected page title.", HOME_PAGE_TITLE,
browser.getTitle());
- }
-}
Deleted:
branches/enterprise/WFK-2_1/examples/excel/excel-tests/src/test/resources-ftest/testng.xml
===================================================================
---
branches/enterprise/WFK-2_1/examples/excel/excel-tests/src/test/resources-ftest/testng.xml 2013-06-03
13:46:19 UTC (rev 15522)
+++
branches/enterprise/WFK-2_1/examples/excel/excel-tests/src/test/resources-ftest/testng.xml 2013-06-03
15:13:18 UTC (rev 15523)
@@ -1,26 +0,0 @@
-
- <!--
- JBoss, Home of Professional Open Source Copyright 2008, Red Hat
- Middleware LLC, and individual contributors by the @authors tag. See
- the copyright.txt in the distribution for a full listing of individual
- contributors. This is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public License as
- published by the Free Software Foundation; either version 2.1 of the
- License, or (at your option) any later version. This software is
- distributed in the hope that it will be useful, but WITHOUT ANY
- WARRANTY; without even the implied warranty of MERCHANTABILITY or
- FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
- License for more details. You should have received a copy of the GNU
- Lesser General Public License along with this software; if not, write
- to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
- Boston, MA 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- -->
-<!DOCTYPE suite SYSTEM "http://beust.com/testng/testng-1.0.dtd" >
-<suite name="Excel example" verbose="2"
parallel="false">
- <test name="excel_tests">
- <parameter name="PROPERTY_FILE" value="" />
- <classes>
- <class
name="org.jboss.seam.example.excel.test.selenium.SeleniumExcelTest" />
- </classes>
- </test>
-</suite>
Deleted:
branches/enterprise/WFK-2_1/examples/excel/excel-tests/src/test/resources-integration/arquillian.xml
===================================================================
---
branches/enterprise/WFK-2_1/examples/excel/excel-tests/src/test/resources-integration/arquillian.xml 2013-06-03
13:46:19 UTC (rev 15522)
+++
branches/enterprise/WFK-2_1/examples/excel/excel-tests/src/test/resources-integration/arquillian.xml 2013-06-03
15:13:18 UTC (rev 15523)
@@ -1,16 +0,0 @@
-<?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 ${jacoco.agent}</property>
- </configuration>
- </container>
-
-</arquillian>
Modified: branches/enterprise/WFK-2_1/examples/excel/excel-web/pom.xml
===================================================================
--- branches/enterprise/WFK-2_1/examples/excel/excel-web/pom.xml 2013-06-03 13:46:19 UTC
(rev 15522)
+++ branches/enterprise/WFK-2_1/examples/excel/excel-web/pom.xml 2013-06-03 15:13:18 UTC
(rev 15523)
@@ -70,6 +70,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
+ <version>${version.war.plugin}</version>
<configuration>
<webResources>
<resource>
Modified: branches/enterprise/WFK-2_1/examples/excel/pom.xml
===================================================================
--- branches/enterprise/WFK-2_1/examples/excel/pom.xml 2013-06-03 13:46:19 UTC (rev
15522)
+++ branches/enterprise/WFK-2_1/examples/excel/pom.xml 2013-06-03 15:13:18 UTC (rev
15523)
@@ -1,15 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<project
xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd">
- <parent>
- <artifactId>examples</artifactId>
- <groupId>org.jboss.seam</groupId>
- <version>2.3.1.Final-redhat-2</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.jboss.seam.examples</groupId>
<artifactId>excel</artifactId>
+ <version>2.3.1.Final-redhat-2</version>
<packaging>pom</packaging>
<name>Excel Example (EE6)</name>
@@ -17,12 +12,35 @@
<module>excel-ejb</module>
<module>excel-web</module>
<module>excel-ear</module>
- <module>excel-tests</module>
</modules>
- <properties>
- <example.name>excel</example.name>
- </properties>
+ <properties>
+ <example.name>excel</example.name>
+ <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+ <maven.compiler.target>1.6</maven.compiler.target>
+ <maven.compiler.source>1.6</maven.compiler.source>
+
+ <!-- To use jacoco, set jacoco.agent system property to something like
+ -javaagent:/path/to/jacocoagent.jar=append=true,destfile=/path/to/output/jacoco.exec
-->
+ <jacoco.agent />
+
+ <!-- To use custom Maven settings and profiles, uncomment and customize
+ the following properties. This is necessary for the ShrinkWrap resolver to
+ function properly. -->
+ <!--<maven.user.settings>/path/to/custom/settings.xml</maven.user.settings>
-->
+ <!--<maven.profiles>custom,profile</maven.profiles> -->
+
+ <version.commons.logging>1.1.1</version.commons.logging>
+ <version.shrinkwrap.resolver>2.0.0-beta-4</version.shrinkwrap.resolver>
+
+ <!-- Plugin versions -->
+ <version.dependency.plugin>2.5.1</version.dependency.plugin>
+ <version.surefire.plugin>2.10</version.surefire.plugin>
+ <version.compiler.plugin>2.3.1</version.compiler.plugin>
+ <version.ear.plugin>2.6</version.ear.plugin>
+ <version.war.plugin>2.1.1</version.war.plugin>
+ <version.jboss.maven.plugin>7.4.Final</version.jboss.maven.plugin>
+ </properties>
<dependencyManagement>
<dependencies>
@@ -32,18 +50,79 @@
<version>${project.version}</version>
<type>ejb</type>
</dependency>
+
<dependency>
<groupId>org.jboss.seam.examples.excel</groupId>
<artifactId>excel-web</artifactId>
<version>${project.version}</version>
<type>war</type>
</dependency>
+
<dependency>
<groupId>org.jboss.seam.examples.excel</groupId>
<artifactId>excel-ear</artifactId>
<version>${project.version}</version>
</dependency>
+
+ <!-- BOMs -->
+ <dependency>
+ <groupId>org.jboss.shrinkwrap.resolver</groupId>
+ <artifactId>shrinkwrap-resolver-bom</artifactId>
+ <version>${version.shrinkwrap.resolver}</version>
+ <scope>import</scope>
+ <type>pom</type>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.seam</groupId>
+ <artifactId>bom</artifactId>
+ <version>${project.version}</version>
+ <type>pom</type>
+ <scope>import</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.seam</groupId>
+ <artifactId>jboss-seam</artifactId>
+ <version>${project.version}</version>
+ <exclusions>
+ <exclusion>
+ <groupId>org.testng</groupId>
+ <artifactId>testng</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
</dependencies>
</dependencyManagement>
+ <build>
+ <pluginManagement>
+ <plugins>
+ <!-- Manage plugin versions for build stability -->
+ <plugin>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <version>${version.surefire.plugin}</version>
+ <configuration>
+ <systemPropertyVariables>
+ <org.apache.maven.user-settings>${maven.user.settings}</org.apache.maven.user-settings>
+ <maven.profiles>${maven.profiles}</maven.profiles>
+ </systemPropertyVariables>
+ </configuration>
+ </plugin>
+ <plugin>
+ <artifactId>maven-dependency-plugin</artifactId>
+ <version>${version.dependency.plugin}</version>
+ </plugin>
+ <plugin>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <version>${version.compiler.plugin}</version>
+ <configuration>
+ <source>${maven.compiler.source}</source>
+ <target>${maven.compiler.target}</target>
+ </configuration>
+ </plugin>
+ </plugins>
+ </pluginManagement>
+ </build>
+
</project>