Seam SVN: r15532 - in branches/enterprise/WFK-2_1/examples/seampay: seampay-ear and 12 other directories.
by seam-commits@lists.jboss.org
Author: maschmid
Date: 2013-06-03 13:24:43 -0400 (Mon, 03 Jun 2013)
New Revision: 15532
Added:
branches/enterprise/WFK-2_1/examples/seampay/seampay-ejb/src/test/
branches/enterprise/WFK-2_1/examples/seampay/seampay-ejb/src/test/java/
branches/enterprise/WFK-2_1/examples/seampay/seampay-ejb/src/test/java/org/
branches/enterprise/WFK-2_1/examples/seampay/seampay-ejb/src/test/java/org/jboss/
branches/enterprise/WFK-2_1/examples/seampay/seampay-ejb/src/test/java/org/jboss/seam/
branches/enterprise/WFK-2_1/examples/seampay/seampay-ejb/src/test/java/org/jboss/seam/example/
branches/enterprise/WFK-2_1/examples/seampay/seampay-ejb/src/test/java/org/jboss/seam/example/seampay/
branches/enterprise/WFK-2_1/examples/seampay/seampay-ejb/src/test/java/org/jboss/seam/example/seampay/test/
branches/enterprise/WFK-2_1/examples/seampay/seampay-ejb/src/test/java/org/jboss/seam/example/seampay/test/AccountTest.java
branches/enterprise/WFK-2_1/examples/seampay/seampay-ejb/src/test/java/org/jboss/seam/example/seampay/test/Deployments.java
branches/enterprise/WFK-2_1/examples/seampay/seampay-ejb/src/test/java/org/jboss/seam/example/seampay/test/PaymentProcessorTest.java
branches/enterprise/WFK-2_1/examples/seampay/seampay-ejb/src/test/resources/
branches/enterprise/WFK-2_1/examples/seampay/seampay-ejb/src/test/resources/arquillian.xml
branches/enterprise/WFK-2_1/examples/seampay/seampay-ejb/src/test/resources/components.xml
branches/enterprise/WFK-2_1/examples/seampay/seampay-ejb/src/test/resources/jboss-deployment-structure.xml
branches/enterprise/WFK-2_1/examples/seampay/seampay-ejb/src/test/resources/pages.xml
branches/enterprise/WFK-2_1/examples/seampay/seampay-ejb/src/test/resources/web.xml
Removed:
branches/enterprise/WFK-2_1/examples/seampay/seampay-tests/
Modified:
branches/enterprise/WFK-2_1/examples/seampay/pom.xml
branches/enterprise/WFK-2_1/examples/seampay/seampay-ear/pom.xml
branches/enterprise/WFK-2_1/examples/seampay/seampay-ejb/pom.xml
branches/enterprise/WFK-2_1/examples/seampay/seampay-web/pom.xml
Log:
migrated seampay
Modified: branches/enterprise/WFK-2_1/examples/seampay/pom.xml
===================================================================
--- branches/enterprise/WFK-2_1/examples/seampay/pom.xml 2013-06-03 17:19:25 UTC (rev 15531)
+++ branches/enterprise/WFK-2_1/examples/seampay/pom.xml 2013-06-03 17:24:43 UTC (rev 15532)
@@ -3,27 +3,49 @@
<modelVersion>4.0.0</modelVersion>
<groupId>org.jboss.seam.examples</groupId>
<artifactId>seampay</artifactId>
- <parent>
- <groupId>org.jboss.seam</groupId>
- <artifactId>examples</artifactId>
- <version>2.3.1.Final-redhat-2</version>
- </parent>
+ <version>2.3.1.Final-redhat-2</version>
+
<packaging>pom</packaging>
<name>Seampay Example (EE6)</name>
<properties>
<example.name>seampay</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 with ShrinkWrap Resolver, uncomment
+ and customize the following property. -->
+ <!--<maven.user.settings>/path/to/custom/settings.xml</maven.user.settings>-->
+
+ <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.resources.plugin>2.6</version.resources.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.ejb.plugin>2.3</version.ejb.plugin>
+ <version.jboss.maven.plugin>7.4.Final</version.jboss.maven.plugin>
</properties>
<modules>
<module>seampay-ear</module>
<module>seampay-ejb</module>
<module>seampay-web</module>
- <module>seampay-tests</module>
+
</modules>
<dependencyManagement>
<dependencies>
+ <!-- Modules -->
<dependency>
<groupId>org.jboss.seam.examples.seampay</groupId>
<artifactId>seampay-ejb</artifactId>
@@ -41,6 +63,83 @@
<artifactId>seampay-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>
+
+ <!-- Common provided dependencies -->
+ <dependency>
+ <groupId>commons-logging</groupId>
+ <artifactId>commons-logging</artifactId>
+ <version>${version.commons.logging}</version>
+ <scope>provided</scope>
+ </dependency>
+
+ <!-- TestNG is not necessary -->
+ <dependency>
+ <groupId>org.jboss.seam</groupId>
+ <artifactId>jboss-seam</artifactId>
+ <version>${project.version}</version>
+ <exclusions>
+ <exclusion>
+ <groupId>org.testng</groupId>
+ <artifactId>testng</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>junit</groupId>
+ <artifactId>junit</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>
+ </systemPropertyVariables>
+ </configuration>
+ </plugin>
+ <plugin>
+ <artifactId>maven-dependency-plugin</artifactId>
+ <version>${version.dependency.plugin}</version>
+ </plugin>
+ <plugin>
+ <artifactId>maven-resources-plugin</artifactId>
+ <version>${version.resources.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/seampay/seampay-ear/pom.xml
===================================================================
--- branches/enterprise/WFK-2_1/examples/seampay/seampay-ear/pom.xml 2013-06-03 17:19:25 UTC (rev 15531)
+++ branches/enterprise/WFK-2_1/examples/seampay/seampay-ear/pom.xml 2013-06-03 17:24:43 UTC (rev 15532)
@@ -60,10 +60,20 @@
<build>
<finalName>seam-seampay</finalName>
+ <pluginManagement>
+ <plugins>
+ <plugin>
+ <groupId>org.jboss.as.plugins</groupId>
+ <artifactId>jboss-as-maven-plugin</artifactId>
+ <version>${version.jboss.maven.plugin}</version>
+ </plugin>
+ </plugins>
+ </pluginManagement>
<plugins>
<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/seampay/seampay-ejb/pom.xml
===================================================================
--- branches/enterprise/WFK-2_1/examples/seampay/seampay-ejb/pom.xml 2013-06-03 17:19:25 UTC (rev 15531)
+++ branches/enterprise/WFK-2_1/examples/seampay/seampay-ejb/pom.xml 2013-06-03 17:24:43 UTC (rev 15532)
@@ -49,6 +49,112 @@
<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-seampay/#{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/seampay/seampay-ejb/src/test/java/org/jboss/seam/example/seampay/test/AccountTest.java
===================================================================
--- branches/enterprise/WFK-2_1/examples/seampay/seampay-ejb/src/test/java/org/jboss/seam/example/seampay/test/AccountTest.java (rev 0)
+++ branches/enterprise/WFK-2_1/examples/seampay/seampay-ejb/src/test/java/org/jboss/seam/example/seampay/test/AccountTest.java 2013-06-03 17:24:43 UTC (rev 15532)
@@ -0,0 +1,131 @@
+package org.jboss.seam.example.seampay.test;
+
+import java.math.BigDecimal;
+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.example.seampay.Account;
+import org.jboss.seam.example.seampay.Payment;
+import org.jboss.seam.example.seampay.Payment.Frequency;
+import org.jboss.seam.mock.JUnitSeamTest;
+import org.jboss.shrinkwrap.api.Archive;
+import org.jboss.shrinkwrap.api.spec.EnterpriseArchive;
+import org.jboss.shrinkwrap.api.spec.WebArchive;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+(a)RunWith(Arquillian.class)
+public class AccountTest
+ extends JUnitSeamTest
+{
+ @Deployment(name="AccountTest")
+ @OverProtocol("Servlet 3.0")
+ public static Archive<?> createDeployment()
+ {
+ return Deployments.seamPayDeployment();
+ }
+
+ @Test
+ public void listAccounts() throws Exception {
+ new FacesRequest("/search.xhtml") {
+
+ @Override
+ @SuppressWarnings("unchecked")
+ protected void renderResponse() throws Exception {
+ List<Account> accounts = (List<Account>) getValue("#{accounts.resultList}");
+
+ assert accounts.size() == 5;
+ // check ASC?
+ }
+ }.run();
+ }
+
+ @Test
+ public void selectAccount() throws Exception {
+ String id = new FacesRequest("/search.xhtml") {
+ @Override
+ protected void renderResponse() throws Exception {
+ assert !((Boolean)getValue("#{accountHome.idDefined}"));
+ }
+ }.run();
+
+ new FacesRequest("/search.xhtml", id) {
+ @Override
+ protected void beforeRequest() {
+ setParameter("accountId", "1");
+ }
+
+ @Override
+ protected void renderResponse() throws Exception {
+ assert ((Boolean)getValue("#{accountHome.idDefined}"));
+
+ Account account = (Account) getValue("#{selectedAccount}");
+ assert account !=null;
+ assert account.getId() == 1;
+ assert account.getPayments().size() == 0;
+
+ Payment payment = (Payment) getValue("#{newPayment}");
+ assert payment.getPayee().equals("Somebody");
+ assert payment.getAccount() != null;
+ assert payment.getAccount().getId() == 1;
+
+ }
+ }.run();
+
+
+ new FacesRequest("/search.xhtml", id) {
+ @Override
+ protected void beforeRequest() {
+ setParameter("accountId", "1");
+ }
+
+ @Override
+ protected void applyRequestValues() throws Exception {
+ setValue("#{newPayment.payee}", "IRS");
+ setValue("#{newPayment.amount}", new BigDecimal("100.00"));
+ setValue("#{newPayment.paymentFrequency}", Frequency.ONCE);
+ }
+
+ @Override
+ protected void invokeApplication() throws Exception {
+ invokeMethod("#{paymentHome.saveAndSchedule}");
+ }
+
+ @Override
+ protected void renderResponse() throws Exception {
+ assert ((Boolean)getValue("#{accountHome.idDefined}"));
+ Account account = (Account) getValue("#{selectedAccount}");
+ assert account !=null;
+ assert account.getId() == 1;
+ assert account.getPayments().size() == 1;
+
+ Payment payment = (Payment) getValue("#{newPayment}");
+ assert payment.getPayee().equals("IRS");
+ assert payment.getAmount().equals(new BigDecimal("100.00"));
+ assert payment.getAccount() != null;
+ assert payment.getAccount().getId() == 1;
+ }
+ }.run();
+
+
+ // test that the payment is around
+ new FacesRequest("/search.xhtml") {
+ @Override
+ protected void beforeRequest() {
+ setParameter("accountId", "1");
+ }
+
+ @Override
+ protected void renderResponse() throws Exception {
+ assert ((Boolean)getValue("#{accountHome.idDefined}"));
+ Account account = (Account) getValue("#{selectedAccount}");
+ assert account !=null;
+ assert account.getId() == 1;
+ assert account.getPayments().size() == 1;
+ }
+ }.run();
+ }
+
+}
Added: branches/enterprise/WFK-2_1/examples/seampay/seampay-ejb/src/test/java/org/jboss/seam/example/seampay/test/Deployments.java
===================================================================
--- branches/enterprise/WFK-2_1/examples/seampay/seampay-ejb/src/test/java/org/jboss/seam/example/seampay/test/Deployments.java (rev 0)
+++ branches/enterprise/WFK-2_1/examples/seampay/seampay-ejb/src/test/java/org/jboss/seam/example/seampay/test/Deployments.java 2013-06-03 17:24:43 UTC (rev 15532)
@@ -0,0 +1,41 @@
+package org.jboss.seam.example.seampay.test;
+
+import org.jboss.shrinkwrap.api.ShrinkWrap;
+import org.jboss.shrinkwrap.api.importer.ZipImporter;
+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 seamPayDeployment() {
+ File[] libs = Maven.resolver().loadPomFromFile("pom.xml")
+ .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();
+
+ WebArchive war = ShrinkWrap.create(WebArchive.class, "seam-seampay.war")
+ .addPackages(true, "org.jboss.seam.example.seampay")
+
+ // already in EJB module
+ .addAsResource("import.sql", "import.sql")
+ .addAsResource("seam.properties", "seam.properties")
+ .addAsResource("META-INF/persistence.xml", "META-INF/persistence.xml")
+
+ .addAsWebInfResource("META-INF/ejb-jar.xml", "ejb-jar.xml")
+
+ // manually copied from Web module
+ .addAsWebInfResource("pages.xml", "pages.xml")
+
+ // manually copied from Web module, modified
+ .addAsWebInfResource("web.xml", "web.xml") // only contains MockSeamListener definition
+ .addAsWebInfResource("components.xml", "components.xml") // corrected ejb component jndi-name references from java:app/jboss-seam to java:app/seam-seampay
+
+ // manually copied from EAR module
+ .addAsWebInfResource("jboss-deployment-structure.xml", "jboss-deployment-structure.xml")
+ .addAsLibraries(libs);
+
+ return war;
+ }
+}
Added: branches/enterprise/WFK-2_1/examples/seampay/seampay-ejb/src/test/java/org/jboss/seam/example/seampay/test/PaymentProcessorTest.java
===================================================================
--- branches/enterprise/WFK-2_1/examples/seampay/seampay-ejb/src/test/java/org/jboss/seam/example/seampay/test/PaymentProcessorTest.java (rev 0)
+++ branches/enterprise/WFK-2_1/examples/seampay/seampay-ejb/src/test/java/org/jboss/seam/example/seampay/test/PaymentProcessorTest.java 2013-06-03 17:24:43 UTC (rev 15532)
@@ -0,0 +1,112 @@
+package org.jboss.seam.example.seampay.test;
+
+import java.math.BigDecimal;
+import java.util.Date;
+import org.jboss.arquillian.container.test.api.Deployment;
+import org.jboss.arquillian.container.test.api.OverProtocol;
+import org.jboss.arquillian.junit.Arquillian;
+
+import org.jboss.seam.example.seampay.Account;
+import org.jboss.seam.example.seampay.Payment;
+import org.jboss.seam.example.seampay.PaymentProcessor;
+import org.jboss.seam.example.seampay.Payment.Frequency;
+import org.jboss.seam.mock.JUnitSeamTest;
+import org.jboss.shrinkwrap.api.Archive;
+import org.jboss.shrinkwrap.api.spec.EnterpriseArchive;
+import org.jboss.shrinkwrap.api.spec.WebArchive;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+(a)RunWith(Arquillian.class)
+public class PaymentProcessorTest
+ extends JUnitSeamTest
+{
+ static final String ACCOUNT_NUMBER = "X12345";
+ static final BigDecimal INITIAL_BALANCE = new BigDecimal("1000");
+
+ @Deployment(name="PaymentProcessorTest")
+ @OverProtocol("Servlet 3.0")
+ public static Archive<?> createDeployment()
+ {
+ return Deployments.seamPayDeployment();
+ }
+
+ @Test
+ public void testInactive() {
+ PaymentProcessor processor = new PaymentProcessor();
+
+ Payment payment = createTestPayment(new BigDecimal("100"), Frequency.ONCE);
+ payment.setActive(false);
+
+ assert payment.getAccount().getBalance().equals(INITIAL_BALANCE);
+
+ processor.processPayment(payment);
+
+ assert payment.getAccount().getBalance().equals(INITIAL_BALANCE);
+ assert payment.getLastPaid() == null;
+ }
+
+ @Test
+ public void testPayOnce() {
+ PaymentProcessor processor = new PaymentProcessor();
+
+ Payment payment = createTestPayment(new BigDecimal("100"), Frequency.ONCE);
+
+ assert payment.getAccount().getBalance().equals(INITIAL_BALANCE);
+
+ processor.processPayment(payment);
+
+ assert payment.getAccount().getBalance().equals(new BigDecimal("900"));
+ assert !payment.getActive();
+ assert payment.getLastPaid() != null;
+ }
+
+ @Test
+ public void testPayMultiple() {
+ PaymentProcessor processor = new PaymentProcessor();
+
+ Payment payment = createTestPayment(new BigDecimal("100"), Frequency.WEEKLY);
+
+ assert payment.getAccount().getBalance().equals(INITIAL_BALANCE);
+
+ processor.processPayment(payment);
+
+ assert payment.getAccount().getBalance().equals(new BigDecimal("900"));
+ assert payment.getActive();
+ assert payment.getLastPaid() != null;
+
+ Date firstPayment = payment.getLastPaid();
+
+ pause(); // just need to make sure we are some small time in the future
+
+ processor.processPayment(payment);
+
+ assert payment.getAccount().getBalance().equals(new BigDecimal("800"));
+ assert payment.getActive();
+ assert payment.getLastPaid().after(firstPayment);
+ }
+
+
+ private void pause() {
+ try {
+ Thread.sleep(1);
+ } catch (InterruptedException e) {
+
+ }
+ }
+
+ protected Payment createTestPayment(BigDecimal amount, Frequency frequency) {
+ Account account = new Account();
+ account.setAccountNumber(ACCOUNT_NUMBER);
+ setField(account, "balance", INITIAL_BALANCE);
+
+ Payment payment = new Payment();
+ payment.setAccount(account);
+ payment.setAmount(amount);
+ payment.setPaymentFrequency(frequency);
+
+ return payment;
+ }
+
+
+}
Added: branches/enterprise/WFK-2_1/examples/seampay/seampay-ejb/src/test/resources/arquillian.xml
===================================================================
(Binary files differ)
Property changes on: branches/enterprise/WFK-2_1/examples/seampay/seampay-ejb/src/test/resources/arquillian.xml
___________________________________________________________________
Added: svn:mime-type
+ application/xml
Added: branches/enterprise/WFK-2_1/examples/seampay/seampay-ejb/src/test/resources/components.xml
===================================================================
--- branches/enterprise/WFK-2_1/examples/seampay/seampay-ejb/src/test/resources/components.xml (rev 0)
+++ branches/enterprise/WFK-2_1/examples/seampay/seampay-ejb/src/test/resources/components.xml 2013-06-03 17:24:43 UTC (rev 15532)
@@ -0,0 +1,46 @@
+<components xmlns:pay="http://jboss.org/schema/seam/examples/seampay"
+ xmlns:core="http://jboss.org/schema/seam/core"
+ xmlns:persistence="http://jboss.org/schema/seam/persistence"
+ xmlns:framework="http://jboss.org/schema/seam/framework"
+ xmlns:async="http://jboss.org/schema/seam/async"
+ 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/persistence http://jboss.org/schema/seam/persistence-2.3.xsd
+ http://jboss.org/schema/seam/async http://jboss.org/schema/seam/async-2.3.xsd
+ http://jboss.org/schema/seam/framework http://jboss.org/schema/seam/framework-2.3.xsd" >
+
+ <pay:payment-home
+ new-instance="#{newPayment}"
+ created-message="Created a new payment to #{newPayment.payee}" />
+
+
+ <pay:payment name="newPayment"
+ payee="Somebody"
+ account="#{selectedAccount}"
+ payment-date="#{currentDatetime}"
+ created-date="#{currentDatetime}" />
+
+ <factory name="selectedAccount"
+ value="#{accountHome.instance}"/>
+
+ <framework:entity-home name="accountHome"
+ entity-class="org.jboss.seam.example.seampay.Account"
+ entity-manager="#{entityManager}" />
+
+ <framework:entity-query name="accounts"
+ ejbql="from Account"
+ order="accountNumber"
+ max-results="20"
+ entity-manager="#{entityManager}" />
+
+ <persistence:managed-persistence-context name="entityManager"
+ auto-create="true"
+ persistence-unit-jndi-name="java:/seampayEntityManagerFactory" />
+
+ <async:timer-service-dispatcher />
+ <component class="org.jboss.seam.async.ThreadPoolDispatcher" precedence="40" />
+
+ <core:init debug="true" jndi-pattern="${jndiPattern}" />
+
+</components>
Added: branches/enterprise/WFK-2_1/examples/seampay/seampay-ejb/src/test/resources/jboss-deployment-structure.xml
===================================================================
--- branches/enterprise/WFK-2_1/examples/seampay/seampay-ejb/src/test/resources/jboss-deployment-structure.xml (rev 0)
+++ branches/enterprise/WFK-2_1/examples/seampay/seampay-ejb/src/test/resources/jboss-deployment-structure.xml 2013-06-03 17:24:43 UTC (rev 15532)
@@ -0,0 +1,9 @@
+<jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.0">
+ <deployment>
+ <dependencies>
+ <module name="org.dom4j" 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/seampay/seampay-ejb/src/test/resources/pages.xml
===================================================================
(Binary files differ)
Property changes on: branches/enterprise/WFK-2_1/examples/seampay/seampay-ejb/src/test/resources/pages.xml
___________________________________________________________________
Added: svn:mime-type
+ application/xml
Added: branches/enterprise/WFK-2_1/examples/seampay/seampay-ejb/src/test/resources/web.xml
===================================================================
(Binary files differ)
Property changes on: branches/enterprise/WFK-2_1/examples/seampay/seampay-ejb/src/test/resources/web.xml
___________________________________________________________________
Added: svn:mime-type
+ application/xml
Modified: branches/enterprise/WFK-2_1/examples/seampay/seampay-web/pom.xml
===================================================================
--- branches/enterprise/WFK-2_1/examples/seampay/seampay-web/pom.xml 2013-06-03 17:19:25 UTC (rev 15531)
+++ branches/enterprise/WFK-2_1/examples/seampay/seampay-web/pom.xml 2013-06-03 17:24:43 UTC (rev 15532)
@@ -70,6 +70,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
+ <version>${version.war.plugin}</version>
<configuration>
<webResources>
<resource>
11 years, 5 months
Seam SVN: r15531 - in branches/enterprise/WFK-2_1/examples/seamdiscs: seamdiscs-ear and 18 other directories.
by seam-commits@lists.jboss.org
Author: maschmid
Date: 2013-06-03 13:19:25 -0400 (Mon, 03 Jun 2013)
New Revision: 15531
Added:
branches/enterprise/WFK-2_1/examples/seamdiscs/seamdiscs-ejb/src/test/
branches/enterprise/WFK-2_1/examples/seamdiscs/seamdiscs-ejb/src/test/java/
branches/enterprise/WFK-2_1/examples/seamdiscs/seamdiscs-ejb/src/test/java/org/
branches/enterprise/WFK-2_1/examples/seamdiscs/seamdiscs-ejb/src/test/java/org/jboss/
branches/enterprise/WFK-2_1/examples/seamdiscs/seamdiscs-ejb/src/test/java/org/jboss/seam/
branches/enterprise/WFK-2_1/examples/seamdiscs/seamdiscs-ejb/src/test/java/org/jboss/seam/example/
branches/enterprise/WFK-2_1/examples/seamdiscs/seamdiscs-ejb/src/test/java/org/jboss/seam/example/seamdiscs/
branches/enterprise/WFK-2_1/examples/seamdiscs/seamdiscs-ejb/src/test/java/org/jboss/seam/example/seamdiscs/test/
branches/enterprise/WFK-2_1/examples/seamdiscs/seamdiscs-ejb/src/test/java/org/jboss/seam/example/seamdiscs/test/Deployments.java
branches/enterprise/WFK-2_1/examples/seamdiscs/seamdiscs-ejb/src/test/java/org/jboss/seam/example/seamdiscs/test/DisplayArtistTest.java
branches/enterprise/WFK-2_1/examples/seamdiscs/seamdiscs-ejb/src/test/java/org/jboss/seam/example/seamdiscs/test/DisplayDiscTest.java
branches/enterprise/WFK-2_1/examples/seamdiscs/seamdiscs-ejb/src/test/java/org/jboss/seam/example/seamdiscs/test/EditArtistTest.java
branches/enterprise/WFK-2_1/examples/seamdiscs/seamdiscs-ejb/src/test/java/org/jboss/seam/example/seamdiscs/test/EditDiscTest.java
branches/enterprise/WFK-2_1/examples/seamdiscs/seamdiscs-ejb/src/test/java/org/jboss/seam/example/seamdiscs/test/LoginTest.java
branches/enterprise/WFK-2_1/examples/seamdiscs/seamdiscs-ejb/src/test/java/org/jboss/seam/example/seamdiscs/test/TestStrings.java
branches/enterprise/WFK-2_1/examples/seamdiscs/seamdiscs-ejb/src/test/resources/
branches/enterprise/WFK-2_1/examples/seamdiscs/seamdiscs-ejb/src/test/resources/arquillian.xml
branches/enterprise/WFK-2_1/examples/seamdiscs/seamdiscs-ejb/src/test/resources/artist.page.xml
branches/enterprise/WFK-2_1/examples/seamdiscs/seamdiscs-ejb/src/test/resources/artists.page.xml
branches/enterprise/WFK-2_1/examples/seamdiscs/seamdiscs-ejb/src/test/resources/components.xml
branches/enterprise/WFK-2_1/examples/seamdiscs/seamdiscs-ejb/src/test/resources/disc.page.xml
branches/enterprise/WFK-2_1/examples/seamdiscs/seamdiscs-ejb/src/test/resources/discs.page.xml
branches/enterprise/WFK-2_1/examples/seamdiscs/seamdiscs-ejb/src/test/resources/jboss-deployment-structure.xml
branches/enterprise/WFK-2_1/examples/seamdiscs/seamdiscs-ejb/src/test/resources/login.page.xml
branches/enterprise/WFK-2_1/examples/seamdiscs/seamdiscs-ejb/src/test/resources/org/
branches/enterprise/WFK-2_1/examples/seamdiscs/seamdiscs-ejb/src/test/resources/org/jboss/
branches/enterprise/WFK-2_1/examples/seamdiscs/seamdiscs-ejb/src/test/resources/org/jboss/seam/
branches/enterprise/WFK-2_1/examples/seamdiscs/seamdiscs-ejb/src/test/resources/org/jboss/seam/example/
branches/enterprise/WFK-2_1/examples/seamdiscs/seamdiscs-ejb/src/test/resources/org/jboss/seam/example/seamdiscs/
branches/enterprise/WFK-2_1/examples/seamdiscs/seamdiscs-ejb/src/test/resources/org/jboss/seam/example/seamdiscs/test/
branches/enterprise/WFK-2_1/examples/seamdiscs/seamdiscs-ejb/src/test/resources/org/jboss/seam/example/seamdiscs/test/BaseData.xml
branches/enterprise/WFK-2_1/examples/seamdiscs/seamdiscs-ejb/src/test/resources/pages.xml
branches/enterprise/WFK-2_1/examples/seamdiscs/seamdiscs-ejb/src/test/resources/persistence.xml
branches/enterprise/WFK-2_1/examples/seamdiscs/seamdiscs-ejb/src/test/resources/web.xml
Removed:
branches/enterprise/WFK-2_1/examples/seamdiscs/seamdiscs-tests/
Modified:
branches/enterprise/WFK-2_1/examples/seamdiscs/pom.xml
branches/enterprise/WFK-2_1/examples/seamdiscs/seamdiscs-ear/pom.xml
branches/enterprise/WFK-2_1/examples/seamdiscs/seamdiscs-ejb/pom.xml
branches/enterprise/WFK-2_1/examples/seamdiscs/seamdiscs-web/pom.xml
Log:
migrated seamdiscs
Modified: branches/enterprise/WFK-2_1/examples/seamdiscs/pom.xml
===================================================================
--- branches/enterprise/WFK-2_1/examples/seamdiscs/pom.xml 2013-06-03 17:07:17 UTC (rev 15530)
+++ branches/enterprise/WFK-2_1/examples/seamdiscs/pom.xml 2013-06-03 17:19:25 UTC (rev 15531)
@@ -3,27 +3,49 @@
<modelVersion>4.0.0</modelVersion>
<groupId>org.jboss.seam.examples</groupId>
<artifactId>seamdiscs</artifactId>
- <parent>
- <groupId>org.jboss.seam</groupId>
- <artifactId>examples</artifactId>
- <version>2.3.1.Final-redhat-2</version>
- </parent>
+ <version>2.3.1.Final-redhat-2</version>
+
<packaging>pom</packaging>
<name>Seamdiscs Example</name>
<properties>
<example.name>seamdiscs</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 with ShrinkWrap Resolver, uncomment
+ and customize the following property. -->
+ <!--<maven.user.settings>/path/to/custom/settings.xml</maven.user.settings>-->
+
+ <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.resources.plugin>2.6</version.resources.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.ejb.plugin>2.3</version.ejb.plugin>
+ <version.jboss.maven.plugin>7.4.Final</version.jboss.maven.plugin>
</properties>
<modules>
<module>seamdiscs-ear</module>
<module>seamdiscs-ejb</module>
<module>seamdiscs-web</module>
- <module>seamdiscs-tests</module>
+
</modules>
<dependencyManagement>
<dependencies>
+ <!-- Modules -->
<dependency>
<groupId>org.jboss.seam.examples.seamdiscs</groupId>
<artifactId>seamdiscs-ejb</artifactId>
@@ -41,6 +63,94 @@
<artifactId>seamdiscs-ear</artifactId>
<version>${project.version}</version>
</dependency>
+
+ <dependency>
+ <groupId>org.apache.myfaces.trinidad</groupId>
+ <artifactId>trinidad-api</artifactId>
+ <version>2.0.1</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.myfaces.trinidad</groupId>
+ <artifactId>trinidad-impl</artifactId>
+ <version>2.0.1</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>
+
+ <!-- Common provided dependencies -->
+ <dependency>
+ <groupId>commons-logging</groupId>
+ <artifactId>commons-logging</artifactId>
+ <version>${version.commons.logging}</version>
+ <scope>provided</scope>
+ </dependency>
+
+ <!-- TestNG is not necessary -->
+ <dependency>
+ <groupId>org.jboss.seam</groupId>
+ <artifactId>jboss-seam</artifactId>
+ <version>${project.version}</version>
+ <exclusions>
+ <exclusion>
+ <groupId>org.testng</groupId>
+ <artifactId>testng</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>junit</groupId>
+ <artifactId>junit</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>
+ </systemPropertyVariables>
+ </configuration>
+ </plugin>
+ <plugin>
+ <artifactId>maven-dependency-plugin</artifactId>
+ <version>${version.dependency.plugin}</version>
+ </plugin>
+ <plugin>
+ <artifactId>maven-resources-plugin</artifactId>
+ <version>${version.resources.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/seamdiscs/seamdiscs-ear/pom.xml
===================================================================
--- branches/enterprise/WFK-2_1/examples/seamdiscs/seamdiscs-ear/pom.xml 2013-06-03 17:07:17 UTC (rev 15530)
+++ branches/enterprise/WFK-2_1/examples/seamdiscs/seamdiscs-ear/pom.xml 2013-06-03 17:19:25 UTC (rev 15531)
@@ -48,10 +48,20 @@
<build>
<finalName>seam-seamdiscs</finalName>
+ <pluginManagement>
+ <plugins>
+ <plugin>
+ <groupId>org.jboss.as.plugins</groupId>
+ <artifactId>jboss-as-maven-plugin</artifactId>
+ <version>${version.jboss.maven.plugin}</version>
+ </plugin>
+ </plugins>
+ </pluginManagement>
<plugins>
<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/seamdiscs/seamdiscs-ejb/pom.xml
===================================================================
--- branches/enterprise/WFK-2_1/examples/seamdiscs/seamdiscs-ejb/pom.xml 2013-06-03 17:07:17 UTC (rev 15530)
+++ branches/enterprise/WFK-2_1/examples/seamdiscs/seamdiscs-ejb/pom.xml 2013-06-03 17:19:25 UTC (rev 15531)
@@ -49,6 +49,117 @@
<groupId>org.apache.myfaces.trinidad</groupId>
<artifactId>trinidad-api</artifactId>
</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.dbunit</groupId>
+ <artifactId>dbunit</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-seamdiscs/#{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/seamdiscs/seamdiscs-ejb/src/test/java/org/jboss/seam/example/seamdiscs/test/Deployments.java
===================================================================
--- branches/enterprise/WFK-2_1/examples/seamdiscs/seamdiscs-ejb/src/test/java/org/jboss/seam/example/seamdiscs/test/Deployments.java (rev 0)
+++ branches/enterprise/WFK-2_1/examples/seamdiscs/seamdiscs-ejb/src/test/java/org/jboss/seam/example/seamdiscs/test/Deployments.java 2013-06-03 17:19:25 UTC (rev 15531)
@@ -0,0 +1,81 @@
+package org.jboss.seam.example.seamdiscs.test;
+
+import org.jboss.shrinkwrap.api.ShrinkWrap;
+import org.jboss.shrinkwrap.api.spec.JavaArchive;
+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 seamdiscsDeployment() {
+ File[] libs = Maven.resolver().loadPomFromFile("pom.xml")
+ .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();
+
+ File[] dbunitLibs = Maven.resolver().loadPomFromFile("pom.xml")
+ .resolve("org.dbunit:dbunit:jar:2.2")
+ .withoutTransitivity().asFile();
+
+ WebArchive war = ShrinkWrap.create(WebArchive.class, "seam-seamdiscs.war")
+ .addPackages(true, "org.jboss.seam.example.seamdiscs")
+ .addPackages(true, "org.jboss.seam.trinidad")
+ .addClasses(TestStrings.class)
+
+ // already in EJB module
+ .addAsResource("import.sql", "import.sql")
+ .addAsResource("seam.properties", "seam.properties")
+ .addAsWebInfResource("META-INF/ejb-jar.xml", "ejb-jar.xml")
+
+ // test specific persistence.xml
+ .addAsResource("persistence.xml", "META-INF/persistence.xml")
+
+ // manually copied from Web module
+ .addAsWebInfResource("pages.xml", "pages.xml")
+ .addAsWebResource("login.page.xml", "login.page.xml")
+ .addAsWebResource("artist.page.xml", "artist.page.xml")
+ .addAsWebResource("artists.page.xml", "artists.page.xml")
+ .addAsWebResource("disc.page.xml", "disc.page.xml")
+ .addAsWebResource("discs.page.xml", "discs.page.xml")
+
+ // manually copied from Web module, modified
+ .addAsWebInfResource("web.xml", "web.xml") // only contains MockSeamListener definition
+ .addAsWebInfResource("components.xml", "components.xml") // corrected ejb component jndi-name references from java:app/jboss-seam to java:app/seam-restbay
+
+ // manually copied from EAR module
+ .addAsWebInfResource("jboss-deployment-structure.xml", "jboss-deployment-structure.xml")
+
+ //
+ .addAsResource("org/jboss/seam/example/seamdiscs/test/BaseData.xml", "org/jboss/seam/example/seamdiscs/test/BaseData.xml")
+
+ .addAsLibraries(libs)
+ .addAsLibraries(dbunitLibs);
+
+ return war;
+
+/*
+ EnterpriseArchive ear = ShrinkWrap.create(ZipImporter.class, "seam-seamdiscs.ear").importFrom(new File("../seamdiscs-ear/target/seam-seamdiscs.ear"))
+ .as(EnterpriseArchive.class);
+
+ // Install org.jboss.seam.mock.MockSeamListener
+ WebArchive web = ear.getAsType(WebArchive.class, "seamdiscs-web.war");
+ web.delete("/WEB-INF/web.xml");
+ web.addAsWebInfResource("web.xml");
+
+ web.delete("/WEB-INF/faces-config.xml");
+
+ web.addAsResource("org/jboss/seam/example/seamdiscs/test/BaseData.xml", "org/jboss/seam/example/seamdiscs/test/BaseData.xml");
+
+ JavaArchive ejb = ear.getAsType(JavaArchive.class, "seamdiscs-ejb.jar");
+ ejb.addClasses(TestStrings.class);
+
+ ear.addAsLibraries(DependencyResolvers.use(MavenDependencyResolver.class)
+ .configureFrom("pom.xml")
+ .artifact("org.dbunit:dbunit:jar:2.2")
+ .resolveAsFiles());
+
+ return ear;*/
+ }
+}
Added: branches/enterprise/WFK-2_1/examples/seamdiscs/seamdiscs-ejb/src/test/java/org/jboss/seam/example/seamdiscs/test/DisplayArtistTest.java
===================================================================
--- branches/enterprise/WFK-2_1/examples/seamdiscs/seamdiscs-ejb/src/test/java/org/jboss/seam/example/seamdiscs/test/DisplayArtistTest.java (rev 0)
+++ branches/enterprise/WFK-2_1/examples/seamdiscs/seamdiscs-ejb/src/test/java/org/jboss/seam/example/seamdiscs/test/DisplayArtistTest.java 2013-06-03 17:19:25 UTC (rev 15531)
@@ -0,0 +1,202 @@
+package org.jboss.seam.example.seamdiscs.test;
+
+import static org.jboss.seam.example.seamdiscs.test.TestStrings.ARTIST1_NAME;
+import static org.jboss.seam.example.seamdiscs.test.TestStrings.ARTIST2_NAME;
+import static org.jboss.seam.example.seamdiscs.test.TestStrings.ARTIST3_NAME;
+import static org.jboss.seam.example.seamdiscs.test.TestStrings.ARTIST4_NAME;
+import static org.jboss.seam.example.seamdiscs.test.TestStrings.ARTIST5_NAME;
+import static org.jboss.seam.example.seamdiscs.test.TestStrings.ARTIST6_NAME;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.faces.model.DataModel;
+
+import org.apache.myfaces.trinidad.model.CollectionModel;
+import org.apache.myfaces.trinidad.model.SortCriterion;
+import org.jboss.arquillian.container.test.api.Deployment;
+import org.jboss.arquillian.container.test.api.OverProtocol;
+import org.jboss.arquillian.junit.Arquillian;
+import org.jboss.seam.example.seamdiscs.model.Artist;
+import org.jboss.seam.example.seamdiscs.model.Band;
+import org.jboss.seam.mock.DBJUnitSeamTest;
+import org.jboss.shrinkwrap.api.Archive;
+import org.jboss.shrinkwrap.api.spec.EnterpriseArchive;
+import org.jboss.shrinkwrap.api.spec.WebArchive;
+import org.junit.runner.RunWith;
+import org.junit.Test;
+
+(a)RunWith(Arquillian.class)
+public class DisplayArtistTest extends DBJUnitSeamTest
+{
+ @Deployment(name="DisplayArtistTest")
+ @OverProtocol("Servlet 3.0")
+ public static Archive<?> createDeployment()
+ {
+ return Deployments.seamdiscsDeployment();
+ }
+
+ @Override
+ protected void prepareDBUnitOperations() {
+
+ setDatabase("HSQL");
+ setDatasourceJndiName("java:/jboss/datasources/ExampleDS");
+
+ beforeTestOperations.add(
+ new DataSetOperation("org/jboss/seam/example/seamdiscs/test/BaseData.xml")
+ );
+ }
+
+ @Test
+ public void testDisplayArtists() throws Exception
+ {
+ new NonFacesRequest("/artists.xhtml")
+ {
+
+ @Override
+ protected void renderResponse() throws Exception
+ {
+ Object artists = getValue("#{artists.dataModel}");
+ assert artists instanceof DataModel;
+ DataModel artistsDataModel = (DataModel) artists;
+
+ // Check for the correct number of results
+ assert artistsDataModel.getRowCount() == 6;
+
+ // Check for correct ordering
+ assertArtist(artistsDataModel, 0, ARTIST5_NAME);
+ assertArtist(artistsDataModel, 1, ARTIST6_NAME);
+ assertArtist(artistsDataModel, 2, ARTIST1_NAME);
+ assertArtist(artistsDataModel, 3, ARTIST4_NAME);
+ assertArtist(artistsDataModel, 4, ARTIST2_NAME);
+ assertArtist(artistsDataModel, 5, ARTIST3_NAME);
+ }
+
+ }.run();
+ }
+
+ @Test
+ public void testFilterArtists() throws Exception
+ {
+ new FacesRequest("/artists.xhtml")
+ {
+
+ @Override
+ protected void updateModelValues() throws Exception
+ {
+ setValue("#{exampleArtist.name}", "r");
+ }
+
+ @Override
+ protected void renderResponse() throws Exception
+ {
+ Object artists = getValue("#{artists.dataModel}");
+ assert artists instanceof DataModel;
+ DataModel artistsDataModel = (DataModel) artists;
+
+ // Check for the correct number of results
+ assert artistsDataModel.getRowCount() == 2;
+
+ // Check for correct ordering
+ assertArtist(artistsDataModel, 0, ARTIST5_NAME);
+ assertArtist(artistsDataModel, 1, ARTIST6_NAME);
+ }
+
+ }.run();
+
+ new FacesRequest("/artists.xhtml")
+ {
+
+ @Override
+ protected void updateModelValues() throws Exception
+ {
+ setValue("#{exampleArtist.name}", "Ri");
+ }
+
+ @Override
+ protected void renderResponse() throws Exception
+ {
+ Object artists = getValue("#{artists.dataModel}");
+ assert artists instanceof DataModel;
+ DataModel artistsDataModel = (DataModel) artists;
+
+ // Check for the correct number of results
+ assert artistsDataModel.getRowCount() == 1;
+
+ // Check for correct ordering
+ assertArtist(artistsDataModel, 0, ARTIST6_NAME);
+ }
+
+ }.run();
+ }
+
+ @Test
+ public void testSeamCollectionModel() throws Exception
+ {
+ new NonFacesRequest("/artists.xhtml")
+ {
+
+ @Override
+ protected void renderResponse() throws Exception
+ {
+ Object artists = getValue("#{artists.dataModel}");
+
+ assert artists instanceof CollectionModel;
+ CollectionModel collectionModel = (CollectionModel) artists;
+
+ // Reorder the list
+ List<SortCriterion> criteria = new ArrayList<SortCriterion>();
+ criteria.add(new SortCriterion("artist.name", true));
+ collectionModel.setSortCriteria(criteria);
+
+ // Check for correct ordering
+ assertArtist(collectionModel, 5, ARTIST5_NAME);
+ assertArtist(collectionModel, 4, ARTIST6_NAME);
+ assertArtist(collectionModel, 3, ARTIST1_NAME);
+ assertArtist(collectionModel, 2, ARTIST4_NAME);
+ assertArtist(collectionModel, 1, ARTIST2_NAME);
+ assertArtist(collectionModel, 0, ARTIST3_NAME);
+ }
+
+ }.run();
+ }
+
+ @Test
+ public void testDisplayArtist() throws Exception
+ {
+ // TODO Test navigation, but need a MockNavigationHandler
+ new NonFacesRequest("/artists.xhtml")
+ {
+ @Override
+ protected void beforeRequest()
+ {
+ setParameter("actionOutcome", "artist");
+ setParameter("artistId", "1");
+ }
+
+ @Override
+ protected void renderResponse() throws Exception
+ {
+ assert ((Integer) 1).equals(getValue("#{artistHome.id}"));
+ Object object = null;
+ object = getValue("#{artist}");
+ assert object instanceof Band;
+ Band artist1 = (Band) object;
+ assert ARTIST1_NAME.equals(artist1.getName());
+ assert artist1.getBandMembers().size() == 3;
+ }
+ }.run();
+ }
+
+
+
+ private void assertArtist(DataModel dataModel, int row, String name)
+ {
+ dataModel.setRowIndex(row);
+ Object rowData = dataModel.getRowData();
+ assert rowData instanceof Artist;
+ Artist artist = (Artist) rowData;
+ assert name.equals(artist.getName());
+ }
+
+}
Added: branches/enterprise/WFK-2_1/examples/seamdiscs/seamdiscs-ejb/src/test/java/org/jboss/seam/example/seamdiscs/test/DisplayDiscTest.java
===================================================================
--- branches/enterprise/WFK-2_1/examples/seamdiscs/seamdiscs-ejb/src/test/java/org/jboss/seam/example/seamdiscs/test/DisplayDiscTest.java (rev 0)
+++ branches/enterprise/WFK-2_1/examples/seamdiscs/seamdiscs-ejb/src/test/java/org/jboss/seam/example/seamdiscs/test/DisplayDiscTest.java 2013-06-03 17:19:25 UTC (rev 15531)
@@ -0,0 +1,115 @@
+package org.jboss.seam.example.seamdiscs.test;
+
+import static org.jboss.seam.example.seamdiscs.test.TestStrings.DISC1_ARTIST;
+import static org.jboss.seam.example.seamdiscs.test.TestStrings.DISC1_NAME;
+import static org.jboss.seam.example.seamdiscs.test.TestStrings.DISC2_ARTIST;
+import static org.jboss.seam.example.seamdiscs.test.TestStrings.DISC2_NAME;
+import static org.jboss.seam.example.seamdiscs.test.TestStrings.DISC3_ARTIST;
+import static org.jboss.seam.example.seamdiscs.test.TestStrings.DISC3_NAME;
+import static org.jboss.seam.example.seamdiscs.test.TestStrings.DISC4_ARTIST;
+import static org.jboss.seam.example.seamdiscs.test.TestStrings.DISC4_NAME;
+import static org.jboss.seam.example.seamdiscs.test.TestStrings.DISC5_ARTIST;
+import static org.jboss.seam.example.seamdiscs.test.TestStrings.DISC5_NAME;
+import static org.jboss.seam.example.seamdiscs.test.TestStrings.DISC6_ARTIST;
+import static org.jboss.seam.example.seamdiscs.test.TestStrings.DISC6_NAME;
+
+import javax.faces.model.DataModel;
+
+import org.jboss.arquillian.container.test.api.Deployment;
+import org.jboss.arquillian.container.test.api.OverProtocol;
+import org.jboss.arquillian.junit.Arquillian;
+import org.jboss.seam.example.seamdiscs.model.Disc;
+import org.jboss.seam.mock.DBJUnitSeamTest;
+import org.jboss.shrinkwrap.api.Archive;
+import org.jboss.shrinkwrap.api.spec.EnterpriseArchive;
+import org.jboss.shrinkwrap.api.spec.WebArchive;
+import org.junit.runner.RunWith;
+import org.junit.Test;
+
+(a)RunWith(Arquillian.class)
+public class DisplayDiscTest extends DBJUnitSeamTest
+{
+ @Deployment(name="DisplayDiscTest")
+ @OverProtocol("Servlet 3.0")
+ public static Archive<?> createDeployment()
+ {
+ return Deployments.seamdiscsDeployment();
+ }
+
+ @Override
+ protected void prepareDBUnitOperations() {
+ setDatabase("HSQL");
+ setDatasourceJndiName("java:/jboss/datasources/ExampleDS");
+
+ beforeTestOperations.add(
+ new DataSetOperation("org/jboss/seam/example/seamdiscs/test/BaseData.xml")
+ );
+ }
+
+ @Test
+ public void testDisplayDiscs() throws Exception
+ {
+ new FacesRequest("/discs.xhtml")
+ {
+
+ @Override
+ protected void renderResponse() throws Exception
+ {
+ Object discs = getValue("#{discs.dataModel}");
+ assert discs instanceof DataModel;
+ DataModel dataModel = (DataModel) discs;
+
+ // Check for the correct number of results
+ assert dataModel.getRowCount() == 6;
+
+ // Check for correct ordering
+ assertDisc(dataModel, 0, DISC5_NAME, DISC5_ARTIST);
+ assertDisc(dataModel, 1, DISC6_NAME, DISC6_ARTIST);
+ assertDisc(dataModel, 2, DISC1_NAME, DISC1_ARTIST);
+ assertDisc(dataModel, 3, DISC2_NAME, DISC2_ARTIST);
+ assertDisc(dataModel, 4, DISC4_NAME, DISC4_ARTIST);
+ assertDisc(dataModel, 5, DISC3_NAME, DISC3_ARTIST);
+ }
+
+ }.run();
+ }
+
+ @Test
+ public void testDisplayDisc() throws Exception
+ {
+ // TODO Test navigation, but need a MockNavigationHandler
+ new NonFacesRequest("/discs.xhtml")
+ {
+ @Override
+ protected void beforeRequest()
+ {
+ setParameter("actionOutcome", "disc");
+ setParameter("discId", "3");
+ }
+
+ @Override
+ protected void renderResponse() throws Exception
+ {
+ assert ((Integer) 3).equals(getValue("#{discHome.id}"));
+ Object object = null;
+ object = getValue("#{disc}");
+ assert object instanceof Disc;
+ Disc disc1 = (Disc) object;
+ assert DISC3_NAME.equals(disc1.getName());
+ }
+ }.run();
+ }
+
+
+
+ private void assertDisc(DataModel dataModel, int row, String discName, String artistName)
+ {
+ dataModel.setRowIndex(row);
+ Object rowData = dataModel.getRowData();
+ assert rowData instanceof Disc;
+ Disc disc = (Disc) rowData;
+ assert discName.equals(disc.getName());
+ assert artistName.equals(disc.getArtist().getName());
+ }
+
+}
Added: branches/enterprise/WFK-2_1/examples/seamdiscs/seamdiscs-ejb/src/test/java/org/jboss/seam/example/seamdiscs/test/EditArtistTest.java
===================================================================
--- branches/enterprise/WFK-2_1/examples/seamdiscs/seamdiscs-ejb/src/test/java/org/jboss/seam/example/seamdiscs/test/EditArtistTest.java (rev 0)
+++ branches/enterprise/WFK-2_1/examples/seamdiscs/seamdiscs-ejb/src/test/java/org/jboss/seam/example/seamdiscs/test/EditArtistTest.java 2013-06-03 17:19:25 UTC (rev 15531)
@@ -0,0 +1,356 @@
+/**
+ *
+ */
+package org.jboss.seam.example.seamdiscs.test;
+
+import static org.jboss.seam.example.seamdiscs.test.TestStrings.ARTIST1_NAME;
+import static org.jboss.seam.example.seamdiscs.test.TestStrings.ARTIST4_NAME;
+import static org.jboss.seam.example.seamdiscs.test.TestStrings.ARTIST_NEW_DESCRIPTION;
+import static org.jboss.seam.example.seamdiscs.test.TestStrings.BANDMEMBER3_VALUE;
+import static org.jboss.seam.example.seamdiscs.test.TestStrings.NEW_ARTIST_NAME;
+import static org.jboss.seam.example.seamdiscs.test.TestStrings.NEW_BANDMEMBER_NAME;
+import static org.jboss.seam.example.seamdiscs.test.TestStrings.NEW_BAND_NAME;
+import static org.jboss.seam.example.seamdiscs.test.TestStrings.PASSWORD;
+import static org.jboss.seam.example.seamdiscs.test.TestStrings.PERSISTED;
+import static org.jboss.seam.example.seamdiscs.test.TestStrings.UPDATED;
+import static org.jboss.seam.example.seamdiscs.test.TestStrings.USERNAME;
+
+import java.util.List;
+
+import javax.el.PropertyNotFoundException;
+
+import org.jboss.arquillian.container.test.api.Deployment;
+import org.jboss.arquillian.container.test.api.OverProtocol;
+import org.jboss.arquillian.junit.Arquillian;
+import org.jboss.seam.example.seamdiscs.model.BandMember;
+import org.jboss.seam.mock.DBJUnitSeamTest;
+import org.jboss.shrinkwrap.api.Archive;
+import org.jboss.shrinkwrap.api.spec.EnterpriseArchive;
+import org.jboss.shrinkwrap.api.spec.WebArchive;
+import org.junit.runner.RunWith;
+import org.junit.Test;
+
+/**
+ * @author Pete Muir
+ *
+ */
+(a)RunWith(Arquillian.class)
+public class EditArtistTest extends DBJUnitSeamTest
+{
+ @Deployment(name="EditArtistTest")
+ @OverProtocol("Servlet 3.0")
+ public static Archive<?> createDeployment()
+ {
+ return Deployments.seamdiscsDeployment();
+ }
+
+ @Override
+ protected void prepareDBUnitOperations()
+ {
+ setDatabase("HSQL");
+ setDatasourceJndiName("java:/jboss/datasources/ExampleDS");
+
+ beforeTestOperations.add(
+ new DataSetOperation("org/jboss/seam/example/seamdiscs/test/BaseData.xml")
+ );
+ }
+
+ @Test
+ public void testEditArtist() throws Exception
+ {
+ final String cid = new FacesRequest("/artist.xhtml")
+ {
+ @Override
+ protected void beforeRequest()
+ {
+ setParameter("artistId", "1");
+ setParameter("conversationPropagation", "join");
+ }
+
+ @Override
+ protected void updateModelValues() throws Exception {
+ setValue("#{identity.username}", USERNAME);
+ setValue("#{identity.password}", PASSWORD);
+ }
+
+ @Override
+ protected void invokeApplication() throws Exception
+ {
+ invokeAction("#{identity.login}");
+ }
+
+ @Override
+ protected void renderResponse() throws Exception
+ {
+ assert (Boolean) getValue("#{identity.loggedIn}");
+ assert ((Integer) 1).equals(getValue("#{artistHome.id}"));
+ assert ARTIST1_NAME.equals(getValue("#{artist.name}"));
+ assert getValue("#{artist.description}") == null;
+ assert isLongRunningConversation();
+ assert (Boolean) getValue("#{artistHome.managed}");
+
+ }
+ }.run();
+
+ new FacesRequest("/artist.xhtml", cid)
+ {
+
+ @Override
+ protected void updateModelValues() throws Exception
+ {
+ setValue("#{artist.description}", ARTIST_NEW_DESCRIPTION);
+ assert isLongRunningConversation();
+ assert cid.equals(getConversationId());
+ }
+
+ @Override
+ protected void invokeApplication() throws Exception
+ {
+ assert UPDATED.equals(invokeAction("#{artistHome.update}"));
+ }
+
+ @Override
+ protected void renderResponse() throws Exception
+ {
+ assert ARTIST_NEW_DESCRIPTION.equals(getValue("#{artist.description"));
+ assert isLongRunningConversation();
+ }
+
+ }.run();
+ }
+
+ @Test
+ public void testAddArtist() throws Exception
+ {
+ final String cid = new FacesRequest("/artist.xhtml")
+ {
+ @Override
+ protected void beforeRequest()
+ {
+ setParameter("conversationPropagation", "join");
+ }
+
+ @Override
+ protected void updateModelValues() throws Exception {
+ setValue("#{identity.username}", USERNAME);
+ setValue("#{identity.password}", PASSWORD);
+ }
+
+ @Override
+ protected void invokeApplication() throws Exception
+ {
+ invokeAction("#{identity.login}");
+ }
+
+ @Override
+ protected void renderResponse() throws Exception
+ {
+ assert (Boolean) getValue("#{identity.loggedIn}");
+ assert null == getValue("#{artistHome.id}");
+ assert null == getValue("#{artist.name}");
+ assert isLongRunningConversation();
+ assert (!(Boolean) getValue("#{artistHome.managed}"));
+ }
+ }.run();
+
+ new FacesRequest("/artist.xhtml", cid)
+ {
+
+ @Override
+ protected void updateModelValues() throws Exception
+ {
+ setValue("#{artistHome.instance.name}", NEW_ARTIST_NAME);
+ assert isLongRunningConversation();
+ }
+
+ @Override
+ protected void invokeApplication() throws Exception
+ {
+ assert PERSISTED.equals(invokeAction("#{artistHome.persist}"));
+ }
+
+ }.run();
+
+ new FacesRequest("/artists.xhtml", cid)
+ {
+
+ @Override
+ protected void renderResponse() throws Exception
+ {
+ assert new Long("7").equals(getValue("#{artists.resultCount}"));
+ assert NEW_ARTIST_NAME.equals(getValue("#{artists.resultList[3].name}"));
+ assert ARTIST4_NAME.equals(getValue("#{artists.resultList[4].name}"));
+ }
+
+ }.run();
+ }
+
+ @Test
+ public void testAddBand() throws Exception
+ {
+ final String cid = new FacesRequest("/artist.xhtml")
+ {
+
+ @Override
+ protected void beforeRequest()
+ {
+ setParameter("conversationPropagation", "join");
+ }
+
+ @Override
+ protected void updateModelValues() throws Exception {
+ setValue("#{identity.username}", USERNAME);
+ setValue("#{identity.password}", PASSWORD);
+ setValue("#{artistHome.type}", "band");
+ }
+
+ @Override
+ protected void invokeApplication() throws Exception
+ {
+ invokeAction("#{identity.login}");
+ }
+
+ @Override
+ protected void renderResponse() throws Exception
+ {
+ assert (Boolean) getValue("#{identity.loggedIn}");
+ assert null == getValue("#{artistHome.id}");
+ assert null == getValue("#{artist.name}");
+ try
+ {
+ assert ((Integer) 0).equals(getValue("#{artist.bandMembers.size}"));
+ }
+ catch (PropertyNotFoundException e)
+ {
+ assert false;
+ }
+ assert isLongRunningConversation();
+ assert (!(Boolean) getValue("#{artistHome.managed}"));
+ }
+ }.run();
+
+ new FacesRequest("/artist.xhtml", cid)
+ {
+
+ @Override
+ protected void updateModelValues() throws Exception
+ {
+ setValue("#{artistHome.instance.name}", NEW_BAND_NAME);
+ assert isLongRunningConversation();
+ }
+
+ @Override
+ protected void invokeApplication() throws Exception
+ {
+ assert PERSISTED.equals(invokeAction("#{artistHome.persist}"));
+ assert ((Integer) 0).equals(getValue("#{artistHome.instance.bandMembers.size}"));
+ }
+
+ }.run();
+
+ new FacesRequest("/artists.xhtml", cid)
+ {
+
+ @Override
+ protected void renderResponse() throws Exception
+ {
+ assert new Long("7").equals(getValue("#{artists.resultCount}"));
+ assert NEW_BAND_NAME.equals(getValue("#{artists.resultList[3].name}"));
+ assert ARTIST4_NAME.equals(getValue("#{artists.resultList[4].name}"));
+ }
+
+ }.run();
+ }
+
+ @Test
+ public void testAddBandMember() throws Exception
+ {
+ final String cid = new FacesRequest("/artist.xhtml")
+ {
+ @Override
+ protected void beforeRequest()
+ {
+ setParameter("artistId", "1");
+ setParameter("conversationPropagation", "join");
+ }
+
+ @Override
+ protected void updateModelValues() throws Exception {
+ setValue("#{identity.username}", USERNAME);
+ setValue("#{identity.password}", PASSWORD);
+ }
+
+ @Override
+ protected void invokeApplication() throws Exception
+ {
+ invokeAction("#{identity.login}");
+ }
+
+ @Override
+ protected void renderResponse() throws Exception
+ {
+ assert ARTIST1_NAME.equals(getValue("#{artist.name}"));
+ assert ((Integer) 3).equals(getValue("#{artist.bandMembers.size}"));
+ }
+ }.run();
+
+ new FacesRequest("/artist.xhtml", cid)
+ {
+
+ @Override
+ protected void invokeApplication() throws Exception
+ {
+ assert null == invokeAction("#{artistHome.addBandMember}");
+ }
+
+ @Override
+ protected void renderResponse() throws Exception
+ {
+ assert ((Integer) 4).equals(getValue("#{artist.bandMembers.size}"));
+ }
+
+ }.run();
+
+ new FacesRequest("/artist.xhtml", cid)
+ {
+
+ @Override
+ protected void updateModelValues() throws Exception
+ {
+ setValue("#{artist.bandMembers[3].name}", NEW_BANDMEMBER_NAME);
+ }
+
+ @Override
+ protected void invokeApplication() throws Exception
+ {
+ assert "updated" == invokeAction("#{artistHome.update}");
+ }
+
+ @Override
+ protected void renderResponse() throws Exception
+ {
+ assert ((Integer) 4).equals(getValue("#{artist.size}"));
+ assert NEW_BANDMEMBER_NAME.equals(getValue("#{artist.bandMembers[3].name}"));
+ }
+
+ }.run();
+
+ }
+
+ @Test
+ public void testBandMemberFinder() throws Exception
+ {
+ new NonFacesRequest("/artist.xhtml")
+ {
+
+ @Override
+ protected void renderResponse() throws Exception
+ {
+ List<BandMember> bandMembers = (List<BandMember>) invokeMethod("#{bandMemberFinder.getBandMembers('R')}");
+ assert bandMembers.size() == 1;
+ assert BANDMEMBER3_VALUE.equals(bandMembers.get(0).getName());
+ }
+
+ }.run();
+ }
+}
Added: branches/enterprise/WFK-2_1/examples/seamdiscs/seamdiscs-ejb/src/test/java/org/jboss/seam/example/seamdiscs/test/EditDiscTest.java
===================================================================
--- branches/enterprise/WFK-2_1/examples/seamdiscs/seamdiscs-ejb/src/test/java/org/jboss/seam/example/seamdiscs/test/EditDiscTest.java (rev 0)
+++ branches/enterprise/WFK-2_1/examples/seamdiscs/seamdiscs-ejb/src/test/java/org/jboss/seam/example/seamdiscs/test/EditDiscTest.java 2013-06-03 17:19:25 UTC (rev 15531)
@@ -0,0 +1,202 @@
+/**
+ *
+ */
+package org.jboss.seam.example.seamdiscs.test;
+
+import static org.jboss.seam.example.seamdiscs.test.TestStrings.ARTIST6_NAME;
+import static org.jboss.seam.example.seamdiscs.test.TestStrings.DISC4_ARTIST;
+import static org.jboss.seam.example.seamdiscs.test.TestStrings.DISC4_NAME;
+import static org.jboss.seam.example.seamdiscs.test.TestStrings.DISC4_NEW_DESCRIPTION;
+import static org.jboss.seam.example.seamdiscs.test.TestStrings.NEW_DISC_NAME;
+import static org.jboss.seam.example.seamdiscs.test.TestStrings.PASSWORD;
+import static org.jboss.seam.example.seamdiscs.test.TestStrings.USERNAME;
+
+import javax.faces.model.DataModel;
+
+import org.jboss.arquillian.container.test.api.Deployment;
+import org.jboss.arquillian.container.test.api.OverProtocol;
+import org.jboss.arquillian.junit.Arquillian;
+import org.jboss.seam.example.seamdiscs.model.Artist;
+import org.jboss.seam.example.seamdiscs.model.Disc;
+import org.jboss.seam.mock.DBJUnitSeamTest;
+import org.jboss.shrinkwrap.api.Archive;
+import org.jboss.shrinkwrap.api.spec.EnterpriseArchive;
+import org.jboss.shrinkwrap.api.spec.WebArchive;
+import org.junit.runner.RunWith;
+import org.junit.Test;
+
+/**
+ * @author Pete Muir
+ *
+ */
+(a)RunWith(Arquillian.class)
+public class EditDiscTest extends DBJUnitSeamTest{
+
+ @Deployment(name="EditDiscTest")
+ @OverProtocol("Servlet 3.0")
+ public static Archive<?> createDeployment()
+ {
+ return Deployments.seamdiscsDeployment();
+ }
+
+ @Override
+ protected void prepareDBUnitOperations() {
+ setDatabase("HSQL");
+ setDatasourceJndiName("java:/jboss/datasources/ExampleDS");
+
+ beforeTestOperations.add(
+ new DataSetOperation("org/jboss/seam/example/seamdiscs/test/BaseData.xml")
+ );
+ }
+
+ @Test
+ public void testEditDisc() throws Exception
+ {
+ final String cid = new FacesRequest("/disc.xhtml")
+ {
+ @Override
+ protected void beforeRequest()
+ {
+ setParameter("discId", "4");
+ setParameter("conversationPropagation", "join");
+ }
+
+ @Override
+ protected void updateModelValues() throws Exception {
+ setValue("#{identity.username}", USERNAME);
+ setValue("#{identity.password}", PASSWORD);
+ }
+
+ @Override
+ protected void invokeApplication() throws Exception
+ {
+ invokeAction("#{identity.login}");
+ }
+
+ @Override
+ protected void renderResponse() throws Exception
+ {
+ assert (Boolean) getValue("#{identity.loggedIn}");
+ assert ((Integer) 4).equals(getValue("#{discHome.id}"));
+ assert DISC4_NAME.equals(getValue("#{disc.name}"));
+ assert getValue("#{disc.description}") == null;
+ assert isLongRunningConversation();
+ assert (Boolean) getValue("#{discHome.managed}");
+
+ }
+ }.run();
+
+ new FacesRequest("/disc.xhtml", cid)
+ {
+
+ @Override
+ protected void updateModelValues() throws Exception
+ {
+ setValue("#{disc.description}", DISC4_NEW_DESCRIPTION);
+ // Simulate the entity converter
+ setValue("#{exampleArtist.name}", ARTIST6_NAME);
+ Artist artist = (Artist) getValue("#{artists.singleResult}");
+ setValue("#{disc.artist}", artist);
+ assert isLongRunningConversation();
+ assert cid.equals(getConversationId());
+ }
+
+ @Override
+ protected void invokeApplication() throws Exception
+ {
+ assert "updated".equals(invokeAction("#{discHome.update}"));
+ }
+
+ @Override
+ protected void renderResponse() throws Exception
+ {
+ assert DISC4_NEW_DESCRIPTION.equals(getValue("#{disc.description"));
+ assert DISC4_ARTIST.equals(getValue("#{disc.artist.name}"));
+ assert isLongRunningConversation();
+ }
+
+ }.run();
+ }
+
+ @Test
+ public void testAddDisc() throws Exception
+ {
+ final String cid = new FacesRequest("/disc.xhtml")
+ {
+ @Override
+ protected void beforeRequest()
+ {
+ setParameter("conversationPropagation", "join");
+ }
+
+ @Override
+ protected void updateModelValues() throws Exception {
+ setValue("#{identity.username}", USERNAME);
+ setValue("#{identity.password}", PASSWORD);
+ }
+
+ @Override
+ protected void invokeApplication() throws Exception
+ {
+ invokeAction("#{identity.login}");
+ }
+
+ @Override
+ protected void renderResponse() throws Exception
+ {
+ assert (Boolean) getValue("#{identity.loggedIn}");
+ assert null == getValue("#{discHome.id}");
+ assert null == getValue("#{disc.name}");
+ assert isLongRunningConversation();
+ assert (!(Boolean) getValue("#{discHome.managed}"));
+ }
+ }.run();
+
+ new FacesRequest("/disc.xhtml", cid)
+ {
+
+ @Override
+ protected void updateModelValues() throws Exception
+ {
+ setValue("#{disc.name}", NEW_DISC_NAME);
+ assert isLongRunningConversation();
+ }
+
+ @Override
+ protected void invokeApplication() throws Exception
+ {
+ assert "persisted".equals(invokeAction("#{discHome.persist}"));
+ }
+
+ @Override
+ protected void renderResponse() throws Exception
+ {
+ assert NEW_DISC_NAME.equals(getValue("#{disc.name}"));
+ }
+
+ }.run();
+
+ new FacesRequest("/discs.xhtml", cid)
+ {
+
+ @Override
+ protected void renderResponse() throws Exception
+ {
+ assert new Long("7").equals(getValue("#{discs.resultCount}"));
+ assertDisc((DataModel) getValue("#{discs.dataModel}"), 4, NEW_DISC_NAME);
+ assertDisc((DataModel) getValue("#{discs.dataModel}"), 5, DISC4_NAME);
+ }
+
+ }.run();
+ }
+
+ private void assertDisc(DataModel dataModel, int row, String discName)
+ {
+ dataModel.setRowIndex(row);
+ Object rowData = dataModel.getRowData();
+ assert rowData instanceof Disc;
+ Disc disc = (Disc) rowData;
+ assert discName.equals(disc.getName());
+ }
+
+}
Added: branches/enterprise/WFK-2_1/examples/seamdiscs/seamdiscs-ejb/src/test/java/org/jboss/seam/example/seamdiscs/test/LoginTest.java
===================================================================
--- branches/enterprise/WFK-2_1/examples/seamdiscs/seamdiscs-ejb/src/test/java/org/jboss/seam/example/seamdiscs/test/LoginTest.java (rev 0)
+++ branches/enterprise/WFK-2_1/examples/seamdiscs/seamdiscs-ejb/src/test/java/org/jboss/seam/example/seamdiscs/test/LoginTest.java 2013-06-03 17:19:25 UTC (rev 15531)
@@ -0,0 +1,134 @@
+package org.jboss.seam.example.seamdiscs.test;
+
+import static org.jboss.seam.example.seamdiscs.test.TestStrings.PASSWORD;
+import static org.jboss.seam.example.seamdiscs.test.TestStrings.USERNAME;
+import static org.jboss.seam.example.seamdiscs.test.TestStrings.WRONG_PASSWORD;
+import static org.jboss.seam.example.seamdiscs.test.TestStrings.WRONG_USERNAME;
+
+import org.jboss.arquillian.container.test.api.Deployment;
+import org.jboss.arquillian.container.test.api.OverProtocol;
+import org.jboss.arquillian.junit.Arquillian;
+import org.jboss.seam.mock.DBJUnitSeamTest;
+import org.jboss.shrinkwrap.api.Archive;
+import org.jboss.shrinkwrap.api.spec.EnterpriseArchive;
+import org.jboss.shrinkwrap.api.spec.WebArchive;
+import org.junit.runner.RunWith;
+import org.junit.Test;
+
+/**
+ * @author Pete Muir
+ *
+ */
+(a)RunWith(Arquillian.class)
+public class LoginTest extends DBJUnitSeamTest {
+
+ @Deployment(name="LoginTest")
+ @OverProtocol("Servlet 3.0")
+ public static Archive<?> createDeployment()
+ {
+ return Deployments.seamdiscsDeployment();
+ }
+
+ @Override
+ protected void prepareDBUnitOperations() {
+ setDatabase("HSQL");
+ setDatasourceJndiName("java:/jboss/datasources/ExampleDS");
+
+ beforeTestOperations.add(
+ new DataSetOperation("org/jboss/seam/example/seamdiscs/test/BaseData.xml")
+ );
+ }
+
+ @Test
+ public void testLogin() throws Exception
+ {
+ new FacesRequest("/login.xhtml")
+ {
+
+ @Override
+ protected void updateModelValues() throws Exception {
+ setValue("#{identity.username}", USERNAME);
+ setValue("#{identity.password}", PASSWORD);
+ }
+
+ @Override
+ protected void invokeApplication() throws Exception
+ {
+ invokeAction("#{identity.login}");
+ }
+
+ @Override
+ protected void renderResponse() throws Exception
+ {
+ assert (Boolean) getValue("#{identity.loggedIn}");
+ }
+ }.run();
+
+ new FacesRequest("/login.xhtml")
+ {
+
+ @Override
+ protected void updateModelValues() throws Exception {
+ setValue("#{identity.username}", USERNAME);
+ setValue("#{identity.password}", WRONG_PASSWORD);
+ }
+
+ @Override
+ protected void invokeApplication() throws Exception
+ {
+ invokeAction("#{identity.login}");
+ }
+
+ @Override
+ protected void renderResponse() throws Exception
+ {
+ assert !((Boolean) getValue("#{identity.loggedIn}"));
+ }
+ }.run();
+
+ new FacesRequest("/login.xhtml")
+ {
+
+ @Override
+ protected void updateModelValues() throws Exception {
+ setValue("#{identity.username}", WRONG_USERNAME);
+ setValue("#{identity.password}", PASSWORD);
+ }
+
+ @Override
+ protected void invokeApplication() throws Exception
+ {
+ invokeAction("#{identity.login}");
+ }
+
+ @Override
+ protected void renderResponse() throws Exception
+ {
+ assert !((Boolean) getValue("#{identity.loggedIn}"));
+ }
+ }.run();
+
+ new FacesRequest("/login.xhtml")
+ {
+
+ @Override
+ protected void updateModelValues() throws Exception {
+ setValue("#{identity.username}", WRONG_USERNAME);
+ setValue("#{identity.password}", WRONG_PASSWORD);
+ }
+
+ @Override
+ protected void invokeApplication() throws Exception
+ {
+ invokeAction("#{identity.login}");
+ }
+
+ @Override
+ protected void renderResponse() throws Exception
+ {
+ assert !((Boolean) getValue("#{identity.loggedIn}"));
+ }
+ }.run();
+ }
+
+}
Added: branches/enterprise/WFK-2_1/examples/seamdiscs/seamdiscs-ejb/src/test/java/org/jboss/seam/example/seamdiscs/test/TestStrings.java
===================================================================
--- branches/enterprise/WFK-2_1/examples/seamdiscs/seamdiscs-ejb/src/test/java/org/jboss/seam/example/seamdiscs/test/TestStrings.java (rev 0)
+++ branches/enterprise/WFK-2_1/examples/seamdiscs/seamdiscs-ejb/src/test/java/org/jboss/seam/example/seamdiscs/test/TestStrings.java 2013-06-03 17:19:25 UTC (rev 15531)
@@ -0,0 +1,54 @@
+/**
+ *
+ */
+package org.jboss.seam.example.seamdiscs.test;
+
+/**
+ * @author Pete Muir
+ *
+ */
+public class TestStrings {
+
+ public static final String USERNAME = "administrator";
+ public static final String PASSWORD = "administrator";
+ public static final String WRONG_USERNAME = "wrongUsername";
+ public static final String WRONG_PASSWORD = "wrongPassword";
+
+
+ public static final String ARTIST1_NAME = "Pink Floyd";
+ public static final String ARTIST2_NAME = "Fairport Convention";
+ public static final String ARTIST3_NAME = "Bob Dylan";
+ public static final String ARTIST4_NAME = "Led Zepplin";
+ public static final String ARTIST5_NAME = "Ry Cooder";
+ public static final String ARTIST6_NAME = "Richard Thompson";
+ public static final String ARTIST_NEW_DESCRIPTION = "A great band";
+ public static final String NEW_ARTIST_NAME = "Pete Muir";
+
+
+
+ public static final String NEW_DISC_NAME = "Pete Muir's Debut Album";
+ public static final String DISC1_NAME = "Dark Side of the Moon";
+ public static final String DISC1_ARTIST = ARTIST1_NAME;
+ public static final String DISC2_NAME = "Liege and Lief";
+ public static final String DISC2_ARTIST = ARTIST2_NAME;
+ public static final String DISC3_NAME = "The Wall";
+ public static final String DISC3_ARTIST = ARTIST1_NAME;
+ public static final String DISC4_NAME = "The Freewheelin' Bob Dylan";
+ public static final String DISC4_ARTIST = ARTIST3_NAME;
+ public static final String DISC4_NEW_DESCRIPTION = "A classic album";
+ public static final String DISC5_NAME = "Blood on the Tracks";
+ public static final String DISC5_ARTIST = ARTIST3_NAME;
+ public static final String DISC6_NAME = "Chavez Ravine";
+ public static final String DISC6_ARTIST = ARTIST5_NAME;
+
+ public static final String NEW_BAND_NAME = "Pete Muir's Band";
+ public static final String NEW_BANDMEMBER_NAME = "Gavin King";
+ public static final String BANDMEMBER3_VALUE = "Roger Waters";
+
+ public static final String PERSISTED = "persisted";
+ public static final String UPDATED = "updated";
+
+
+
+
+}
Added: branches/enterprise/WFK-2_1/examples/seamdiscs/seamdiscs-ejb/src/test/resources/arquillian.xml
===================================================================
(Binary files differ)
Property changes on: branches/enterprise/WFK-2_1/examples/seamdiscs/seamdiscs-ejb/src/test/resources/arquillian.xml
___________________________________________________________________
Added: svn:mime-type
+ application/xml
Added: branches/enterprise/WFK-2_1/examples/seamdiscs/seamdiscs-ejb/src/test/resources/artist.page.xml
===================================================================
(Binary files differ)
Property changes on: branches/enterprise/WFK-2_1/examples/seamdiscs/seamdiscs-ejb/src/test/resources/artist.page.xml
___________________________________________________________________
Added: svn:mime-type
+ application/xml
Added: branches/enterprise/WFK-2_1/examples/seamdiscs/seamdiscs-ejb/src/test/resources/artists.page.xml
===================================================================
(Binary files differ)
Property changes on: branches/enterprise/WFK-2_1/examples/seamdiscs/seamdiscs-ejb/src/test/resources/artists.page.xml
___________________________________________________________________
Added: svn:mime-type
+ application/xml
Added: branches/enterprise/WFK-2_1/examples/seamdiscs/seamdiscs-ejb/src/test/resources/components.xml
===================================================================
(Binary files differ)
Property changes on: branches/enterprise/WFK-2_1/examples/seamdiscs/seamdiscs-ejb/src/test/resources/components.xml
___________________________________________________________________
Added: svn:mime-type
+ application/xml
Added: branches/enterprise/WFK-2_1/examples/seamdiscs/seamdiscs-ejb/src/test/resources/disc.page.xml
===================================================================
(Binary files differ)
Property changes on: branches/enterprise/WFK-2_1/examples/seamdiscs/seamdiscs-ejb/src/test/resources/disc.page.xml
___________________________________________________________________
Added: svn:mime-type
+ application/xml
Added: branches/enterprise/WFK-2_1/examples/seamdiscs/seamdiscs-ejb/src/test/resources/discs.page.xml
===================================================================
(Binary files differ)
Property changes on: branches/enterprise/WFK-2_1/examples/seamdiscs/seamdiscs-ejb/src/test/resources/discs.page.xml
___________________________________________________________________
Added: svn:mime-type
+ application/xml
Added: branches/enterprise/WFK-2_1/examples/seamdiscs/seamdiscs-ejb/src/test/resources/jboss-deployment-structure.xml
===================================================================
--- branches/enterprise/WFK-2_1/examples/seamdiscs/seamdiscs-ejb/src/test/resources/jboss-deployment-structure.xml (rev 0)
+++ branches/enterprise/WFK-2_1/examples/seamdiscs/seamdiscs-ejb/src/test/resources/jboss-deployment-structure.xml 2013-06-03 17:19:25 UTC (rev 15531)
@@ -0,0 +1,12 @@
+<jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.0">
+ <deployment>
+ <dependencies>
+ <module name="org.hibernate" export="true"/>
+ <module name="javax.faces.api" export="true"/>
+ <module name="com.sun.jsf-impl" export="true"/>
+ <module name="org.apache.commons.collections" export="true"/>
+ <module name="org.dom4j" export="true"/>
+ <module name="org.antlr" export="true"/>
+ </dependencies>
+ </deployment>
+</jboss-deployment-structure>
\ No newline at end of file
Added: branches/enterprise/WFK-2_1/examples/seamdiscs/seamdiscs-ejb/src/test/resources/login.page.xml
===================================================================
(Binary files differ)
Property changes on: branches/enterprise/WFK-2_1/examples/seamdiscs/seamdiscs-ejb/src/test/resources/login.page.xml
___________________________________________________________________
Added: svn:mime-type
+ application/xml
Added: branches/enterprise/WFK-2_1/examples/seamdiscs/seamdiscs-ejb/src/test/resources/org/jboss/seam/example/seamdiscs/test/BaseData.xml
===================================================================
(Binary files differ)
Property changes on: branches/enterprise/WFK-2_1/examples/seamdiscs/seamdiscs-ejb/src/test/resources/org/jboss/seam/example/seamdiscs/test/BaseData.xml
___________________________________________________________________
Added: svn:mime-type
+ application/xml
Added: branches/enterprise/WFK-2_1/examples/seamdiscs/seamdiscs-ejb/src/test/resources/pages.xml
===================================================================
(Binary files differ)
Property changes on: branches/enterprise/WFK-2_1/examples/seamdiscs/seamdiscs-ejb/src/test/resources/pages.xml
___________________________________________________________________
Added: svn:mime-type
+ application/xml
Added: branches/enterprise/WFK-2_1/examples/seamdiscs/seamdiscs-ejb/src/test/resources/persistence.xml
===================================================================
(Binary files differ)
Property changes on: branches/enterprise/WFK-2_1/examples/seamdiscs/seamdiscs-ejb/src/test/resources/persistence.xml
___________________________________________________________________
Added: svn:mime-type
+ application/xml
Added: branches/enterprise/WFK-2_1/examples/seamdiscs/seamdiscs-ejb/src/test/resources/web.xml
===================================================================
(Binary files differ)
Property changes on: branches/enterprise/WFK-2_1/examples/seamdiscs/seamdiscs-ejb/src/test/resources/web.xml
___________________________________________________________________
Added: svn:mime-type
+ application/xml
Modified: branches/enterprise/WFK-2_1/examples/seamdiscs/seamdiscs-web/pom.xml
===================================================================
--- branches/enterprise/WFK-2_1/examples/seamdiscs/seamdiscs-web/pom.xml 2013-06-03 17:07:17 UTC (rev 15530)
+++ branches/enterprise/WFK-2_1/examples/seamdiscs/seamdiscs-web/pom.xml 2013-06-03 17:19:25 UTC (rev 15531)
@@ -75,6 +75,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
+ <version>${version.war.plugin}</version>
<configuration>
<webResources>
<resource>
11 years, 5 months
Seam SVN: r15530 - in branches/enterprise/WFK-2_1/examples/seambay: seambay-ear and 12 other directories.
by seam-commits@lists.jboss.org
Author: maschmid
Date: 2013-06-03 13:07:17 -0400 (Mon, 03 Jun 2013)
New Revision: 15530
Added:
branches/enterprise/WFK-2_1/examples/seambay/seambay-ejb/src/test/
branches/enterprise/WFK-2_1/examples/seambay/seambay-ejb/src/test/java/
branches/enterprise/WFK-2_1/examples/seambay/seambay-ejb/src/test/java/org/
branches/enterprise/WFK-2_1/examples/seambay/seambay-ejb/src/test/java/org/jboss/
branches/enterprise/WFK-2_1/examples/seambay/seambay-ejb/src/test/java/org/jboss/seam/
branches/enterprise/WFK-2_1/examples/seambay/seambay-ejb/src/test/java/org/jboss/seam/example/
branches/enterprise/WFK-2_1/examples/seambay/seambay-ejb/src/test/java/org/jboss/seam/example/seambay/
branches/enterprise/WFK-2_1/examples/seambay/seambay-ejb/src/test/java/org/jboss/seam/example/seambay/test/
branches/enterprise/WFK-2_1/examples/seambay/seambay-ejb/src/test/java/org/jboss/seam/example/seambay/test/AuctionTest.java
branches/enterprise/WFK-2_1/examples/seambay/seambay-ejb/src/test/resources/
branches/enterprise/WFK-2_1/examples/seambay/seambay-ejb/src/test/resources/arquillian.xml
branches/enterprise/WFK-2_1/examples/seambay/seambay-ejb/src/test/resources/components.xml
branches/enterprise/WFK-2_1/examples/seambay/seambay-ejb/src/test/resources/jboss-deployment-structure.xml
branches/enterprise/WFK-2_1/examples/seambay/seambay-ejb/src/test/resources/pages.xml
branches/enterprise/WFK-2_1/examples/seambay/seambay-ejb/src/test/resources/persistence.xml
branches/enterprise/WFK-2_1/examples/seambay/seambay-ejb/src/test/resources/urlrewrite.xml
branches/enterprise/WFK-2_1/examples/seambay/seambay-ejb/src/test/resources/web.xml
Removed:
branches/enterprise/WFK-2_1/examples/seambay/seambay-tests/
Modified:
branches/enterprise/WFK-2_1/examples/seambay/pom.xml
branches/enterprise/WFK-2_1/examples/seambay/seambay-ear/pom.xml
branches/enterprise/WFK-2_1/examples/seambay/seambay-ejb/pom.xml
branches/enterprise/WFK-2_1/examples/seambay/seambay-web/pom.xml
Log:
seambay migrated
Modified: branches/enterprise/WFK-2_1/examples/seambay/pom.xml
===================================================================
--- branches/enterprise/WFK-2_1/examples/seambay/pom.xml 2013-06-03 17:00:28 UTC (rev 15529)
+++ branches/enterprise/WFK-2_1/examples/seambay/pom.xml 2013-06-03 17:07:17 UTC (rev 15530)
@@ -3,27 +3,49 @@
<modelVersion>4.0.0</modelVersion>
<groupId>org.jboss.seam.examples</groupId>
<artifactId>seambay</artifactId>
- <parent>
- <groupId>org.jboss.seam</groupId>
- <artifactId>examples</artifactId>
- <version>2.3.1.Final-redhat-2</version>
- </parent>
+ <version>2.3.1.Final-redhat-2</version>
+
<packaging>pom</packaging>
<name>Seambay Example (EE6)</name>
<properties>
<example.name>seambay</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 with ShrinkWrap Resolver, uncomment
+ and customize the following property. -->
+ <!--<maven.user.settings>/path/to/custom/settings.xml</maven.user.settings>-->
+
+ <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.resources.plugin>2.6</version.resources.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.ejb.plugin>2.3</version.ejb.plugin>
+ <version.jboss.maven.plugin>7.4.Final</version.jboss.maven.plugin>
</properties>
<modules>
<module>seambay-ear</module>
<module>seambay-ejb</module>
<module>seambay-web</module>
- <module>seambay-tests</module>
+
</modules>
<dependencyManagement>
<dependencies>
+ <!-- Modules -->
<dependency>
<groupId>org.jboss.seam.examples.seambay</groupId>
<artifactId>seambay-ejb</artifactId>
@@ -41,6 +63,82 @@
<artifactId>seambay-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>
+
+ <!-- Common provided dependencies -->
+ <dependency>
+ <groupId>commons-logging</groupId>
+ <artifactId>commons-logging</artifactId>
+ <version>${version.commons.logging}</version>
+ <scope>provided</scope>
+ </dependency>
+
+ <!-- TestNG is not necessary -->
+ <dependency>
+ <groupId>org.jboss.seam</groupId>
+ <artifactId>jboss-seam</artifactId>
+ <version>${project.version}</version>
+ <exclusions>
+ <exclusion>
+ <groupId>org.testng</groupId>
+ <artifactId>testng</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>junit</groupId>
+ <artifactId>junit</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>
+ </systemPropertyVariables>
+ </configuration>
+ </plugin>
+ <plugin>
+ <artifactId>maven-dependency-plugin</artifactId>
+ <version>${version.dependency.plugin}</version>
+ </plugin>
+ <plugin>
+ <artifactId>maven-resources-plugin</artifactId>
+ <version>${version.resources.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/seambay/seambay-ear/pom.xml
===================================================================
--- branches/enterprise/WFK-2_1/examples/seambay/seambay-ear/pom.xml 2013-06-03 17:00:28 UTC (rev 15529)
+++ branches/enterprise/WFK-2_1/examples/seambay/seambay-ear/pom.xml 2013-06-03 17:07:17 UTC (rev 15530)
@@ -48,10 +48,20 @@
<build>
<finalName>seam-seambay</finalName>
+ <pluginManagement>
+ <plugins>
+ <plugin>
+ <groupId>org.jboss.as.plugins</groupId>
+ <artifactId>jboss-as-maven-plugin</artifactId>
+ <version>${version.jboss.maven.plugin}</version>
+ </plugin>
+ </plugins>
+ </pluginManagement>
<plugins>
<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/seambay/seambay-ejb/pom.xml
===================================================================
--- branches/enterprise/WFK-2_1/examples/seambay/seambay-ejb/pom.xml 2013-06-03 17:00:28 UTC (rev 15529)
+++ branches/enterprise/WFK-2_1/examples/seambay/seambay-ejb/pom.xml 2013-06-03 17:07:17 UTC (rev 15530)
@@ -57,6 +57,110 @@
<groupId>org.opensymphony.quartz</groupId>
<artifactId>quartz</artifactId>
</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-seambay/#{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/seambay/seambay-ejb/src/test/java/org/jboss/seam/example/seambay/test/AuctionTest.java
===================================================================
--- branches/enterprise/WFK-2_1/examples/seambay/seambay-ejb/src/test/java/org/jboss/seam/example/seambay/test/AuctionTest.java (rev 0)
+++ branches/enterprise/WFK-2_1/examples/seambay/seambay-ejb/src/test/java/org/jboss/seam/example/seambay/test/AuctionTest.java 2013-06-03 17:07:17 UTC (rev 15530)
@@ -0,0 +1,261 @@
+package org.jboss.seam.example.seambay.test;
+
+import java.io.File;
+import java.util.List;
+
+import javax.faces.model.DataModel;
+import org.jboss.arquillian.container.test.api.Deployment;
+import org.jboss.arquillian.container.test.api.OverProtocol;
+import org.jboss.arquillian.junit.Arquillian;
+
+import org.jboss.seam.contexts.Contexts;
+import org.jboss.seam.example.seambay.Auction;
+import org.jboss.seam.example.seambay.Category;
+import org.jboss.seam.mock.AbstractSeamTest.FacesRequest;
+import org.jboss.seam.mock.JUnitSeamTest;
+import org.jboss.shrinkwrap.api.Archive;
+import org.jboss.shrinkwrap.api.ShrinkWrap;
+import org.jboss.shrinkwrap.api.asset.StringAsset;
+import org.jboss.shrinkwrap.api.spec.WebArchive;
+import org.jboss.shrinkwrap.resolver.api.maven.Maven;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+
+(a)RunWith(Arquillian.class)
+public class AuctionTest extends JUnitSeamTest
+{
+ @Deployment(name="AuctionTest")
+ @OverProtocol("Servlet 3.0")
+ public static Archive<?> createDeployment()
+ {
+ File[] libs = Maven.resolver().loadPomFromFile("pom.xml")
+ .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();
+
+ WebArchive war = ShrinkWrap.create(WebArchive.class, "seam-seambay.war")
+ .addPackages(true, "org.jboss.seam.example.seambay")
+
+ .addAsWebInfResource("org/jboss/seam/example/seambay/soap-handlers.xml", "classes/org/jboss/seam/example/seambay/soap-handlers.xml")
+
+ // already in EJB module
+ .addAsWebInfResource("import.sql", "classes/import.sql")
+ .addAsWebInfResource("seam.properties", "classes/seam.properties")
+
+ .addAsWebInfResource("META-INF/ejb-jar.xml", "ejb-jar.xml")
+ .addAsWebInfResource("META-INF/security-rules.drl", "security-rules.drl")
+
+ // Test specific persistence.xml
+ .addAsWebInfResource("persistence.xml", "classes/META-INF/persistence.xml")
+
+ // manually copied from Web module
+ .addAsWebInfResource("pages.xml", "pages.xml")
+
+ // manually copied from Web module, modified
+ .addAsWebInfResource("web.xml", "web.xml") // only contains MockSeamListener definition
+ .addAsWebInfResource("components.xml", "components.xml") // corrected ejb component jndi-name references from java:app/jboss-seam to java:app/seam-blog
+
+ // manually copied from EAR module
+ .addAsWebInfResource("jboss-deployment-structure.xml", "jboss-deployment-structure.xml")
+ .addAsLibraries(libs);
+
+ return war;
+ }
+
+ @Test
+ public void testCreateAuction() throws Exception
+ {
+ new FacesRequest()
+ {
+ @Override
+ protected void invokeApplication() throws Exception
+ {
+ setValue("#{identity.username}", "demo");
+ setValue("#{identity.password}", "demo");
+ invokeAction("#{identity.login}");
+ assert getValue("#{identity.loggedIn}").equals(true);
+ }
+ }.run();
+
+ String cid = new FacesRequest()
+ {
+ @Override
+ protected void invokeApplication() throws Exception
+ {
+ invokeAction("#{auctionAction.createAuction}");
+ }
+
+ @Override
+ protected void renderResponse()
+ {
+ Auction auction = (Auction) getValue("#{auctionAction.auction}");
+ assert auction != null;
+ }
+ }.run();
+
+ new FacesRequest("/sell.xhtml", cid)
+ {
+ @Override
+ protected void updateModelValues() throws Exception
+ {
+ setValue("#{auctionAction.auction.title}", "A Widget");
+ }
+ }.run();
+
+
+ new FacesRequest("/sell2.xhtml", cid)
+ {
+ @Override
+ protected void updateModelValues() throws Exception
+ {
+ List<Category> categories = (List<Category>) getValue("#{allCategories}");
+
+ setValue("#{auctionAction.auction.category}", categories.get(0));
+ }
+ }.run();
+
+ new FacesRequest("/sell3.xhtml", cid)
+ {
+ @Override
+ protected void updateModelValues() throws Exception
+ {
+ setValue("#{auctionAction.duration}", 3);
+ setValue("#{auctionAction.auction.startingPrice}", 100.0);
+ }
+
+ }.run();
+
+ new FacesRequest("/sell5.xhtml", cid)
+ {
+ @Override
+ protected void updateModelValues() throws Exception
+ {
+ setValue("#{auctionAction.auction.description}", "foo");
+ }
+ }.run();
+
+ new FacesRequest("/preview.xhtml", cid)
+ {
+ @Override
+ protected void invokeApplication() throws Exception
+ {
+ Auction auction = (Auction) getValue("#{auctionAction.auction}");
+ invokeAction("#{auctionAction.confirm}");
+ assert auction.getStatus() == Auction.STATUS_LIVE;
+ }
+ }.run();
+
+ new FacesRequest()
+ {
+ @Override
+ protected void invokeApplication() throws Exception
+ {
+ invokeAction("#{identity.logout}");
+ assert getValue("#{identity.loggedIn}").equals(false);
+ }
+ }.run();
+ }
+
+ @Test
+ public void testBidding() throws Exception
+ {
+ new FacesRequest()
+ {
+ @Override
+ protected void invokeApplication() throws Exception
+ {
+ setValue("#{identity.username}", "demo");
+ setValue("#{identity.password}", "demo");
+ invokeAction("#{identity.login}");
+ assert getValue("#{identity.loggedIn}").equals(true);
+ }
+ }.run();
+
+ new FacesRequest()
+ {
+ @Override
+ protected void invokeApplication() throws Exception
+ {
+ invokeAction("#{auctionAction.createAuction}");
+ setValue("#{auctionAction.auction.title}", "BidTestZZZ");
+ setValue("#{auctionAction.auction.startingPrice}", 1);
+ setValue("#{auctionAction.auction.description}", "bar");
+ setValue("#{auctionAction.categoryId}", 1001);
+
+ Auction auction = (Auction) getValue("#{auctionAction.auction}");
+
+ assert auction.getStatus() == Auction.STATUS_UNLISTED;
+
+ invokeAction("#{auctionAction.confirm}");
+
+ assert auction.getStatus() == Auction.STATUS_LIVE;
+ assert auction.getHighBid() == null;
+ }
+ }.run();
+
+ new FacesRequest()
+ {
+ @Override
+ protected void updateModelValues() throws Exception
+ {
+ setValue("#{auctionSearch.searchTerm}", "BidTestZZZ");
+ }
+
+ @Override
+ protected void invokeApplication() throws Exception
+ {
+ assert invokeAction("#{auctionSearch.queryAuctions}") == null;
+ }
+
+ @Override
+ protected void renderResponse() throws Exception
+ {
+ DataModel auctions = (DataModel) Contexts.getSessionContext().get("auctions");
+ assert auctions.getRowCount() == 1;
+ Auction auction = ((Auction) auctions.getRowData());
+ assert auction.getTitle().equals("BidTestZZZ");
+ assert auction.getHighBid() == null;
+ }
+
+ }.run();
+
+ new FacesRequest()
+ {
+ @Override
+ protected void invokeApplication() throws Exception
+ {
+ Contexts.getEventContext().set("auction", getValue("#{auctionSearch.auctions[0]}"));
+
+ assert invokeAction("#{bidAction.placeBid}") == null;
+ assert getValue("#{bidAction.outcome}").equals("required");
+ Contexts.getEventContext().set("bidAmount", "5.00");
+
+ assert invokeAction("#{bidAction.placeBid}") == null;
+ assert getValue("#{bidAction.outcome}").equals("confirm");
+
+ assert invokeAction("#{bidAction.confirmBid}").equals("success");
+ }
+ }.run();
+
+ new FacesRequest()
+ {
+ @Override
+ protected void invokeApplication() throws Exception
+ {
+ assert invokeAction("#{auctionSearch.queryAuctions}") == null;
+ }
+
+ protected void renderResponse() throws Exception
+ {
+ DataModel auctions = (DataModel) Contexts.getSessionContext().get("auctions");
+ Auction auction = ((Auction) auctions.getRowData());
+ assert auction.getHighBid() != null;
+ }
+ }.run();
+
+
+ }
+
+}
Added: branches/enterprise/WFK-2_1/examples/seambay/seambay-ejb/src/test/resources/arquillian.xml
===================================================================
(Binary files differ)
Property changes on: branches/enterprise/WFK-2_1/examples/seambay/seambay-ejb/src/test/resources/arquillian.xml
___________________________________________________________________
Added: svn:mime-type
+ application/xml
Added: branches/enterprise/WFK-2_1/examples/seambay/seambay-ejb/src/test/resources/components.xml
===================================================================
(Binary files differ)
Property changes on: branches/enterprise/WFK-2_1/examples/seambay/seambay-ejb/src/test/resources/components.xml
___________________________________________________________________
Added: svn:mime-type
+ application/xml
Added: branches/enterprise/WFK-2_1/examples/seambay/seambay-ejb/src/test/resources/jboss-deployment-structure.xml
===================================================================
--- branches/enterprise/WFK-2_1/examples/seambay/seambay-ejb/src/test/resources/jboss-deployment-structure.xml (rev 0)
+++ branches/enterprise/WFK-2_1/examples/seambay/seambay-ejb/src/test/resources/jboss-deployment-structure.xml 2013-06-03 17:07:17 UTC (rev 15530)
@@ -0,0 +1,11 @@
+<jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.0">
+ <deployment>
+ <dependencies>
+ <module name="org.antlr" 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"/>
+ <module name="org.dom4j" export="true"/>
+ </dependencies>
+ </deployment>
+</jboss-deployment-structure>
Added: branches/enterprise/WFK-2_1/examples/seambay/seambay-ejb/src/test/resources/pages.xml
===================================================================
(Binary files differ)
Property changes on: branches/enterprise/WFK-2_1/examples/seambay/seambay-ejb/src/test/resources/pages.xml
___________________________________________________________________
Added: svn:mime-type
+ application/xml
Added: branches/enterprise/WFK-2_1/examples/seambay/seambay-ejb/src/test/resources/persistence.xml
===================================================================
(Binary files differ)
Property changes on: branches/enterprise/WFK-2_1/examples/seambay/seambay-ejb/src/test/resources/persistence.xml
___________________________________________________________________
Added: svn:mime-type
+ application/xml
Added: branches/enterprise/WFK-2_1/examples/seambay/seambay-ejb/src/test/resources/urlrewrite.xml
===================================================================
(Binary files differ)
Property changes on: branches/enterprise/WFK-2_1/examples/seambay/seambay-ejb/src/test/resources/urlrewrite.xml
___________________________________________________________________
Added: svn:mime-type
+ application/xml
Added: branches/enterprise/WFK-2_1/examples/seambay/seambay-ejb/src/test/resources/web.xml
===================================================================
(Binary files differ)
Property changes on: branches/enterprise/WFK-2_1/examples/seambay/seambay-ejb/src/test/resources/web.xml
___________________________________________________________________
Added: svn:mime-type
+ application/xml
Modified: branches/enterprise/WFK-2_1/examples/seambay/seambay-web/pom.xml
===================================================================
--- branches/enterprise/WFK-2_1/examples/seambay/seambay-web/pom.xml 2013-06-03 17:00:28 UTC (rev 15529)
+++ branches/enterprise/WFK-2_1/examples/seambay/seambay-web/pom.xml 2013-06-03 17:07:17 UTC (rev 15530)
@@ -76,6 +76,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
+ <version>${version.war.plugin}</version>
<configuration>
<webResources>
<resource>
11 years, 5 months
Seam SVN: r15529 - in branches/enterprise/WFK-2_1/examples/restbay: restbay-ear and 18 other directories.
by seam-commits@lists.jboss.org
Author: maschmid
Date: 2013-06-03 13:00:28 -0400 (Mon, 03 Jun 2013)
New Revision: 15529
Added:
branches/enterprise/WFK-2_1/examples/restbay/restbay-ejb/src/test/
branches/enterprise/WFK-2_1/examples/restbay/restbay-ejb/src/test/java/
branches/enterprise/WFK-2_1/examples/restbay/restbay-ejb/src/test/java/org/
branches/enterprise/WFK-2_1/examples/restbay/restbay-ejb/src/test/java/org/jboss/
branches/enterprise/WFK-2_1/examples/restbay/restbay-ejb/src/test/java/org/jboss/seam/
branches/enterprise/WFK-2_1/examples/restbay/restbay-ejb/src/test/java/org/jboss/seam/example/
branches/enterprise/WFK-2_1/examples/restbay/restbay-ejb/src/test/java/org/jboss/seam/example/restbay/
branches/enterprise/WFK-2_1/examples/restbay/restbay-ejb/src/test/java/org/jboss/seam/example/restbay/test/
branches/enterprise/WFK-2_1/examples/restbay/restbay-ejb/src/test/java/org/jboss/seam/example/restbay/test/AuctionServiceTest.java
branches/enterprise/WFK-2_1/examples/restbay/restbay-ejb/src/test/java/org/jboss/seam/example/restbay/test/BasicServiceTest.java
branches/enterprise/WFK-2_1/examples/restbay/restbay-ejb/src/test/java/org/jboss/seam/example/restbay/test/CategoryServiceDBUnitTest.java
branches/enterprise/WFK-2_1/examples/restbay/restbay-ejb/src/test/java/org/jboss/seam/example/restbay/test/ContextDataTest.java
branches/enterprise/WFK-2_1/examples/restbay/restbay-ejb/src/test/java/org/jboss/seam/example/restbay/test/Deployments.java
branches/enterprise/WFK-2_1/examples/restbay/restbay-ejb/src/test/java/org/jboss/seam/example/restbay/test/ResourceHomeTest.java
branches/enterprise/WFK-2_1/examples/restbay/restbay-ejb/src/test/java/org/jboss/seam/example/restbay/test/ResourceQueryTest.java
branches/enterprise/WFK-2_1/examples/restbay/restbay-ejb/src/test/java/org/jboss/seam/example/restbay/test/SecurityTest.java
branches/enterprise/WFK-2_1/examples/restbay/restbay-ejb/src/test/java/org/jboss/seam/example/restbay/test/SubresourceTest.java
branches/enterprise/WFK-2_1/examples/restbay/restbay-ejb/src/test/resources/
branches/enterprise/WFK-2_1/examples/restbay/restbay-ejb/src/test/resources/arquillian.xml
branches/enterprise/WFK-2_1/examples/restbay/restbay-ejb/src/test/resources/components.xml
branches/enterprise/WFK-2_1/examples/restbay/restbay-ejb/src/test/resources/jboss-deployment-structure.xml
branches/enterprise/WFK-2_1/examples/restbay/restbay-ejb/src/test/resources/org/
branches/enterprise/WFK-2_1/examples/restbay/restbay-ejb/src/test/resources/org/jboss/
branches/enterprise/WFK-2_1/examples/restbay/restbay-ejb/src/test/resources/org/jboss/seam/
branches/enterprise/WFK-2_1/examples/restbay/restbay-ejb/src/test/resources/org/jboss/seam/example/
branches/enterprise/WFK-2_1/examples/restbay/restbay-ejb/src/test/resources/org/jboss/seam/example/restbay/
branches/enterprise/WFK-2_1/examples/restbay/restbay-ejb/src/test/resources/org/jboss/seam/example/restbay/test/
branches/enterprise/WFK-2_1/examples/restbay/restbay-ejb/src/test/resources/org/jboss/seam/example/restbay/test/dbunitdata.xml
branches/enterprise/WFK-2_1/examples/restbay/restbay-ejb/src/test/resources/pages.xml
branches/enterprise/WFK-2_1/examples/restbay/restbay-ejb/src/test/resources/persistence.xml
branches/enterprise/WFK-2_1/examples/restbay/restbay-ejb/src/test/resources/web.xml
Removed:
branches/enterprise/WFK-2_1/examples/restbay/restbay-tests/
Modified:
branches/enterprise/WFK-2_1/examples/restbay/pom.xml
branches/enterprise/WFK-2_1/examples/restbay/restbay-ear/pom.xml
branches/enterprise/WFK-2_1/examples/restbay/restbay-ejb/pom.xml
branches/enterprise/WFK-2_1/examples/restbay/restbay-web/pom.xml
Log:
migrated restbay
Modified: branches/enterprise/WFK-2_1/examples/restbay/pom.xml
===================================================================
--- branches/enterprise/WFK-2_1/examples/restbay/pom.xml 2013-06-03 16:49:04 UTC (rev 15528)
+++ branches/enterprise/WFK-2_1/examples/restbay/pom.xml 2013-06-03 17:00:28 UTC (rev 15529)
@@ -3,27 +3,49 @@
<modelVersion>4.0.0</modelVersion>
<groupId>org.jboss.seam.examples</groupId>
<artifactId>restbay</artifactId>
- <parent>
- <groupId>org.jboss.seam</groupId>
- <artifactId>examples</artifactId>
- <version>2.3.1.Final-redhat-2</version>
- </parent>
+ <version>2.3.1.Final-redhat-2</version>
+
<packaging>pom</packaging>
<name>Restbay Example (EE6)</name>
<properties>
<example.name>restbay</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 with ShrinkWrap Resolver, uncomment
+ and customize the following property. -->
+ <!--<maven.user.settings>/path/to/custom/settings.xml</maven.user.settings>-->
+
+ <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.resources.plugin>2.6</version.resources.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.ejb.plugin>2.3</version.ejb.plugin>
+ <version.jboss.maven.plugin>7.4.Final</version.jboss.maven.plugin>
</properties>
<modules>
<module>restbay-ear</module>
<module>restbay-ejb</module>
<module>restbay-web</module>
- <module>restbay-tests</module>
+
</modules>
<dependencyManagement>
<dependencies>
+ <!-- Modules -->
<dependency>
<groupId>org.jboss.seam.examples.restbay</groupId>
<artifactId>restbay-ejb</artifactId>
@@ -41,6 +63,82 @@
<artifactId>restbay-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>
+
+ <!-- Common provided dependencies -->
+ <dependency>
+ <groupId>commons-logging</groupId>
+ <artifactId>commons-logging</artifactId>
+ <version>${version.commons.logging}</version>
+ <scope>provided</scope>
+ </dependency>
+
+ <!-- TestNG is not necessary -->
+ <dependency>
+ <groupId>org.jboss.seam</groupId>
+ <artifactId>jboss-seam</artifactId>
+ <version>${project.version}</version>
+ <exclusions>
+ <exclusion>
+ <groupId>org.testng</groupId>
+ <artifactId>testng</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>junit</groupId>
+ <artifactId>junit</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>
+ </systemPropertyVariables>
+ </configuration>
+ </plugin>
+ <plugin>
+ <artifactId>maven-dependency-plugin</artifactId>
+ <version>${version.dependency.plugin}</version>
+ </plugin>
+ <plugin>
+ <artifactId>maven-resources-plugin</artifactId>
+ <version>${version.resources.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/restbay/restbay-ear/pom.xml
===================================================================
--- branches/enterprise/WFK-2_1/examples/restbay/restbay-ear/pom.xml 2013-06-03 16:49:04 UTC (rev 15528)
+++ branches/enterprise/WFK-2_1/examples/restbay/restbay-ear/pom.xml 2013-06-03 17:00:28 UTC (rev 15529)
@@ -49,10 +49,20 @@
<build>
<finalName>seam-restbay</finalName>
+ <pluginManagement>
+ <plugins>
+ <plugin>
+ <groupId>org.jboss.as.plugins</groupId>
+ <artifactId>jboss-as-maven-plugin</artifactId>
+ <version>${version.jboss.maven.plugin}</version>
+ </plugin>
+ </plugins>
+ </pluginManagement>
<plugins>
<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/restbay/restbay-ejb/pom.xml
===================================================================
--- branches/enterprise/WFK-2_1/examples/restbay/restbay-ejb/pom.xml 2013-06-03 16:49:04 UTC (rev 15528)
+++ branches/enterprise/WFK-2_1/examples/restbay/restbay-ejb/pom.xml 2013-06-03 17:00:28 UTC (rev 15529)
@@ -83,6 +83,125 @@
<groupId>org.opensymphony.quartz</groupId>
<artifactId>quartz</artifactId>
</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.dbunit</groupId>
+ <artifactId>dbunit</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-restbay/#{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>
+
+ <plugin>
+ <artifactId>maven-ejb-plugin</artifactId>
+ <version>${version.ejb.plugin}</version>
+ <configuration>
+ <ejbVersion>3.1</ejbVersion>
+ </configuration>
+ </plugin>
+ <!-- Skip tests by default, since they require a container -->
+ <plugin>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <skip>true</skip>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
</project>
Added: branches/enterprise/WFK-2_1/examples/restbay/restbay-ejb/src/test/java/org/jboss/seam/example/restbay/test/AuctionServiceTest.java
===================================================================
--- branches/enterprise/WFK-2_1/examples/restbay/restbay-ejb/src/test/java/org/jboss/seam/example/restbay/test/AuctionServiceTest.java (rev 0)
+++ branches/enterprise/WFK-2_1/examples/restbay/restbay-ejb/src/test/java/org/jboss/seam/example/restbay/test/AuctionServiceTest.java 2013-06-03 17:00:28 UTC (rev 15529)
@@ -0,0 +1,122 @@
+package org.jboss.seam.example.restbay.test;
+
+import org.jboss.arquillian.container.test.api.Deployment;
+import org.jboss.arquillian.container.test.api.OverProtocol;
+import org.jboss.arquillian.junit.Arquillian;
+import org.jboss.seam.mock.EnhancedMockHttpServletResponse;
+import org.jboss.seam.mock.JUnitSeamTest;
+import org.jboss.seam.mock.ResourceRequestEnvironment;
+import org.jboss.shrinkwrap.api.Archive;
+import org.jboss.shrinkwrap.api.spec.EnterpriseArchive;
+import org.jboss.shrinkwrap.api.spec.WebArchive;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+import static org.jboss.seam.mock.ResourceRequestEnvironment.Method;
+import static org.jboss.seam.mock.ResourceRequestEnvironment.ResourceRequest;
+
+import java.util.HashMap;
+import java.util.Map;
+
+(a)RunWith(Arquillian.class)
+public class AuctionServiceTest extends JUnitSeamTest
+{
+ @Deployment(name="AuctionServiceTest")
+ @OverProtocol("Servlet 3.0")
+ public static Archive<?> createDeployment()
+ {
+ return Deployments.restbayDeployment();
+ }
+
+ ResourceRequestEnvironment requestEnv;
+
+ @Before
+ public void prepareEnv() throws Exception
+ {
+ requestEnv = new ResourceRequestEnvironment(this)
+ {
+ @Override
+ public Map<String, Object> getDefaultHeaders()
+ {
+ return new HashMap<String, Object>()
+ {{
+ put("Accept", "text/plain");
+ }};
+ }
+ };
+ }
+
+ @Test
+ public void testCategories() throws Exception
+ {
+
+ // Just verify we can do that, even if it doesn't make much sense
+ new ResourceRequest(new ResourceRequestEnvironment(this), Method.GET, "/restv1/category").run();
+
+ reset();
+
+ new ResourceRequest(requestEnv, Method.GET, "/restv1/category")
+ {
+
+ @Override
+ protected void onResponse(EnhancedMockHttpServletResponse response)
+ {
+ assert response.getStatus() == 200;
+ String[] lines = response.getContentAsString().split("\n");
+ assert lines[0].equals("1,Antiques");
+ assert lines[1].equals("2,Art");
+ assert lines[2].equals("3,Books");
+ }
+
+ }.run();
+
+ reset();
+
+ new ResourceRequest(requestEnv, Method.GET, "/restv1/category/1")
+ {
+
+ @Override
+ protected void onResponse(EnhancedMockHttpServletResponse response)
+ {
+ assert response.getStatus() == 200;
+ assert response.getContentAsString().equals("Antiques");
+ }
+
+ }.run();
+
+ }
+
+ @Test
+ public void testAuctions() throws Exception
+ {
+
+ new ResourceRequest(requestEnv, Method.GET, "/restv1/auction")
+ {
+
+ @Override
+ protected void onResponse(EnhancedMockHttpServletResponse response)
+ {
+ assert response.getStatus() == 200;
+ // TODO: Assert content
+ }
+
+ }.run();
+
+ reset();
+
+ new ResourceRequest(requestEnv, Method.GET, "/restv1/auction/19264723")
+ {
+
+ @Override
+ protected void onResponse(EnhancedMockHttpServletResponse response)
+ {
+ assert response.getStatus() == 200;
+ assert response.getContentAsString().equals("Whistler's Mother, original painting by James McNeill Whistler");
+ }
+
+ }.run();
+
+ }
+
+}
Added: branches/enterprise/WFK-2_1/examples/restbay/restbay-ejb/src/test/java/org/jboss/seam/example/restbay/test/BasicServiceTest.java
===================================================================
--- branches/enterprise/WFK-2_1/examples/restbay/restbay-ejb/src/test/java/org/jboss/seam/example/restbay/test/BasicServiceTest.java (rev 0)
+++ branches/enterprise/WFK-2_1/examples/restbay/restbay-ejb/src/test/java/org/jboss/seam/example/restbay/test/BasicServiceTest.java 2013-06-03 17:00:28 UTC (rev 15529)
@@ -0,0 +1,480 @@
+package org.jboss.seam.example.restbay.test;
+
+import org.jboss.arquillian.container.test.api.Deployment;
+import org.jboss.arquillian.container.test.api.OverProtocol;
+import org.jboss.arquillian.junit.Arquillian;
+import org.jboss.seam.mock.EnhancedMockHttpServletResponse;
+import org.jboss.seam.mock.EnhancedMockHttpServletRequest;
+import org.jboss.seam.mock.JUnitSeamTest;
+import org.jboss.seam.mock.ResourceRequestEnvironment;
+import org.jboss.shrinkwrap.api.Archive;
+import org.jboss.shrinkwrap.api.spec.EnterpriseArchive;
+import org.jboss.shrinkwrap.api.spec.WebArchive;
+
+import static org.jboss.seam.mock.ResourceRequestEnvironment.Method;
+import static org.jboss.seam.mock.ResourceRequestEnvironment.ResourceRequest;
+
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import static org.junit.Assert.*;
+
+import javax.servlet.http.Cookie;
+import javax.ws.rs.core.MediaType;
+import java.util.Map;
+import java.util.HashMap;
+
+/**
+ * <p>
+ * This is the test matrix for resources:
+ * </p>
+ *
+ * <pre>
+ * | EVENT | CONVERSATION | SESSION | APPLICATION | STATELESS
+ * ---------------------------------------------------------------------------------------------
+ * Plain JAX-RS Resource | OK | - | - | - | -
+ * ---------------------------------------------------------------------------------------------
+ * POJO Seam Component Resource | OK | ? | ? | OK | OK
+ * ---------------------------------------------------------------------------------------------
+ * POJO interface-annotated Component | OK | ? | ? | OK | OK
+ * ---------------------------------------------------------------------------------------------
+ * EJB Plain SLSB Resource | - | - | - | - | OK
+ * ---------------------------------------------------------------------------------------------
+ * EJB SLSB Seam Component Resource | - | - | - | - | OK
+ * ---------------------------------------------------------------------------------------------
+ * EJB SFSB Seam Component Resource | ? | ? | ? | ? | -
+ * ---------------------------------------------------------------------------------------------
+ * </pre>
+ *
+ * <p>
+ * Note that all EJB resources are always @Path annotated on their interface, not the implementation class.
+ * </p>
+ *
+ * <p>
+ * This is the test matrix for providers:
+ * </p>
+ *
+ * <pre>
+ * | EVENT | CONVERSATION | SESSION | APPLICATION | STATELESS
+ * ---------------------------------------------------------------------------------------------
+ * Plain JAX-RS Provider | - | - | - | - | OK
+ * ---------------------------------------------------------------------------------------------
+ * RESTEasy StringConverter Provider | - | - | - | - | OK
+ * ---------------------------------------------------------------------------------------------
+ * RESTEasy StringConverter Component | ? | - | - | ? | ?
+ * ---------------------------------------------------------------------------------------------
+ * POJO Seam Component Provider | ? | - | - | OK | ?
+ * ---------------------------------------------------------------------------------------------
+ * POJO interface-annotated Component | ? | - | - | OK | ?
+ * ---------------------------------------------------------------------------------------------
+ * EJB Plain SLSB Provider | - | - | - | - | ?
+ * ---------------------------------------------------------------------------------------------
+ * EJB SLSB Seam Component Provider | - | - | - | - | ?
+ * ---------------------------------------------------------------------------------------------
+ * EJB SFSB Seam Component Resource | ? | - | - | ? | -
+ * ---------------------------------------------------------------------------------------------
+ * </pre>
+ *
+ */
+(a)RunWith(Arquillian.class)
+public class BasicServiceTest extends JUnitSeamTest
+{
+ @Deployment(name="BasicServiceTest")
+ @OverProtocol("Servlet 3.0")
+ public static Archive<?> createDeployment()
+ {
+ return Deployments.restbayDeployment();
+ }
+
+ ResourceRequestEnvironment requestEnv;
+
+ @Before
+ public void prepareEnv() throws Exception
+ {
+ requestEnv = new ResourceRequestEnvironment(this)
+ {
+ @Override
+ public Map<String, Object> getDefaultHeaders()
+ {
+ return new HashMap<String, Object>()
+ {{
+ put("Accept", "text/plain");
+ }};
+ }
+
+ @Override
+ public String getServletPath()
+ {
+ return "/override/seam/resource/is/not/my/path/for/SeamResourceServlet";
+ }
+
+ };
+ }
+
+ public String[] getQueryPaths()
+ {
+ return new String[] {
+ "/restv1/plainTest",
+
+ "/restv1/eventComponentTest",
+ "/restv1/applicationComponentTest",
+ "/restv1/statelessComponentTest",
+
+ "/restv1/interfaceEventComponentTest",
+ "/restv1/interfaceApplicationComponentTest",
+ "/restv1/interfaceStatelessComponentTest",
+
+ "/restv1/statelessEjbTest",
+ "/restv1/statelessEjbComponentTest"
+ };
+ }
+
+ @Test
+ public void testRootResource() throws Exception {
+ new ResourceRequest(requestEnv, Method.GET, "/restv1/")
+ {
+
+ @Override
+ protected void onResponse(EnhancedMockHttpServletResponse response)
+ {
+ assertEquals(200, response.getStatus());
+ assertEquals("Root", response.getContentAsString());
+ }
+
+ }.run();
+ }
+
+ @Test
+ public void testExeptionMapping() throws Exception
+ {
+ for (String resourcePath : getQueryPaths())
+ {
+ new ResourceRequest(requestEnv, Method.GET, resourcePath + "/trigger/unsupported")
+ {
+
+ @Override
+ protected void onResponse(EnhancedMockHttpServletResponse response)
+ {
+ assert response.getStatus() == 501;
+ assert response.getStatusMessage().equals("The request operation is not supported: foo");
+ }
+
+ }.run();
+ }
+ }
+
+ @Test
+ public void testEchos() throws Exception
+ {
+ for (String resourcePath : getQueryPaths())
+ {
+ new ResourceRequest(requestEnv, Method.GET, resourcePath + "/echouri")
+ {
+
+ @Override
+ protected void onResponse(EnhancedMockHttpServletResponse response)
+ {
+ assert response.getStatus() == 200;
+ assert response.getContentAsString().endsWith("/echouri");
+ }
+
+ }.run();
+
+ reset();
+
+ new ResourceRequest(requestEnv, Method.GET, resourcePath + "/echoquery")
+ {
+
+ @Override
+ protected void prepareRequest(EnhancedMockHttpServletRequest request)
+ {
+ request.setQueryString("asdf=123");
+ request.addQueryParameter("bar", "bbb");
+ request.addQueryParameter("baz", "bzzz");
+ }
+
+ @Override
+ protected void onResponse(EnhancedMockHttpServletResponse response)
+ {
+ assert response.getStatus() == 200;
+ assert response.getContentAsString().equals("bbb");
+ }
+
+ }.run();
+
+ reset();
+
+ new ResourceRequest(requestEnv, Method.GET, resourcePath + "/echoheader")
+ {
+
+ @Override
+ protected void prepareRequest(EnhancedMockHttpServletRequest request)
+ {
+ request.addHeader("bar", "baz");
+ }
+
+ @Override
+ protected void onResponse(EnhancedMockHttpServletResponse response)
+ {
+ assert response.getStatus() == 200;
+ assert response.getContentAsString().equals("baz");
+ }
+
+ }.run();
+
+ reset();
+
+ new ResourceRequest(requestEnv, Method.GET, resourcePath + "/echocookie")
+ {
+
+ @Override
+ protected void prepareRequest(EnhancedMockHttpServletRequest request)
+ {
+ request.addCookie(new Cookie("bar", "baz"));
+ }
+
+ @Override
+ protected void onResponse(EnhancedMockHttpServletResponse response)
+ {
+ assert response.getStatus() == 200;
+ assert response.getContentAsString().equals("baz");
+ }
+
+ }.run();
+
+ reset();
+
+ new ResourceRequest(requestEnv, Method.GET, resourcePath + "/foo/bar/asdf")
+ {
+
+ @Override
+ protected void onResponse(EnhancedMockHttpServletResponse response)
+ {
+
+ assert response.getStatus() == 200;
+ assert response.getContentAsString().equals("bar: asdf");
+ }
+
+ }.run();
+
+ reset();
+
+ new ResourceRequest(requestEnv, Method.GET, resourcePath + "/echotwoparams/foo/bar")
+ {
+
+ @Override
+ protected void onResponse(EnhancedMockHttpServletResponse response)
+ {
+ assert response.getStatus() == 200;
+ assert response.getContentAsString().equals("foobar");
+ }
+
+ }.run();
+ }
+
+ }
+
+ @Test
+ public void testEncoding() throws Exception
+ {
+ for (String resourcePath : getQueryPaths())
+ {
+ new ResourceRequest(requestEnv, Method.GET, resourcePath + "/echoencoded/foo bar")
+ {
+
+ @Override
+ protected void onResponse(EnhancedMockHttpServletResponse response)
+ {
+ assert response.getStatus() == 200;
+ assert response.getContentAsString().equals("foo%20bar");
+ }
+
+ }.run();
+ }
+ }
+
+ @Test
+ public void testFormHandling() throws Exception
+ {
+ for (String resourcePath : getQueryPaths())
+ {
+ new ResourceRequest(requestEnv, Method.POST, resourcePath + "/echoformparams")
+ {
+
+ @Override
+ protected void prepareRequest(EnhancedMockHttpServletRequest request)
+ {
+ request.setContentType(MediaType.APPLICATION_FORM_URLENCODED);
+ request.addParameter("foo", new String[]
+ {"bar", "baz"});
+ }
+
+ @Override
+ protected void onResponse(EnhancedMockHttpServletResponse response)
+ {
+ assert response.getStatus() == 200;
+ assert response.getContentAsString().equals("barbaz");
+ }
+
+ }.run();
+
+ reset();
+
+ new ResourceRequest(requestEnv, Method.POST, resourcePath + "/echoformparams2")
+ {
+
+ @Override
+ protected void prepareRequest(EnhancedMockHttpServletRequest request)
+ {
+ request.setContentType(MediaType.APPLICATION_FORM_URLENCODED);
+ request.addParameter("foo", new String[]
+ {"bar", "baz"});
+ }
+
+ @Override
+ protected void onResponse(EnhancedMockHttpServletResponse response)
+ {
+ assert response.getStatus() == 200;
+ assert response.getContentAsString().equals("barbaz");
+ }
+
+ }.run();
+
+ reset();
+
+ new ResourceRequest(requestEnv, Method.POST, resourcePath + "/echoformparams3")
+ {
+
+ @Override
+ protected void prepareRequest(EnhancedMockHttpServletRequest request)
+ {
+ request.setContentType(MediaType.APPLICATION_FORM_URLENCODED);
+ request.addHeader("bar", "foo");
+ request.addParameter("foo", new String[]
+ {"bar", "baz"});
+ }
+
+ @Override
+ protected void onResponse(EnhancedMockHttpServletResponse response)
+ {
+ assert response.getStatus() == 200;
+ assert response.getContentAsString().equals("foobarbaz");
+ }
+
+ }.run();
+
+ reset();
+ }
+ }
+
+ @Test()
+ public void testStringConverter() throws Exception
+ {
+ final String ISO_DATE = "2007-07-10T14:54:56-0500";
+ final String ISO_DATE_MILLIS = "1184097296000";
+
+ for (String resourcePath : getQueryPaths())
+ {
+
+ new ResourceRequest(requestEnv, Method.GET, resourcePath + "/convertDate/" + ISO_DATE)
+ {
+
+ @Override
+ protected void onResponse(EnhancedMockHttpServletResponse response)
+ {
+ assert response.getStatus() == 200;
+ assertEquals(ISO_DATE_MILLIS, response.getContentAsString());
+ }
+
+ }.run();
+ }
+ }
+
+ @Test
+ public void testProvider() throws Exception
+ {
+ for (String resourcePath : getQueryPaths())
+ {
+ new ResourceRequest(requestEnv, Method.GET, resourcePath + "/commaSeparated")
+ {
+
+ @Override
+ protected void prepareRequest(EnhancedMockHttpServletRequest request)
+ {
+ request.addHeader("Accept", "text/csv");
+ }
+
+ @Override
+ protected void onResponse(EnhancedMockHttpServletResponse response)
+ {
+ assert response.getStatus() == 200;
+ assert response.getContentAsString().equals("foo,bar\r\nasdf,123\r\n");
+ }
+
+ }.run();
+
+ reset();
+
+ new ResourceRequest(requestEnv, Method.GET, resourcePath + "/commaSeparatedStrings")
+ {
+
+ @Override
+ protected void prepareRequest(EnhancedMockHttpServletRequest request)
+ {
+ request.addHeader("Accept", "text/plain");
+ }
+
+ @Override
+ protected void onResponse(EnhancedMockHttpServletResponse response)
+ {
+ assert response.getStatus() == 200;
+ assert response.getContentAsString().equals("abc,foo,bar,baz");
+ }
+
+ }.run();
+
+ reset();
+
+ new ResourceRequest(requestEnv, Method.GET, resourcePath + "/commaSeparatedIntegers")
+ {
+
+ @Override
+ protected void prepareRequest(EnhancedMockHttpServletRequest request)
+ {
+ request.addHeader("Accept", "text/plain");
+ }
+
+ @Override
+ protected void onResponse(EnhancedMockHttpServletResponse response)
+ {
+ assert response.getStatus() == 200;
+ assert response.getContentAsString().equals("abc,1,2,3");
+ }
+ };
+ // }.run();
+ // TODO: Retracted support for Seam component providers, injection shouldn't happen, see https://jira.jboss.org/jira/browse/JBSEAM-4247
+ }
+ }
+
+ @Test
+ // JBPAPP-3713
+ public void synchronizationsLookup() throws Exception
+ {
+ new ResourceRequest(requestEnv, Method.GET, "/restv1/eventComponentTest/synchronizationsLookup")
+ {
+ @Override
+ protected void prepareRequest(EnhancedMockHttpServletRequest request)
+ {
+ super.prepareRequest(request);
+ }
+
+ @Override
+ protected void onResponse(EnhancedMockHttpServletResponse response)
+ {
+ assertEquals("Unexpected response code.", 200, response.getStatus(), 200);
+ assert response.getContentAsString().equals("true");
+ }
+
+ }.run();
+ }
+}
Added: branches/enterprise/WFK-2_1/examples/restbay/restbay-ejb/src/test/java/org/jboss/seam/example/restbay/test/CategoryServiceDBUnitTest.java
===================================================================
--- branches/enterprise/WFK-2_1/examples/restbay/restbay-ejb/src/test/java/org/jboss/seam/example/restbay/test/CategoryServiceDBUnitTest.java (rev 0)
+++ branches/enterprise/WFK-2_1/examples/restbay/restbay-ejb/src/test/java/org/jboss/seam/example/restbay/test/CategoryServiceDBUnitTest.java 2013-06-03 17:00:28 UTC (rev 15529)
@@ -0,0 +1,110 @@
+package org.jboss.seam.example.restbay.test;
+
+import org.dbunit.operation.DatabaseOperation;
+import org.jboss.arquillian.container.test.api.Deployment;
+import org.jboss.arquillian.container.test.api.OverProtocol;
+import org.jboss.arquillian.junit.Arquillian;
+import org.jboss.seam.mock.DBJUnitSeamTest;
+
+import org.jboss.seam.mock.ResourceRequestEnvironment;
+import org.jboss.seam.mock.EnhancedMockHttpServletRequest;
+import org.jboss.seam.mock.EnhancedMockHttpServletResponse;
+import org.jboss.shrinkwrap.api.Archive;
+import org.jboss.shrinkwrap.api.spec.EnterpriseArchive;
+import org.jboss.shrinkwrap.api.spec.WebArchive;
+import org.jboss.shrinkwrap.resolver.api.maven.Maven;
+
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+import static org.jboss.seam.mock.ResourceRequestEnvironment.ResourceRequest;
+import static org.jboss.seam.mock.ResourceRequestEnvironment.Method;
+
+import java.util.Map;
+import java.util.HashMap;
+
+/**
+ *
+ */
+(a)RunWith(Arquillian.class)
+public class CategoryServiceDBUnitTest extends DBJUnitSeamTest
+{
+ @Deployment(name="CategoryServiceDBUnitTest")
+ @OverProtocol("Servlet 3.0")
+ public static Archive<?> createDeployment()
+ {
+ WebArchive web = Deployments.restbayDeployment();
+ web.addAsLibraries(Maven.resolver().loadPomFromFile("pom.xml")
+ .resolve("org.dbunit:dbunit:jar:2.2")
+ .withoutTransitivity()
+ .asFile());
+
+ web.addAsResource("org/jboss/seam/example/restbay/test/dbunitdata.xml", "org/jboss/seam/example/restbay/test/dbunitdata.xml");
+
+ return web;
+ }
+
+ protected void prepareDBUnitOperations() {
+
+ setDatabase("hsql");
+ setDatasourceJndiName("java:/jboss/datasources/ExampleDS");
+
+ beforeTestOperations.add(
+ new DataSetOperation("org/jboss/seam/example/restbay/test/dbunitdata.xml", DatabaseOperation.CLEAN_INSERT)
+ );
+ }
+
+ // Or, if you don't want shared headers between test methods, just use
+ // it directly in your test method:
+
+ // new ResourceRequest(new ResourceRequestTest(this), Method.GET, ...).run();
+
+ ResourceRequestEnvironment sharedEnvironment;
+ @Before
+ public void prepareSharedEnvironment() throws Exception
+ {
+ sharedEnvironment = new ResourceRequestEnvironment(this)
+ {
+ @Override
+ public Map<String, Object> getDefaultHeaders()
+ {
+ return new HashMap<String, Object>()
+ {{
+ put("Accept", "text/plain");
+ }};
+ }
+ };
+ }
+
+ @Test
+ public void testCategories() throws Exception
+ {
+ // new ResourceRequest(new ResourceRequestEnvironment(this), Method.GET, "/restv1/category")
+ // or:
+ new ResourceRequest(sharedEnvironment, Method.GET, "/restv1/category")
+ {
+
+ @Override
+ protected void prepareRequest(EnhancedMockHttpServletRequest request)
+ {
+ // Or set it as default in environment
+ request.addHeader("Accept", "text/plain");
+ }
+
+ @Override
+ protected void onResponse(EnhancedMockHttpServletResponse response)
+ {
+ assert response.getStatus() == 200;
+ String[] lines = response.getContentAsString().split("\n");
+ assert lines[0].equals("16,foo");
+ assert lines[1].equals("17,bar");
+ assert lines[2].equals("18,baz");
+ }
+
+ }.run();
+
+ }
+
+
+}
Added: branches/enterprise/WFK-2_1/examples/restbay/restbay-ejb/src/test/java/org/jboss/seam/example/restbay/test/ContextDataTest.java
===================================================================
--- branches/enterprise/WFK-2_1/examples/restbay/restbay-ejb/src/test/java/org/jboss/seam/example/restbay/test/ContextDataTest.java (rev 0)
+++ branches/enterprise/WFK-2_1/examples/restbay/restbay-ejb/src/test/java/org/jboss/seam/example/restbay/test/ContextDataTest.java 2013-06-03 17:00:28 UTC (rev 15529)
@@ -0,0 +1,67 @@
+package org.jboss.seam.example.restbay.test;
+
+import static org.junit.Assert.assertEquals;
+
+import org.jboss.arquillian.container.test.api.Deployment;
+import org.jboss.arquillian.container.test.api.OverProtocol;
+import org.jboss.arquillian.junit.Arquillian;
+import org.jboss.seam.mock.EnhancedMockHttpServletRequest;
+import org.jboss.seam.mock.EnhancedMockHttpServletResponse;
+import org.jboss.seam.mock.JUnitSeamTest;
+import org.jboss.seam.mock.ResourceRequestEnvironment;
+import org.jboss.seam.mock.ResourceRequestEnvironment.Method;
+import org.jboss.seam.mock.ResourceRequestEnvironment.ResourceRequest;
+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;
+
+/**
+ *
+ * @author Jozef Hartinger
+ */
+(a)RunWith(Arquillian.class)
+public class ContextDataTest extends JUnitSeamTest
+{
+ @Deployment(name="ContextDataTest")
+ @OverProtocol("Servlet 3.0")
+ public static Archive<?> createDeployment()
+ {
+ return Deployments.restbayDeployment();
+ }
+
+ public String[] getContextDataTypePaths()
+ {
+ return new String[]{ "/providers", "/registry", "/dispatcher" };
+ }
+
+ @Test
+ public void testContextData() throws Exception
+ {
+
+ for (String pathSegment : getContextDataTypePaths())
+ {
+ String path = "/restv1/contextData" + pathSegment;
+
+ new ResourceRequest(new ResourceRequestEnvironment(this), Method.GET, path)
+ {
+
+ @Override
+ protected void prepareRequest(EnhancedMockHttpServletRequest request)
+ {
+ super.prepareRequest(request);
+ request.addHeader("Accept", "text/plain");
+ }
+
+ @Override
+ protected void onResponse(EnhancedMockHttpServletResponse response)
+ {
+ assertEquals("Unexpected response code.", 200, response.getStatus());
+ assertEquals("Unexpected response.", "true", response.getContentAsString());
+ }
+
+ }.run();
+ }
+ }
+}
Added: branches/enterprise/WFK-2_1/examples/restbay/restbay-ejb/src/test/java/org/jboss/seam/example/restbay/test/Deployments.java
===================================================================
--- branches/enterprise/WFK-2_1/examples/restbay/restbay-ejb/src/test/java/org/jboss/seam/example/restbay/test/Deployments.java (rev 0)
+++ branches/enterprise/WFK-2_1/examples/restbay/restbay-ejb/src/test/java/org/jboss/seam/example/restbay/test/Deployments.java 2013-06-03 17:00:28 UTC (rev 15529)
@@ -0,0 +1,44 @@
+package org.jboss.seam.example.restbay.test;
+
+import org.jboss.shrinkwrap.api.ShrinkWrap;
+import org.jboss.shrinkwrap.api.importer.ZipImporter;
+import org.jboss.shrinkwrap.api.spec.EnterpriseArchive;
+import org.jboss.shrinkwrap.api.spec.WebArchive;
+import org.jboss.shrinkwrap.resolver.api.maven.Maven;
+
+import java.io.File;
+
+public class Deployments {
+ public static WebArchive restbayDeployment() {
+ File[] libs = Maven.resolver().loadPomFromFile("pom.xml")
+ .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();
+
+ WebArchive war = ShrinkWrap.create(WebArchive.class, "seam-restbay.war")
+ .addPackages(false, "org.jboss.seam.example.restbay")
+ .addPackages(true, "org.jboss.seam.example.restbay.resteasy")
+
+ // already in EJB module
+ .addAsWebInfResource("import.sql", "classes/import.sql")
+ .addAsWebInfResource("seam.properties", "classes/seam.properties")
+ .addAsWebInfResource("META-INF/ejb-jar.xml", "ejb-jar.xml")
+
+ // test specific persistence.xml
+ .addAsWebInfResource("persistence.xml", "classes/META-INF/persistence.xml")
+
+ // manually copied from Web module
+ .addAsWebInfResource("pages.xml", "pages.xml")
+
+ // manually copied from Web module, modified
+ .addAsWebInfResource("web.xml", "web.xml") // only contains MockSeamListener definition
+ .addAsWebInfResource("components.xml", "components.xml") // corrected ejb component jndi-name references from java:app/jboss-seam to java:app/seam-restbay
+
+ // manually copied from EAR module
+ .addAsWebInfResource("jboss-deployment-structure.xml", "jboss-deployment-structure.xml")
+ .addAsLibraries(libs);
+
+ return war;
+ }
+}
Added: branches/enterprise/WFK-2_1/examples/restbay/restbay-ejb/src/test/java/org/jboss/seam/example/restbay/test/ResourceHomeTest.java
===================================================================
--- branches/enterprise/WFK-2_1/examples/restbay/restbay-ejb/src/test/java/org/jboss/seam/example/restbay/test/ResourceHomeTest.java (rev 0)
+++ branches/enterprise/WFK-2_1/examples/restbay/restbay-ejb/src/test/java/org/jboss/seam/example/restbay/test/ResourceHomeTest.java 2013-06-03 17:00:28 UTC (rev 15529)
@@ -0,0 +1,194 @@
+package org.jboss.seam.example.restbay.test;
+
+import static org.junit.Assert.assertEquals;
+
+import org.jboss.arquillian.container.test.api.Deployment;
+import org.jboss.arquillian.container.test.api.OverProtocol;
+import org.jboss.arquillian.junit.Arquillian;
+import org.jboss.seam.mock.EnhancedMockHttpServletRequest;
+import org.jboss.seam.mock.EnhancedMockHttpServletResponse;
+import org.jboss.seam.mock.JUnitSeamTest;
+
+import static org.jboss.seam.mock.ResourceRequestEnvironment.Method;
+import static org.jboss.seam.mock.ResourceRequestEnvironment.ResourceRequest;
+import org.jboss.seam.mock.ResourceRequestEnvironment;
+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;
+
+
+/**
+ *
+ * @author Jozef Hartinger
+ *
+ */
+(a)RunWith(Arquillian.class)
+public class ResourceHomeTest extends JUnitSeamTest
+{
+ @Deployment(name="ResourceHomeTest")
+ @OverProtocol("Servlet 3.0")
+ public static Archive<?> createDeployment()
+ {
+ return Deployments.restbayDeployment();
+ }
+
+ public String[] getQueryPaths()
+ {
+ return new String[]{ "/configuredCategory", "/extendedCategory" };
+ }
+
+ @Test
+ public void testResourceHomeRead() throws Exception
+ {
+ for (String resourcePath : getQueryPaths())
+ {
+ final String expectedResponse = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?><category><categoryId>1</categoryId><name>Antiques</name></category>";
+ final String path = "/restv1" + resourcePath + "/1";
+
+ new ResourceRequest(new ResourceRequestEnvironment(this), Method.GET, path)
+ {
+
+ @Override
+ protected void prepareRequest(EnhancedMockHttpServletRequest request)
+ {
+ super.prepareRequest(request);
+ request.addHeader("Accept", "application/xml");
+ }
+
+ @Override
+ protected void onResponse(EnhancedMockHttpServletResponse response)
+ {
+ assertEquals("Unexpected response.", expectedResponse, response.getContentAsString());
+ }
+
+ }.run();
+ }
+ }
+
+ @Test
+ public void testResourceHomeCreate() throws Exception
+ {
+ for (String resourcePath : getQueryPaths())
+ {
+ final String name = "Airplanes";
+ final String body = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?><category><name>" + name
+ + "</name></category>";
+ final String mediaType = "application/xml";
+ final String path = "/restv1" + resourcePath;
+
+ new ResourceRequest(new ResourceRequestEnvironment(this), Method.POST, path)
+ {
+ @Override
+ protected void prepareRequest(EnhancedMockHttpServletRequest request)
+ {
+ super.prepareRequest(request);
+ // TODO for some reason content type must be set using both these
+ // methods
+ request.addHeader("Content-Type", mediaType);
+ request.setContentType(mediaType);
+ request.setContent(body.getBytes());
+ }
+
+ @Override
+ protected void onResponse(EnhancedMockHttpServletResponse response)
+ {
+ assertEquals("Unexpected response code.", 201, response.getStatus(), 201);
+ }
+
+ }.run();
+ }
+ }
+
+ @Test
+ public void testResourceHomeUpdate() throws Exception
+ {
+ for (String resourcePath : getQueryPaths())
+ {
+ final String body = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?><category><categoryId>5</categoryId><name>"
+ + resourcePath.hashCode() + "</name></category>";
+ final String mediaType = "application/xml";
+ final String path = "/restv1" + resourcePath + "/5";
+
+ new ResourceRequest(new ResourceRequestEnvironment(this), Method.PUT, path)
+ {
+
+ @Override
+ protected void prepareRequest(EnhancedMockHttpServletRequest request)
+ {
+ super.prepareRequest(request);
+ request.setContentType(mediaType);
+ request.addHeader("Content-Type", mediaType);
+ request.setContent(body.getBytes());
+ }
+
+ @Override
+ protected void onResponse(EnhancedMockHttpServletResponse response)
+ {
+ assertEquals("Unexpected response code.", 204, response.getStatus());
+ }
+
+ }.run();
+
+ reset();
+
+ new ResourceRequest(new ResourceRequestEnvironment(this), Method.GET, path)
+ {
+
+ @Override
+ protected void prepareRequest(EnhancedMockHttpServletRequest request)
+ {
+ super.prepareRequest(request);
+ request.addHeader("Accept", mediaType);
+ }
+
+ @Override
+ protected void onResponse(EnhancedMockHttpServletResponse response)
+ {
+ assertEquals("Unexpected response code.", 200, response.getStatus());
+ assertEquals("Unexpected response.", body, response.getContentAsString());
+ }
+
+ }.run();
+ }
+ }
+
+ @Test
+ public void testResourceHomeDelete() throws Exception
+ {
+
+ final String path = "/restv1/configuredCategory/15004";
+
+ new ResourceRequest(new ResourceRequestEnvironment(this), Method.DELETE, path)
+ {
+
+ @Override
+ protected void onResponse(EnhancedMockHttpServletResponse response)
+ {
+ assertEquals("Unexpected response code.", 204, response.getStatus());
+ }
+
+ }.run();
+
+ reset();
+
+ new ResourceRequest(new ResourceRequestEnvironment(this), Method.GET, path)
+ {
+
+ @Override
+ protected void prepareRequest(EnhancedMockHttpServletRequest request)
+ {
+ super.prepareRequest(request);
+ request.addHeader("Accept", "application/xml");
+ }
+
+ @Override
+ protected void onResponse(EnhancedMockHttpServletResponse response)
+ {
+ assertEquals("Unexpected response code.", response.getStatus(), 404);
+ }
+
+ }.run();
+ }
+}
Added: branches/enterprise/WFK-2_1/examples/restbay/restbay-ejb/src/test/java/org/jboss/seam/example/restbay/test/ResourceQueryTest.java
===================================================================
--- branches/enterprise/WFK-2_1/examples/restbay/restbay-ejb/src/test/java/org/jboss/seam/example/restbay/test/ResourceQueryTest.java (rev 0)
+++ branches/enterprise/WFK-2_1/examples/restbay/restbay-ejb/src/test/java/org/jboss/seam/example/restbay/test/ResourceQueryTest.java 2013-06-03 17:00:28 UTC (rev 15529)
@@ -0,0 +1,81 @@
+package org.jboss.seam.example.restbay.test;
+
+import static org.junit.Assert.assertTrue;
+
+import java.util.regex.Pattern;
+
+import org.jboss.arquillian.container.test.api.Deployment;
+import org.jboss.arquillian.container.test.api.OverProtocol;
+import org.jboss.arquillian.junit.Arquillian;
+import org.jboss.seam.mock.EnhancedMockHttpServletRequest;
+import org.jboss.seam.mock.EnhancedMockHttpServletResponse;
+import org.jboss.seam.mock.JUnitSeamTest;
+
+import static org.jboss.seam.mock.ResourceRequestEnvironment.Method;
+import static org.jboss.seam.mock.ResourceRequestEnvironment.ResourceRequest;
+import org.jboss.seam.mock.ResourceRequestEnvironment;
+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;
+
+
+/**
+ *
+ * @author Jozef Hartinger
+ *
+ */
+(a)RunWith(Arquillian.class)
+public class ResourceQueryTest extends JUnitSeamTest
+{
+ @Deployment(name="ResourceQueryTest")
+ @OverProtocol("Servlet 3.0")
+ public static Archive<?> createDeployment()
+ {
+ return Deployments.restbayDeployment();
+ }
+
+ public String[] getQueryPaths()
+ {
+ String[] data = new String[2];
+ data[0] = "/configuredCategory";
+ data[1] = "/extendedCategory";
+ return data;
+ }
+
+ @Test
+ public void testResourceQuery() throws Exception
+ {
+ for (String path : getQueryPaths())
+ {
+ new ResourceRequest(new ResourceRequestEnvironment(this), Method.GET, "/restv1" + path)
+ {
+
+ @Override
+ protected void prepareRequest(EnhancedMockHttpServletRequest request)
+ {
+ super.prepareRequest(request);
+ request.addHeader("Accept", "application/xml");
+ request.setQueryString("start=2&show=2");
+ }
+
+ @Override
+ protected void onResponse(EnhancedMockHttpServletResponse response)
+ {
+ String responseString = response.getContentAsString();
+ String expectedResponseRegex = "<\\?xml version=\"1\\.0\" encoding=\"UTF-8\" standalone=\"yes\"\\?>" +
+ "<collection>" +
+ "(<category>" +
+ "<categoryId>[^<]+</categoryId><name>[^<]+</name>" +
+ "(<parent><categoryId>[^<]+</categoryId><name>[^<]+</name></parent>)?" +
+ "</category>){2}" +
+ "</collection>";
+ assertTrue("The response string doesn't match the expected response. " + responseString, Pattern.matches(expectedResponseRegex, responseString));
+ }
+
+ }.run();
+ }
+ }
+
+}
Added: branches/enterprise/WFK-2_1/examples/restbay/restbay-ejb/src/test/java/org/jboss/seam/example/restbay/test/SecurityTest.java
===================================================================
--- branches/enterprise/WFK-2_1/examples/restbay/restbay-ejb/src/test/java/org/jboss/seam/example/restbay/test/SecurityTest.java (rev 0)
+++ branches/enterprise/WFK-2_1/examples/restbay/restbay-ejb/src/test/java/org/jboss/seam/example/restbay/test/SecurityTest.java 2013-06-03 17:00:28 UTC (rev 15529)
@@ -0,0 +1,225 @@
+package org.jboss.seam.example.restbay.test;
+
+import org.jboss.arquillian.container.test.api.Deployment;
+import org.jboss.arquillian.container.test.api.OverProtocol;
+import org.jboss.arquillian.junit.Arquillian;
+import org.jboss.seam.mock.EnhancedMockHttpServletRequest;
+import org.jboss.seam.mock.EnhancedMockHttpServletResponse;
+import org.jboss.seam.mock.JUnitSeamTest;
+import org.jboss.seam.mock.ResourceRequestEnvironment;
+import org.jboss.shrinkwrap.api.Archive;
+import org.jboss.shrinkwrap.api.spec.EnterpriseArchive;
+import org.jboss.shrinkwrap.api.spec.WebArchive;
+
+import static org.jboss.seam.mock.ResourceRequestEnvironment.Method;
+import static org.jboss.seam.mock.ResourceRequestEnvironment.ResourceRequest;
+
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import static org.junit.Assert.assertEquals;
+
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * This class tests RESTEasy integration together with Seam Security.
+ *
+ * @author Jozef Hartinger
+ */
+(a)RunWith(Arquillian.class)
+public class SecurityTest extends JUnitSeamTest
+{
+ @Deployment(name="SecurityTest")
+ @OverProtocol("Servlet 3.0")
+ public static Archive<?> createDeployment()
+ {
+ return Deployments.restbayDeployment();
+ }
+
+ ResourceRequestEnvironment requestEnv;
+
+ @Before
+ public void prepareEnv() throws Exception
+ {
+ requestEnv = new ResourceRequestEnvironment(this)
+ {
+ @Override
+ public Map<String, Object> getDefaultHeaders()
+ {
+ return new HashMap<String, Object>()
+ {{
+ put("Accept", "text/plain");
+ }};
+ }
+ };
+ }
+
+ @Test
+ public void basicAuthTest() throws Exception
+ {
+ new ResourceRequest(requestEnv, Method.GET, "/restv1/secured/admin")
+ {
+ @Override
+ protected void prepareRequest(EnhancedMockHttpServletRequest request)
+ {
+ super.prepareRequest(request);
+ request.addHeader("Accept", "text/plain");
+ request.addHeader("Authorization", "Basic ZGVtbzpkZW1v"); // demo:demo
+ }
+
+ @Override
+ protected void onResponse(EnhancedMockHttpServletResponse response)
+ {
+ assertEquals("Unexpected response code.", 200, response.getStatus(), 200);
+ assertEquals("Unexpected response.", "false", response.getContentAsString());
+ }
+
+ }.run();
+ }
+
+ @Test
+ public void invalidCredentialsBasicAuthTest() throws Exception
+ {
+ new ResourceRequest(requestEnv, Method.GET, "/restv1/secured")
+ {
+ @Override
+ protected void prepareRequest(EnhancedMockHttpServletRequest request)
+ {
+ super.prepareRequest(request);
+ request.addHeader("Accept", "text/plain");
+ request.addHeader("Authorization", "Basic ZGVtbzpvbWVk"); // demo:omed
+ }
+
+ @Override
+ protected void onResponse(EnhancedMockHttpServletResponse response)
+ {
+ assertEquals(
+ "Invalid authentication header value",
+ "Basic realm=\"Seam RestBay Application\"",
+ response.getHeader("WWW-Authenticate")
+ );
+ assertEquals("Unexpected response code.", 401, response.getStatus());
+ }
+
+ }.run();
+ }
+
+ @Test
+ public void adminRoleTest() throws Exception
+ {
+ new ResourceRequest(requestEnv, Method.GET, "/restv1/secured/admin")
+ {
+ @Override
+ protected void prepareRequest(EnhancedMockHttpServletRequest request)
+ {
+ super.prepareRequest(request);
+ request.addHeader("Accept", "text/plain");
+ request.addHeader("Authorization", "Basic YWRtaW46YWRtaW4="); // admin:admin
+ }
+
+ @Override
+ protected void onResponse(EnhancedMockHttpServletResponse response)
+ {
+ assertEquals("Unexpected response code.", 200, response.getStatus());
+ assertEquals("true", response.getContentAsString());
+ }
+
+ }.run();
+ }
+
+ @Test
+ public void adminRoleTestWithRestriction() throws Exception
+ {
+ new ResourceRequest(requestEnv, Method.GET, "/restv1/secured/restrictedAdmin")
+ {
+ @Override
+ protected void prepareRequest(EnhancedMockHttpServletRequest request)
+ {
+ super.prepareRequest(request);
+ request.addHeader("Accept", "text/plain");
+ request.addHeader("Authorization", "Basic YWRtaW46YWRtaW4="); // admin:admin
+ }
+
+ @Override
+ protected void onResponse(EnhancedMockHttpServletResponse response)
+ {
+ assertEquals("Unexpected response code.", 200, response.getStatus());
+ assertEquals("true", response.getContentAsString());
+ }
+
+ }.run();
+ }
+
+ @Test
+ public void invalidAdminAuthorization() throws Exception
+ {
+ new ResourceRequest(requestEnv, Method.GET, "/restv1/secured/restrictedAdmin")
+ {
+ @Override
+ protected void prepareRequest(EnhancedMockHttpServletRequest request)
+ {
+ super.prepareRequest(request);
+ request.addHeader("Accept", "text/plain");
+ request.addHeader("Authorization", "Basic ZGVtbzpkZW1v"); // demo:demo
+ }
+
+ @Override
+ protected void onResponse(EnhancedMockHttpServletResponse response)
+ {
+ // See AuthorizationException mapping to 403 in pages.xml!
+ assertEquals("Unexpected response code.", 403, response.getStatus());
+ assert response.getStatusMessage().startsWith("Not authorized to access resource");
+ }
+
+ }.run();
+ }
+
+ @Test
+ // JBPAPP-3713
+ public void ejbLookup() throws Exception
+ {
+ new ResourceRequest(requestEnv, Method.GET, "/restv1/secured/ejbLookup")
+ {
+ @Override
+ protected void prepareRequest(EnhancedMockHttpServletRequest request)
+ {
+ super.prepareRequest(request);
+ request.addHeader("Accept", "text/plain");
+ request.addHeader("Authorization", "Basic ZGVtbzpkZW1v"); // demo:demo
+ }
+
+ @Override
+ protected void onResponse(EnhancedMockHttpServletResponse response)
+ {
+ assertEquals("Unexpected response code.", 200, response.getStatus(), 200);
+ assert response.getContentAsString().equals("true");
+ }
+
+ }.run();
+ }
+
+ @Test
+ // JBPAPP-3713
+ public void synchronizationsLookup() throws Exception
+ {
+ new ResourceRequest(requestEnv, Method.GET, "/restv1/secured/synchronizationsLookup")
+ {
+ @Override
+ protected void prepareRequest(EnhancedMockHttpServletRequest request)
+ {
+ super.prepareRequest(request);
+ request.addHeader("Accept", "text/plain");
+ request.addHeader("Authorization", "Basic ZGVtbzpkZW1v"); // demo:demo
+ }
+
+ @Override
+ protected void onResponse(EnhancedMockHttpServletResponse response)
+ {
+ assertEquals("Unexpected response code.", 200, response.getStatus());
+ assert response.getContentAsString().equals("true");
+ }
+
+ }.run();
+ }
+}
Added: branches/enterprise/WFK-2_1/examples/restbay/restbay-ejb/src/test/java/org/jboss/seam/example/restbay/test/SubresourceTest.java
===================================================================
--- branches/enterprise/WFK-2_1/examples/restbay/restbay-ejb/src/test/java/org/jboss/seam/example/restbay/test/SubresourceTest.java (rev 0)
+++ branches/enterprise/WFK-2_1/examples/restbay/restbay-ejb/src/test/java/org/jboss/seam/example/restbay/test/SubresourceTest.java 2013-06-03 17:00:28 UTC (rev 15529)
@@ -0,0 +1,53 @@
+package org.jboss.seam.example.restbay.test;
+
+import org.jboss.arquillian.container.test.api.Deployment;
+import org.jboss.arquillian.container.test.api.OverProtocol;
+import org.jboss.arquillian.junit.Arquillian;
+import org.jboss.seam.mock.EnhancedMockHttpServletRequest;
+import org.jboss.seam.mock.EnhancedMockHttpServletResponse;
+import org.jboss.seam.mock.JUnitSeamTest;
+import org.jboss.seam.mock.ResourceRequestEnvironment;
+import org.jboss.seam.mock.ResourceRequestEnvironment.Method;
+import org.jboss.seam.mock.ResourceRequestEnvironment.ResourceRequest;
+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 static org.junit.Assert.assertEquals;
+import org.junit.runner.RunWith;
+
+(a)RunWith(Arquillian.class)
+public class SubresourceTest extends JUnitSeamTest
+{
+ @Deployment(name="SubresourceTest")
+ @OverProtocol("Servlet 3.0")
+ public static Archive<?> createDeployment()
+ {
+ return Deployments.restbayDeployment();
+ }
+
+ @Test
+ public void testSubresourceGET() throws Exception
+ {
+ final String path = "/restv1/garage/1";
+
+ new ResourceRequest(new ResourceRequestEnvironment(this), Method.GET, path)
+ {
+
+ @Override
+ protected void prepareRequest(EnhancedMockHttpServletRequest request)
+ {
+ super.prepareRequest(request);
+ request.addHeader("Accept", "text/plain");
+ }
+
+ @Override
+ protected void onResponse(EnhancedMockHttpServletResponse response)
+ {
+ assertEquals("Unexpected response code.", 200, response.getStatus());
+ assertEquals("Unexpected response.", "Honda", response.getContentAsString());
+ }
+
+ }.run();
+ }
+}
Added: branches/enterprise/WFK-2_1/examples/restbay/restbay-ejb/src/test/resources/arquillian.xml
===================================================================
(Binary files differ)
Property changes on: branches/enterprise/WFK-2_1/examples/restbay/restbay-ejb/src/test/resources/arquillian.xml
___________________________________________________________________
Added: svn:mime-type
+ application/xml
Added: branches/enterprise/WFK-2_1/examples/restbay/restbay-ejb/src/test/resources/components.xml
===================================================================
(Binary files differ)
Property changes on: branches/enterprise/WFK-2_1/examples/restbay/restbay-ejb/src/test/resources/components.xml
___________________________________________________________________
Added: svn:mime-type
+ application/xml
Added: branches/enterprise/WFK-2_1/examples/restbay/restbay-ejb/src/test/resources/jboss-deployment-structure.xml
===================================================================
--- branches/enterprise/WFK-2_1/examples/restbay/restbay-ejb/src/test/resources/jboss-deployment-structure.xml (rev 0)
+++ branches/enterprise/WFK-2_1/examples/restbay/restbay-ejb/src/test/resources/jboss-deployment-structure.xml 2013-06-03 17:00:28 UTC (rev 15529)
@@ -0,0 +1,9 @@
+<jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.0">
+ <deployment>
+ <dependencies>
+ <module name="org.dom4j" export="true"/>
+ <module name="org.apache.commons.collections" export="true"/>
+ <module name="javax.faces.api" export="true"/>
+ </dependencies>
+ </deployment>
+</jboss-deployment-structure>
Added: branches/enterprise/WFK-2_1/examples/restbay/restbay-ejb/src/test/resources/org/jboss/seam/example/restbay/test/dbunitdata.xml
===================================================================
(Binary files differ)
Property changes on: branches/enterprise/WFK-2_1/examples/restbay/restbay-ejb/src/test/resources/org/jboss/seam/example/restbay/test/dbunitdata.xml
___________________________________________________________________
Added: svn:mime-type
+ application/xml
Added: branches/enterprise/WFK-2_1/examples/restbay/restbay-ejb/src/test/resources/pages.xml
===================================================================
(Binary files differ)
Property changes on: branches/enterprise/WFK-2_1/examples/restbay/restbay-ejb/src/test/resources/pages.xml
___________________________________________________________________
Added: svn:mime-type
+ application/xml
Added: branches/enterprise/WFK-2_1/examples/restbay/restbay-ejb/src/test/resources/persistence.xml
===================================================================
(Binary files differ)
Property changes on: branches/enterprise/WFK-2_1/examples/restbay/restbay-ejb/src/test/resources/persistence.xml
___________________________________________________________________
Added: svn:mime-type
+ application/xml
Added: branches/enterprise/WFK-2_1/examples/restbay/restbay-ejb/src/test/resources/web.xml
===================================================================
(Binary files differ)
Property changes on: branches/enterprise/WFK-2_1/examples/restbay/restbay-ejb/src/test/resources/web.xml
___________________________________________________________________
Added: svn:mime-type
+ application/xml
Modified: branches/enterprise/WFK-2_1/examples/restbay/restbay-web/pom.xml
===================================================================
--- branches/enterprise/WFK-2_1/examples/restbay/restbay-web/pom.xml 2013-06-03 16:49:04 UTC (rev 15528)
+++ branches/enterprise/WFK-2_1/examples/restbay/restbay-web/pom.xml 2013-06-03 17:00:28 UTC (rev 15529)
@@ -62,6 +62,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
+ <version>${version.war.plugin}</version>
<configuration>
<webResources>
<resource>
11 years, 5 months
Seam SVN: r15528 - in branches/enterprise/WFK-2_1/examples: booking and 3 other directories.
by seam-commits@lists.jboss.org
Author: rsmeral
Date: 2013-06-03 12:49:04 -0400 (Mon, 03 Jun 2013)
New Revision: 15528
Removed:
branches/enterprise/WFK-2_1/examples/blog/blog-tests/
branches/enterprise/WFK-2_1/examples/blog/readme.txt
branches/enterprise/WFK-2_1/examples/booking/booking-tests/
branches/enterprise/WFK-2_1/examples/booking/readme.txt
branches/enterprise/WFK-2_1/examples/groovybooking/groovybooking-tests/
branches/enterprise/WFK-2_1/examples/groovybooking/readme.txt
branches/enterprise/WFK-2_1/examples/hibernate/hibernate-tests/
branches/enterprise/WFK-2_1/examples/hibernate/readme.txt
branches/enterprise/WFK-2_1/examples/jee6/jee6-tests/
branches/enterprise/WFK-2_1/examples/jee6/readme.txt
Log:
blog, booking, groovybooking, hibernate, jee6 converted, removed files
Deleted: branches/enterprise/WFK-2_1/examples/blog/readme.txt
===================================================================
--- branches/enterprise/WFK-2_1/examples/blog/readme.txt 2013-06-03 16:48:33 UTC (rev 15527)
+++ branches/enterprise/WFK-2_1/examples/blog/readme.txt 2013-06-03 16:49:04 UTC (rev 15528)
@@ -1,19 +0,0 @@
-Seam Blog Example
-=================
-
-This example demonstrates the use of Seam in a Java EE environment.
-Transaction and persistence context management is handled by the EJB container.
-
-To deploy the example, follow these steps:
-
-* In the example root directory run:
-
- mvn clean install
-
-* Set JBOSS_HOME environment property.
-
-* In the blog-ear directory run:
-
- mvn jboss-as:deploy
-
-* Open this URL in a web browser: http://localhost:8080/seam-blog
Deleted: branches/enterprise/WFK-2_1/examples/booking/readme.txt
===================================================================
--- branches/enterprise/WFK-2_1/examples/booking/readme.txt 2013-06-03 16:48:33 UTC (rev 15527)
+++ branches/enterprise/WFK-2_1/examples/booking/readme.txt 2013-06-03 16:49:04 UTC (rev 15528)
@@ -1,36 +0,0 @@
-Seam Booking Example
-====================
-
-This example demonstrates the use of Seam in a Java EE 6 environment.
-Transaction and persistence context management is handled by the
-EJB container. This example runs on JBoss AS as an EAR
-
-To deploy the example to JBossAS, follow these steps:
-
-* In the example root directory run:
-
- mvn clean install
-
-* In the booking-ear directory run:
-
- mvn jboss-as:deploy
-
-* Open this URL in a web browser: http://localhost:8080/seam-booking
-
-Or to deploy it using Ant:
-
-* In the example root directory run:
-
- ant clean package
-
-* Or if you don't have have seam installation at standard location,
- you have to specify it via seam.dir property:
-
- ant clean package -Dseam.dir=/path/to/your/seam/installation
-
-* Copy seam-booking.ear from directory booking-ear/target to the
- deployment directory of JBossAS ($JBOSS_HOME/standalone/deployments
- by default)
-
-* Open this URL in a web browser: http://localhost:8080/seam-booking
-
Deleted: branches/enterprise/WFK-2_1/examples/groovybooking/readme.txt
===================================================================
--- branches/enterprise/WFK-2_1/examples/groovybooking/readme.txt 2013-06-03 16:48:33 UTC (rev 15527)
+++ branches/enterprise/WFK-2_1/examples/groovybooking/readme.txt 2013-06-03 16:49:04 UTC (rev 15528)
@@ -1,19 +0,0 @@
-Seam GroovyBooking Example
-==========================
-
-This is the Hotel Booking example implemented in Groovy Beans and Hibernate JPA.
-The application is deployed as an *exploded* WAR rather than an EAR.
-
-To deploy the example, follow these steps:
-
-* In the example root directory run:
-
- mvn clean install
-
-* Set JBOSS_HOME environment property.
-
-* In the groovybooking-web directory run:
-
- mvn jboss-as:deploy
-
-* Open this URL in a web browser: http://localhost:8080/groovybooking-web
Deleted: branches/enterprise/WFK-2_1/examples/hibernate/readme.txt
===================================================================
--- branches/enterprise/WFK-2_1/examples/hibernate/readme.txt 2013-06-03 16:48:33 UTC (rev 15527)
+++ branches/enterprise/WFK-2_1/examples/hibernate/readme.txt 2013-06-03 16:49:04 UTC (rev 15528)
@@ -1,18 +0,0 @@
-Seam Hibernate Example
-======================
-
-This is the Hotel Booking example implemented in Seam and Hibernate POJOs.
-
-To deploy the example, follow these steps:
-
-* In the example root directory run:
-
- mvn clean install
-
-* Set JBOSS_HOME environment property.
-
-* In the hibernate-web directory run:
-
- mvn jboss-as:deploy
-
-* Open this URL in a web browser: http://localhost:8080/hibernate-web
Deleted: branches/enterprise/WFK-2_1/examples/jee6/readme.txt
===================================================================
--- branches/enterprise/WFK-2_1/examples/jee6/readme.txt 2013-06-03 16:48:33 UTC (rev 15527)
+++ branches/enterprise/WFK-2_1/examples/jee6/readme.txt 2013-06-03 16:49:04 UTC (rev 15528)
@@ -1,19 +0,0 @@
-Seam Booking Example
-====================
-
-This example demonstrates the use of Seam in a Java EE 6 environment.
-Transaction and persistence context management is handled by the
-EJB container. This example runs on JBoss AS as a WAR
-
-To deploy the example to JBossAS, follow these steps:
-
-* In the example root directory run:
-
- mvn clean install
-
-* In the booking-web directory run:
-
- mvn jboss-as:deploy
-
-* Open this URL in a web browser: http://localhost:8080/jee6-web
-
11 years, 5 months
Seam SVN: r15527 - in branches/enterprise/WFK-2_1/examples/remoting/helloworld: helloworld-ear and 1 other directories.
by seam-commits@lists.jboss.org
Author: maschmid
Date: 2013-06-03 12:48:33 -0400 (Mon, 03 Jun 2013)
New Revision: 15527
Removed:
branches/enterprise/WFK-2_1/examples/remoting/helloworld/helloworld-tests/
Modified:
branches/enterprise/WFK-2_1/examples/remoting/helloworld/helloworld-ear/pom.xml
branches/enterprise/WFK-2_1/examples/remoting/helloworld/helloworld-web/pom.xml
branches/enterprise/WFK-2_1/examples/remoting/helloworld/pom.xml
Log:
migrated helloworld
Modified: branches/enterprise/WFK-2_1/examples/remoting/helloworld/helloworld-ear/pom.xml
===================================================================
--- branches/enterprise/WFK-2_1/examples/remoting/helloworld/helloworld-ear/pom.xml 2013-06-03 16:46:03 UTC (rev 15526)
+++ branches/enterprise/WFK-2_1/examples/remoting/helloworld/helloworld-ear/pom.xml 2013-06-03 16:48:33 UTC (rev 15527)
@@ -48,10 +48,20 @@
<build>
<finalName>seam-helloworld</finalName>
+ <pluginManagement>
+ <plugins>
+ <plugin>
+ <groupId>org.jboss.as.plugins</groupId>
+ <artifactId>jboss-as-maven-plugin</artifactId>
+ <version>${version.jboss.maven.plugin}</version>
+ </plugin>
+ </plugins>
+ </pluginManagement>
<plugins>
<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/remoting/helloworld/helloworld-web/pom.xml
===================================================================
--- branches/enterprise/WFK-2_1/examples/remoting/helloworld/helloworld-web/pom.xml 2013-06-03 16:46:03 UTC (rev 15526)
+++ branches/enterprise/WFK-2_1/examples/remoting/helloworld/helloworld-web/pom.xml 2013-06-03 16:48:33 UTC (rev 15527)
@@ -56,6 +56,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/remoting/helloworld/pom.xml
===================================================================
--- branches/enterprise/WFK-2_1/examples/remoting/helloworld/pom.xml 2013-06-03 16:46:03 UTC (rev 15526)
+++ branches/enterprise/WFK-2_1/examples/remoting/helloworld/pom.xml 2013-06-03 16:48:33 UTC (rev 15527)
@@ -1,15 +1,11 @@
<?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.remoting</groupId>
<artifactId>helloworld</artifactId>
+ <version>2.3.1.Final-redhat-2</version>
<packaging>pom</packaging>
<name>Helloworld Example (EE6)</name>
@@ -17,15 +13,31 @@
<module>helloworld-ejb</module>
<module>helloworld-web</module>
<module>helloworld-ear</module>
- <module>helloworld-tests</module>
+
</modules>
<properties>
<example.name>helloworld</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>
+
+ <version.commons.logging>1.1.1</version.commons.logging>
+
+ <!-- Plugin versions -->
+ <version.dependency.plugin>2.5.1</version.dependency.plugin>
+ <version.surefire.plugin>2.10</version.surefire.plugin>
+ <version.resources.plugin>2.6</version.resources.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.ejb.plugin>2.3</version.ejb.plugin>
+ <version.jboss.maven.plugin>7.4.Final</version.jboss.maven.plugin>
</properties>
<dependencyManagement>
<dependencies>
+ <!-- Modules -->
<dependency>
<groupId>org.jboss.seam.examples.remoting.helloworld</groupId>
<artifactId>helloworld-ejb</artifactId>
@@ -43,7 +55,70 @@
<artifactId>helloworld-ear</artifactId>
<version>${project.version}</version>
</dependency>
+
+ <!-- BOMs -->
+ <dependency>
+ <groupId>org.jboss.seam</groupId>
+ <artifactId>bom</artifactId>
+ <version>${project.version}</version>
+ <type>pom</type>
+ <scope>import</scope>
+ </dependency>
+
+ <!-- Common provided dependencies -->
+ <dependency>
+ <groupId>commons-logging</groupId>
+ <artifactId>commons-logging</artifactId>
+ <version>${version.commons.logging}</version>
+ <scope>provided</scope>
+ </dependency>
+
+ <!-- TestNG is not necessary -->
+ <dependency>
+ <groupId>org.jboss.seam</groupId>
+ <artifactId>jboss-seam</artifactId>
+ <version>${project.version}</version>
+ <exclusions>
+ <exclusion>
+ <groupId>org.testng</groupId>
+ <artifactId>testng</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>junit</groupId>
+ <artifactId>junit</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>
+ </plugin>
+ <plugin>
+ <artifactId>maven-dependency-plugin</artifactId>
+ <version>${version.dependency.plugin}</version>
+ </plugin>
+ <plugin>
+ <artifactId>maven-resources-plugin</artifactId>
+ <version>${version.resources.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>
11 years, 5 months
Seam SVN: r15526 - in branches/enterprise/WFK-2_1/examples/remoting/chatroom: chatroom-ear and 1 other directories.
by seam-commits@lists.jboss.org
Author: maschmid
Date: 2013-06-03 12:46:03 -0400 (Mon, 03 Jun 2013)
New Revision: 15526
Removed:
branches/enterprise/WFK-2_1/examples/remoting/chatroom/chatroom-tests/
Modified:
branches/enterprise/WFK-2_1/examples/remoting/chatroom/chatroom-ear/pom.xml
branches/enterprise/WFK-2_1/examples/remoting/chatroom/chatroom-web/pom.xml
branches/enterprise/WFK-2_1/examples/remoting/chatroom/pom.xml
Log:
migrated chatroom example
Modified: branches/enterprise/WFK-2_1/examples/remoting/chatroom/chatroom-ear/pom.xml
===================================================================
--- branches/enterprise/WFK-2_1/examples/remoting/chatroom/chatroom-ear/pom.xml 2013-06-03 16:41:11 UTC (rev 15525)
+++ branches/enterprise/WFK-2_1/examples/remoting/chatroom/chatroom-ear/pom.xml 2013-06-03 16:46:03 UTC (rev 15526)
@@ -48,10 +48,20 @@
<build>
<finalName>seam-chatroom</finalName>
+ <pluginManagement>
+ <plugins>
+ <plugin>
+ <groupId>org.jboss.as.plugins</groupId>
+ <artifactId>jboss-as-maven-plugin</artifactId>
+ <version>${version.jboss.maven.plugin}</version>
+ </plugin>
+ </plugins>
+ </pluginManagement>
<plugins>
<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/remoting/chatroom/chatroom-web/pom.xml
===================================================================
--- branches/enterprise/WFK-2_1/examples/remoting/chatroom/chatroom-web/pom.xml 2013-06-03 16:41:11 UTC (rev 15525)
+++ branches/enterprise/WFK-2_1/examples/remoting/chatroom/chatroom-web/pom.xml 2013-06-03 16:46:03 UTC (rev 15526)
@@ -64,6 +64,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/remoting/chatroom/pom.xml
===================================================================
--- branches/enterprise/WFK-2_1/examples/remoting/chatroom/pom.xml 2013-06-03 16:41:11 UTC (rev 15525)
+++ branches/enterprise/WFK-2_1/examples/remoting/chatroom/pom.xml 2013-06-03 16:46:03 UTC (rev 15526)
@@ -1,32 +1,46 @@
<?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.remoting</groupId>
<artifactId>chatroom</artifactId>
+ <version>2.3.1.Final-redhat-2</version>
<packaging>pom</packaging>
<name>Chatroom Example (EE6)</name>
+ <properties>
+ <example.name>chatroom</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>
+
+ <jms.provider.file>jboss-seam-chatroom-hornetq-jms.xml</jms.provider.file>
+
+ <version.commons.logging>1.1.1</version.commons.logging>
+
+ <!-- Plugin versions -->
+ <version.dependency.plugin>2.5.1</version.dependency.plugin>
+ <version.surefire.plugin>2.10</version.surefire.plugin>
+ <version.resources.plugin>2.6</version.resources.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.ejb.plugin>2.3</version.ejb.plugin>
+ <version.jboss.maven.plugin>7.4.Final</version.jboss.maven.plugin>
+ </properties>
+
<modules>
<module>chatroom-ejb</module>
<module>chatroom-web</module>
<module>chatroom-ear</module>
- <module>chatroom-tests</module>
+
</modules>
- <properties>
- <example.name>chatroom</example.name>
- <jms.provider.file>jboss-seam-chatroom-hornetq-jms.xml</jms.provider.file>
- </properties>
-
<dependencyManagement>
<dependencies>
+ <!-- Modules -->
<dependency>
<groupId>org.jboss.seam.examples.remoting.chatroom</groupId>
<artifactId>chatroom-ejb</artifactId>
@@ -44,7 +58,68 @@
<artifactId>chatroom-ear</artifactId>
<version>${project.version}</version>
</dependency>
+
+ <!-- BOMs -->
+ <dependency>
+ <groupId>org.jboss.seam</groupId>
+ <artifactId>bom</artifactId>
+ <version>${project.version}</version>
+ <type>pom</type>
+ <scope>import</scope>
+ </dependency>
+
+ <!-- Common dependencies -->
+ <dependency>
+ <groupId>commons-logging</groupId>
+ <artifactId>commons-logging</artifactId>
+ <version>${version.commons.logging}</version>
+ <scope>provided</scope>
+ </dependency>
+
+ <!-- TestNG is not necessary -->
+ <dependency>
+ <groupId>org.jboss.seam</groupId>
+ <artifactId>jboss-seam</artifactId>
+ <version>${project.version}</version>
+ <exclusions>
+ <exclusion>
+ <groupId>org.testng</groupId>
+ <artifactId>testng</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>junit</groupId>
+ <artifactId>junit</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>
+ </plugin>
+ <plugin>
+ <artifactId>maven-dependency-plugin</artifactId>
+ <version>${version.dependency.plugin}</version>
+ </plugin>
+ <plugin>
+ <artifactId>maven-resources-plugin</artifactId>
+ <version>${version.resources.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>
11 years, 5 months
Seam SVN: r15525 - in branches/enterprise/WFK-2_1: examples/blog and 48 other directories.
by seam-commits@lists.jboss.org
Author: rsmeral
Date: 2013-06-03 12:41:11 -0400 (Mon, 03 Jun 2013)
New Revision: 15525
Added:
branches/enterprise/WFK-2_1/build/build.properties
branches/enterprise/WFK-2_1/examples/blog/README.md
branches/enterprise/WFK-2_1/examples/blog/blog-ejb/src/test/
branches/enterprise/WFK-2_1/examples/blog/blog-ejb/src/test/java/
branches/enterprise/WFK-2_1/examples/blog/blog-ejb/src/test/java/org/
branches/enterprise/WFK-2_1/examples/blog/blog-ejb/src/test/java/org/jboss/
branches/enterprise/WFK-2_1/examples/blog/blog-ejb/src/test/java/org/jboss/seam/
branches/enterprise/WFK-2_1/examples/blog/blog-ejb/src/test/java/org/jboss/seam/example/
branches/enterprise/WFK-2_1/examples/blog/blog-ejb/src/test/java/org/jboss/seam/example/blog/
branches/enterprise/WFK-2_1/examples/blog/blog-ejb/src/test/java/org/jboss/seam/example/blog/test/
branches/enterprise/WFK-2_1/examples/blog/blog-ejb/src/test/java/org/jboss/seam/example/blog/test/BlogTest.java
branches/enterprise/WFK-2_1/examples/blog/blog-ejb/src/test/resources/
branches/enterprise/WFK-2_1/examples/blog/blog-ejb/src/test/resources/accessible.properties
branches/enterprise/WFK-2_1/examples/blog/blog-ejb/src/test/resources/arquillian.xml
branches/enterprise/WFK-2_1/examples/blog/blog-ejb/src/test/resources/components.xml
branches/enterprise/WFK-2_1/examples/blog/blog-ejb/src/test/resources/default.properties
branches/enterprise/WFK-2_1/examples/blog/blog-ejb/src/test/resources/infinispan.xml
branches/enterprise/WFK-2_1/examples/blog/blog-ejb/src/test/resources/jboss-deployment-structure.xml
branches/enterprise/WFK-2_1/examples/blog/blog-ejb/src/test/resources/jgroupsConfig.xml
branches/enterprise/WFK-2_1/examples/blog/blog-ejb/src/test/resources/messages.properties
branches/enterprise/WFK-2_1/examples/blog/blog-ejb/src/test/resources/pages.xml
branches/enterprise/WFK-2_1/examples/blog/blog-ejb/src/test/resources/printable.properties
branches/enterprise/WFK-2_1/examples/blog/blog-ejb/src/test/resources/web.xml
branches/enterprise/WFK-2_1/examples/blog/blog-web/src/main/java/
branches/enterprise/WFK-2_1/examples/blog/blog-web/src/test/
branches/enterprise/WFK-2_1/examples/blog/blog-web/src/test/java/
branches/enterprise/WFK-2_1/examples/booking/README.md
branches/enterprise/WFK-2_1/examples/booking/booking-ejb/src/test/
branches/enterprise/WFK-2_1/examples/booking/booking-ejb/src/test/java/
branches/enterprise/WFK-2_1/examples/booking/booking-ejb/src/test/java/org/
branches/enterprise/WFK-2_1/examples/booking/booking-ejb/src/test/java/org/jboss/
branches/enterprise/WFK-2_1/examples/booking/booking-ejb/src/test/java/org/jboss/seam/
branches/enterprise/WFK-2_1/examples/booking/booking-ejb/src/test/java/org/jboss/seam/example/
branches/enterprise/WFK-2_1/examples/booking/booking-ejb/src/test/java/org/jboss/seam/example/booking/
branches/enterprise/WFK-2_1/examples/booking/booking-ejb/src/test/java/org/jboss/seam/example/booking/test/
branches/enterprise/WFK-2_1/examples/booking/booking-ejb/src/test/java/org/jboss/seam/example/booking/test/BookingTest.java
branches/enterprise/WFK-2_1/examples/booking/booking-ejb/src/test/java/org/jboss/seam/example/booking/test/ChangePasswordTest.java
branches/enterprise/WFK-2_1/examples/booking/booking-ejb/src/test/java/org/jboss/seam/example/booking/test/Deployments.java
branches/enterprise/WFK-2_1/examples/booking/booking-ejb/src/test/java/org/jboss/seam/example/booking/test/LoginTest.java
branches/enterprise/WFK-2_1/examples/booking/booking-ejb/src/test/resources/
branches/enterprise/WFK-2_1/examples/booking/booking-ejb/src/test/resources/arquillian.xml
branches/enterprise/WFK-2_1/examples/booking/booking-ejb/src/test/resources/components.xml
branches/enterprise/WFK-2_1/examples/booking/booking-ejb/src/test/resources/jboss-deployment-structure.xml
branches/enterprise/WFK-2_1/examples/booking/booking-ejb/src/test/resources/persistence.xml
branches/enterprise/WFK-2_1/examples/booking/booking-ejb/src/test/resources/web.xml
branches/enterprise/WFK-2_1/examples/groovybooking/README.md
branches/enterprise/WFK-2_1/examples/groovybooking/groovybooking-web/src/main/groovy/action/
branches/enterprise/WFK-2_1/examples/hibernate/README.md
branches/enterprise/WFK-2_1/examples/hibernate/hibernate-web/src/test/
branches/enterprise/WFK-2_1/examples/hibernate/hibernate-web/src/test/java/
branches/enterprise/WFK-2_1/examples/hibernate/hibernate-web/src/test/java/org/
branches/enterprise/WFK-2_1/examples/hibernate/hibernate-web/src/test/java/org/jboss/
branches/enterprise/WFK-2_1/examples/hibernate/hibernate-web/src/test/java/org/jboss/seam/
branches/enterprise/WFK-2_1/examples/hibernate/hibernate-web/src/test/java/org/jboss/seam/example/
branches/enterprise/WFK-2_1/examples/hibernate/hibernate-web/src/test/java/org/jboss/seam/example/hibernate/
branches/enterprise/WFK-2_1/examples/hibernate/hibernate-web/src/test/java/org/jboss/seam/example/hibernate/test/
branches/enterprise/WFK-2_1/examples/hibernate/hibernate-web/src/test/java/org/jboss/seam/example/hibernate/test/BookingTest.java
branches/enterprise/WFK-2_1/examples/hibernate/hibernate-web/src/test/java/org/jboss/seam/example/hibernate/test/ChangePasswordTest.java
branches/enterprise/WFK-2_1/examples/hibernate/hibernate-web/src/test/java/org/jboss/seam/example/hibernate/test/Deployments.java
branches/enterprise/WFK-2_1/examples/hibernate/hibernate-web/src/test/java/org/jboss/seam/example/hibernate/test/LoginTest.java
branches/enterprise/WFK-2_1/examples/hibernate/hibernate-web/src/test/resources/
branches/enterprise/WFK-2_1/examples/hibernate/hibernate-web/src/test/resources/arquillian.xml
branches/enterprise/WFK-2_1/examples/hibernate/hibernate-web/src/test/resources/web.xml
branches/enterprise/WFK-2_1/examples/jee6/README.md
branches/enterprise/WFK-2_1/examples/jee6/jee6-web/src/test/
branches/enterprise/WFK-2_1/examples/jee6/jee6-web/src/test/java/
branches/enterprise/WFK-2_1/examples/jee6/jee6-web/src/test/java/org/
branches/enterprise/WFK-2_1/examples/jee6/jee6-web/src/test/java/org/jboss/
branches/enterprise/WFK-2_1/examples/jee6/jee6-web/src/test/java/org/jboss/seam/
branches/enterprise/WFK-2_1/examples/jee6/jee6-web/src/test/java/org/jboss/seam/example/
branches/enterprise/WFK-2_1/examples/jee6/jee6-web/src/test/java/org/jboss/seam/example/booking/
branches/enterprise/WFK-2_1/examples/jee6/jee6-web/src/test/java/org/jboss/seam/example/booking/test/
branches/enterprise/WFK-2_1/examples/jee6/jee6-web/src/test/java/org/jboss/seam/example/booking/test/BookingTest.java
branches/enterprise/WFK-2_1/examples/jee6/jee6-web/src/test/java/org/jboss/seam/example/booking/test/ChangePasswordTest.java
branches/enterprise/WFK-2_1/examples/jee6/jee6-web/src/test/java/org/jboss/seam/example/booking/test/Deployments.java
branches/enterprise/WFK-2_1/examples/jee6/jee6-web/src/test/java/org/jboss/seam/example/booking/test/LoginTest.java
branches/enterprise/WFK-2_1/examples/jee6/jee6-web/src/test/resources/
branches/enterprise/WFK-2_1/examples/jee6/jee6-web/src/test/resources/arquillian.xml
branches/enterprise/WFK-2_1/examples/jee6/jee6-web/src/test/resources/components.xml
branches/enterprise/WFK-2_1/examples/jee6/jee6-web/src/test/resources/persistence.xml
Log:
blog, booking, groovybooking, hibernate, jee6 converted, more files
Added: branches/enterprise/WFK-2_1/build/build.properties
===================================================================
--- branches/enterprise/WFK-2_1/build/build.properties (rev 0)
+++ branches/enterprise/WFK-2_1/build/build.properties 2013-06-03 16:41:11 UTC (rev 15525)
@@ -0,0 +1,2 @@
+complete.version=2.3.1.Final-redhat-1
+version=2.3
\ No newline at end of file
Added: branches/enterprise/WFK-2_1/examples/blog/README.md
===================================================================
--- branches/enterprise/WFK-2_1/examples/blog/README.md (rev 0)
+++ branches/enterprise/WFK-2_1/examples/blog/README.md 2013-06-03 16:41:11 UTC (rev 15525)
@@ -0,0 +1,60 @@
+Seam Blog Example
+=================
+
+This example demonstrates the use of Seam in a Java EE environment.
+Transaction and persistence context management is handled by the EJB container.
+
+Running the example
+-------------------
+
+To deploy the example to a running JBoss AS instance, follow these steps:
+
+1. In the example root directory run:
+
+ mvn clean install
+
+2. Set JBOSS_HOME environment property.
+
+3. In the blog-ear directory run:
+
+ mvn jboss-as:deploy
+
+4. Open this URL in a web browser: http://localhost:8080/seam-blog
+
+
+Testing the example
+-------------------
+
+This example is covered by integration tests. All tests use the following technologies:
+
+* __Arquillian__ - as the framework for EE testing, for managing of container lifecycle and deployment of test archive,
+* __ShrinkWrap__ - to create the test archive (WAR).
+
+
+### Integration tests
+
+Integration tests cover core application logic and reside in the EJB module. In addition to Arquillian and ShrinkWrap, the integration tests also use:
+
+* __JUnitSeamTest__ - to hook into the JSF lifecycle and assert server-side state,
+* __ShrinkWrap Resolver__ - to resolve dependencies of the project for packaging in the test archive.
+
+The tests are executed in Maven's test phase. By default they are skipped and can be executed on JBoss AS with:
+
+ mvn clean test -Darquillian=jbossas-managed-7
+
+The `JBOSS_HOME` environment variable must be set and point to a JBoss AS instance directory.
+
+To test on a running server, use
+
+ mvn clean test -Darquillian=jbossas-remote-7
+
+
+Testing in JBDS
+---------------
+### Integration tests
+
+1. Open JBDS and start a configured instance of JBoss AS
+2. Import the example project and its submodules
+3. In the _Project Explorer_, select the EJB module project, then
+ 1. Type `Ctrl+Alt+P` (_Select Maven Profiles_) and check `integration-tests` and `arq-jbossas-7-remote`
+ 2. Right-click the module and select _Run As_ - _JUnit Test_
Added: branches/enterprise/WFK-2_1/examples/blog/blog-ejb/src/test/java/org/jboss/seam/example/blog/test/BlogTest.java
===================================================================
--- branches/enterprise/WFK-2_1/examples/blog/blog-ejb/src/test/java/org/jboss/seam/example/blog/test/BlogTest.java (rev 0)
+++ branches/enterprise/WFK-2_1/examples/blog/blog-ejb/src/test/java/org/jboss/seam/example/blog/test/BlogTest.java 2013-06-03 16:41:11 UTC (rev 15525)
@@ -0,0 +1,290 @@
+package org.jboss.seam.example.blog.test;
+
+import java.io.File;
+import java.util.List;
+import java.util.Map;
+import java.util.MissingResourceException;
+import java.util.ResourceBundle;
+
+import javax.faces.model.SelectItem;
+import javax.persistence.EntityManager;
+
+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.mock.JUnitSeamTest;
+import org.jboss.seam.security.Identity;
+import org.jboss.seam.theme.Theme;
+import org.jboss.seam.theme.ThemeSelector;
+import org.jboss.shrinkwrap.api.Archive;
+import org.jboss.shrinkwrap.api.ShrinkWrap;
+import org.jboss.shrinkwrap.api.spec.WebArchive;
+
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+import actions.BlogService;
+import actions.SearchService;
+import domain.Blog;
+import domain.BlogEntry;
+import org.jboss.arquillian.junit.InSequence;
+import org.jboss.shrinkwrap.resolver.api.maven.Maven;
+
+(a)RunWith(Arquillian.class)
+public class BlogTest extends JUnitSeamTest {
+
+ @Deployment(name = "BestSellersTest")
+ @OverProtocol("Servlet 3.0")
+ public static Archive<?> createDeployment() {
+
+ File[] libs = Maven.resolver().loadPomFromFile("pom.xml")
+ .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();
+
+ WebArchive war = ShrinkWrap.create(WebArchive.class, "seam-blog.war")
+ .addPackages(true, "actions", "domain")
+ // already in EJB module
+ .addAsWebInfResource("import.sql", "classes/import.sql")
+ .addAsWebInfResource("seam.properties", "classes/seam.properties")
+ .addAsWebInfResource("META-INF/persistence.xml", "classes/META-INF/persistence.xml")
+
+ // manually copied from Web module
+ .addAsWebInfResource("pages.xml", "pages.xml")
+ .addAsWebInfResource("accessible.properties", "classes/accessible.properties")
+ .addAsWebInfResource("default.properties", "classes/default.properties")
+ .addAsWebInfResource("printable.properties", "classes/printable.properties")
+ .addAsWebInfResource("infinispan.xml", "classes/infinispan.xml")
+ .addAsWebInfResource("jgroupsConfig.xml", "classes/jgroupsConfig.xml")
+
+ // manually copied from Web module, modified
+ .addAsWebInfResource("web.xml", "web.xml") // only contains MockSeamListener definition
+ .addAsWebInfResource("components.xml", "components.xml") // corrected ejb component jndi-name references from java:app/jboss-seam to java:app/seam-blog
+
+ // manually copied from EAR module
+ .addAsWebInfResource("jboss-deployment-structure.xml", "jboss-deployment-structure.xml")
+ .addAsLibraries(libs);
+
+ war.addClasses(BlogTest.class);
+
+ return war;
+ }
+
+ @Test
+ @InSequence(1)
+ public void testPost() throws Exception {
+ new FacesRequest() {
+ @Override
+ protected void updateModelValues() throws Exception {
+ Identity.instance().setPassword("tokyo");
+ }
+
+ @Override
+ protected void invokeApplication() throws Exception {
+ Identity.instance().authenticate();
+ }
+ }.run();
+
+ new FacesRequest("/post.xhtml") {
+ @Override
+ protected void updateModelValues() throws Exception {
+ BlogEntry entry = (BlogEntry) getInstance("blogEntry");
+ entry.setId("testing");
+ entry.setTitle("Integration testing Seam applications is easy!");
+ entry.setBody("This post is about SeamTest...");
+ }
+
+ @Override
+ protected void invokeApplication() throws Exception {
+ // post now returns void
+ // assert invokeMethod("#{postAction.post}").equals("/index.xhtml");
+ invokeMethod("#{postAction.post}");
+ setOutcome("/index.xhtml");
+ }
+
+ @Override
+ protected void afterRequest() {
+ assert isInvokeApplicationComplete();
+ assert !isRenderResponseBegun();
+ }
+ }.run();
+
+ new NonFacesRequest("/index.xhtml") {
+ @Override
+ protected void renderResponse() throws Exception {
+ List<BlogEntry> blogEntries = ((Blog) getInstance(BlogService.class)).getBlogEntries();
+ assert blogEntries.size() == 4;
+ BlogEntry blogEntry = blogEntries.get(0);
+ assert blogEntry.getId().equals("testing");
+ assert blogEntry.getBody().equals("This post is about SeamTest...");
+ assert blogEntry.getTitle().equals("Integration testing Seam applications is easy!");
+ }
+ }.run();
+
+ new FacesRequest() {
+ @Override
+ protected void invokeApplication() throws Exception {
+ ((EntityManager) getInstance("entityManager")).createQuery("delete from BlogEntry where id='testing'").executeUpdate();
+ }
+ }.run();
+
+ }
+
+ @Test
+ @InSequence(2)
+ public void testLatest() throws Exception {
+ new NonFacesRequest("/index.xhtml") {
+ @Override
+ protected void renderResponse() throws Exception {
+ assert ((Blog) getInstance(BlogService.class)).getBlogEntries().size() == 3;
+ }
+ }.run();
+ }
+
+ @Test
+ @InSequence(3)
+ public void testEntry() throws Exception {
+ new NonFacesRequest("/entry.xhtml") {
+ @Override
+ protected void beforeRequest() {
+ setParameter("blogEntryId", "seamtext");
+ }
+
+ @Override
+ protected void renderResponse() throws Exception {
+ BlogEntry blogEntry = (BlogEntry) Contexts.getEventContext().get("blogEntry");
+ assert blogEntry != null;
+ assert blogEntry.getId().equals("seamtext");
+
+ // make sure the entry is really there
+ assert blogEntry.getBody().length() > 0;
+ assert blogEntry.getTitle().equals("Introducing Seam Text");
+ }
+ }.run();
+ }
+
+ @Test
+ @InSequence(4)
+ public void testSearch() throws Exception {
+ // Some time to allow indexing in the background
+ Thread.sleep(1000);
+
+ String id = new FacesRequest() {
+ @Override
+ protected void updateModelValues() throws Exception {
+ ((SearchService) getInstance(SearchService.class)).setSearchPattern("seam");
+ }
+
+ @Override
+ protected String getInvokeApplicationOutcome() {
+ return "/search.xhtml";
+ }
+
+ @Override
+ protected void afterRequest() {
+ assert !isRenderResponseBegun();
+ }
+ }.run();
+
+ new NonFacesRequest("/search.xhtml", id) {
+ @Override
+ protected void beforeRequest() {
+ setParameter("searchPattern", "\"seam text\"");
+ }
+
+ @Override
+ protected void renderResponse() throws Exception {
+ List<BlogEntry> results = (List<BlogEntry>) getInstance("searchResults");
+ // The hibernate search returns non-precise matches since version 4, so we only check that the expected result is first
+ assert !results.isEmpty();
+ assert "seamtext".equals(results.get(0).getId());
+ }
+ }.run();
+ }
+
+ @Test
+ @InSequence(5)
+ public void testSelectTheme() throws Exception {
+ String id = new NonFacesRequest("/index.xhtml") {
+ @Override
+ protected void renderResponse() throws Exception {
+ List<SelectItem> themes = (List<SelectItem>) getValue("#{themeSelector.themes}");
+ assert themes.size() == 3;
+ assert themes.get(0).getLabel().equals("default");
+ assert themes.get(0).getLabel().equals("default");
+ assert "default".equals(getValue("#{themeSelector.theme}"));
+
+ assert "template.xhtml".equals(getValue("#{theme.template}"));
+ // we can't do interpolate the value correctly in these tests
+ // assert "/screen.css".equals(getValue("#{theme.css}"));
+ assert "foo".equals(getValue("#{theme.foo}"));
+ }
+ }.run();
+
+ new FacesRequest("/index.xhtml", id) {
+ @Override
+ protected void updateModelValues() throws Exception {
+ setValue("#{themeSelector.theme}", "accessible");
+ }
+
+ @Override
+ protected void invokeApplication() throws Exception {
+ invokeAction("#{themeSelector.select}");
+ }
+
+ @Override
+ protected void renderResponse() throws Exception {
+ assert "accessible".equals(getValue("#{themeSelector.theme}"));
+ //assert "/accessible.css".equals(getValue("#{theme.css}"));
+ assert "template.xhtml".equals(getValue("#{theme.template}"));
+ }
+ }.run();
+
+ new FacesRequest("/index.xhtml", id) {
+ @Override
+ protected void invokeApplication() throws Exception {
+ invokeAction("#{themeSelector.selectTheme('printable')}");
+ }
+
+ @Override
+ protected void renderResponse() throws Exception {
+ assert "printable".equals(getValue("#{themeSelector.theme}"));
+ //assert "/printable.css".equals(getValue("#{theme.css}"));
+ assert "print.xhtml".equals(getValue("#{theme.template}"));
+ Map<String, String> theme = Theme.instance();
+ assert theme.entrySet().size() == 2;
+ }
+ }.run();
+
+ new FacesRequest("/index.xhtml", id) {
+ @Override
+ protected void updateModelValues() throws Exception {
+ setValue("#{themeSelector.theme}", "foo");
+ }
+
+ @Override
+ protected void invokeApplication() throws Exception {
+ invokeAction("#{themeSelector.select}");
+ }
+
+ @Override
+ protected void renderResponse() throws Exception {
+ assert "foo".equals(getValue("#{themeSelector.theme}"));
+ Map<String, String> theme = Theme.instance();
+ ResourceBundle themeResources = ThemeSelector.instance().getThemeResourceBundle();
+ assert !themeResources.getKeys().hasMoreElements();
+ assert theme.entrySet().size() == 0;
+ boolean exception = false;
+ try {
+ themeResources.getObject("bar");
+ } catch (MissingResourceException e) {
+ exception = true;
+ }
+ assert exception;
+ assert theme.get("bar").equals("bar");
+ }
+ }.run();
+ }
+}
Added: branches/enterprise/WFK-2_1/examples/blog/blog-ejb/src/test/resources/accessible.properties
===================================================================
--- branches/enterprise/WFK-2_1/examples/blog/blog-ejb/src/test/resources/accessible.properties (rev 0)
+++ branches/enterprise/WFK-2_1/examples/blog/blog-ejb/src/test/resources/accessible.properties 2013-06-03 16:41:11 UTC (rev 15525)
@@ -0,0 +1,2 @@
+css #{request.contextPath}/accessible.css
+template template.xhtml
Added: branches/enterprise/WFK-2_1/examples/blog/blog-ejb/src/test/resources/arquillian.xml
===================================================================
(Binary files differ)
Property changes on: branches/enterprise/WFK-2_1/examples/blog/blog-ejb/src/test/resources/arquillian.xml
___________________________________________________________________
Added: svn:mime-type
+ application/xml
Added: branches/enterprise/WFK-2_1/examples/blog/blog-ejb/src/test/resources/components.xml
===================================================================
(Binary files differ)
Property changes on: branches/enterprise/WFK-2_1/examples/blog/blog-ejb/src/test/resources/components.xml
___________________________________________________________________
Added: svn:mime-type
+ application/xml
Added: branches/enterprise/WFK-2_1/examples/blog/blog-ejb/src/test/resources/default.properties
===================================================================
--- branches/enterprise/WFK-2_1/examples/blog/blog-ejb/src/test/resources/default.properties (rev 0)
+++ branches/enterprise/WFK-2_1/examples/blog/blog-ejb/src/test/resources/default.properties 2013-06-03 16:41:11 UTC (rev 15525)
@@ -0,0 +1,2 @@
+css #{request.contextPath}/screen.css
+template template.xhtml
Added: branches/enterprise/WFK-2_1/examples/blog/blog-ejb/src/test/resources/infinispan.xml
===================================================================
(Binary files differ)
Property changes on: branches/enterprise/WFK-2_1/examples/blog/blog-ejb/src/test/resources/infinispan.xml
___________________________________________________________________
Added: svn:mime-type
+ application/xml
Added: branches/enterprise/WFK-2_1/examples/blog/blog-ejb/src/test/resources/jboss-deployment-structure.xml
===================================================================
--- branches/enterprise/WFK-2_1/examples/blog/blog-ejb/src/test/resources/jboss-deployment-structure.xml (rev 0)
+++ branches/enterprise/WFK-2_1/examples/blog/blog-ejb/src/test/resources/jboss-deployment-structure.xml 2013-06-03 16:41:11 UTC (rev 15525)
@@ -0,0 +1,14 @@
+<jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.0">
+ <deployment>
+ <dependencies>
+ <module name="org.antlr" export="true"/>
+ <module name="org.apache.log4j" 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"/>
+ <module name="org.jgroups" export="true"/>
+ </dependencies>
+ </deployment>
+</jboss-deployment-structure>
Added: branches/enterprise/WFK-2_1/examples/blog/blog-ejb/src/test/resources/jgroupsConfig.xml
===================================================================
(Binary files differ)
Property changes on: branches/enterprise/WFK-2_1/examples/blog/blog-ejb/src/test/resources/jgroupsConfig.xml
___________________________________________________________________
Added: svn:mime-type
+ application/xml
Added: branches/enterprise/WFK-2_1/examples/blog/blog-ejb/src/test/resources/messages.properties
===================================================================
--- branches/enterprise/WFK-2_1/examples/blog/blog-ejb/src/test/resources/messages.properties (rev 0)
+++ branches/enterprise/WFK-2_1/examples/blog/blog-ejb/src/test/resources/messages.properties 2013-06-03 16:41:11 UTC (rev 15525)
@@ -0,0 +1,2 @@
+javax.faces.component.UIInput.REQUIRED=value is required
+org.jboss.seam.loginSuccessful=
Added: branches/enterprise/WFK-2_1/examples/blog/blog-ejb/src/test/resources/pages.xml
===================================================================
(Binary files differ)
Property changes on: branches/enterprise/WFK-2_1/examples/blog/blog-ejb/src/test/resources/pages.xml
___________________________________________________________________
Added: svn:mime-type
+ application/xml
Added: branches/enterprise/WFK-2_1/examples/blog/blog-ejb/src/test/resources/printable.properties
===================================================================
--- branches/enterprise/WFK-2_1/examples/blog/blog-ejb/src/test/resources/printable.properties (rev 0)
+++ branches/enterprise/WFK-2_1/examples/blog/blog-ejb/src/test/resources/printable.properties 2013-06-03 16:41:11 UTC (rev 15525)
@@ -0,0 +1,2 @@
+css #{request.contextPath}/printable.css
+template print.xhtml
Added: branches/enterprise/WFK-2_1/examples/blog/blog-ejb/src/test/resources/web.xml
===================================================================
(Binary files differ)
Property changes on: branches/enterprise/WFK-2_1/examples/blog/blog-ejb/src/test/resources/web.xml
___________________________________________________________________
Added: svn:mime-type
+ application/xml
Added: branches/enterprise/WFK-2_1/examples/booking/README.md
===================================================================
--- branches/enterprise/WFK-2_1/examples/booking/README.md (rev 0)
+++ branches/enterprise/WFK-2_1/examples/booking/README.md 2013-06-03 16:41:11 UTC (rev 15525)
@@ -0,0 +1,74 @@
+Seam Booking Example
+=================
+
+This example demonstrates the use of Seam in a Java EE 6 environment.
+Transaction and persistence context management is handled by the EJB container. This example runs on JBoss AS as an EAR.
+
+Running the example
+-------------------
+
+### Using Maven
+
+To deploy the example to a running JBoss AS instance, follow these steps:
+
+1. In the example root directory run:
+
+ mvn clean install
+
+2. Set JBOSS_HOME environment property.
+
+3. In the booking-ear directory run:
+
+ mvn jboss-as:deploy
+
+4. Open this URL in a web browser: http://localhost:8080/seam-booking
+
+### Using Ant
+
+1. In the example root directory run:
+
+ ant clean package
+
+2. Copy seam-booking.ear from directory booking-ear/target to the deployment directory of JBoss AS ($JBOSS_HOME/standalone/deployments by default)
+
+3. Open this URL in a web browser: http://localhost:8080/seam-booking
+
+
+Testing the example
+-------------------
+
+This example is covered by integration tests. All tests use the following technologies:
+
+* __Arquillian__ - as the framework for EE testing, for managing of container lifecycle and deployment of test archive,
+* __ShrinkWrap__ - to create the test archive (WAR).
+
+
+### Integration tests
+
+Integration tests cover core application logic and reside in the EJB module. In addition to Arquillian and ShrinkWrap, the integration tests also use:
+
+* __JUnitSeamTest__ - to hook into the JSF lifecycle and assert server-side state,
+* __ShrinkWrap Resolver__ - to resolve dependencies of the project for packaging in the test archive.
+
+The tests are executed in Maven's test phase. By default they are skipped and can be executed on JBoss AS with:
+
+ mvn clean test -Darquillian=jbossas-managed-7
+
+The `JBOSS_HOME` environment variable must be set and point to a JBoss AS instance directory.
+
+To test on a running server, use
+
+ mvn clean test -Darquillian=jbossas-remote-7
+
+
+Testing in JBDS
+---------------
+### Integration tests
+
+1. Open JBDS and start a configured instance of JBoss AS
+
+2. Import the example project and its submodules
+
+3. In the _Project Explorer_, select the EJB module project, then
+ 1. Type `Ctrl+Alt+P` (_Select Maven Profiles_) and check `integration-tests` and `arq-jbossas-7-remote`
+ 2. Right-click the module and select _Run As_ - _JUnit Test_
Added: branches/enterprise/WFK-2_1/examples/booking/booking-ejb/src/test/java/org/jboss/seam/example/booking/test/BookingTest.java
===================================================================
--- branches/enterprise/WFK-2_1/examples/booking/booking-ejb/src/test/java/org/jboss/seam/example/booking/test/BookingTest.java (rev 0)
+++ branches/enterprise/WFK-2_1/examples/booking/booking-ejb/src/test/java/org/jboss/seam/example/booking/test/BookingTest.java 2013-06-03 16:41:11 UTC (rev 15525)
@@ -0,0 +1,143 @@
+//$Id: BookingTest.java 5810 2007-07-16 06:46:47Z gavin $
+package org.jboss.seam.example.booking.test;
+
+import java.util.Calendar;
+import java.util.Date;
+
+import javax.faces.model.DataModel;
+import javax.faces.model.ListDataModel;
+
+import org.jboss.shrinkwrap.api.Archive;
+import org.jboss.shrinkwrap.api.spec.EnterpriseArchive;
+import org.jboss.shrinkwrap.api.spec.WebArchive;
+import org.jboss.arquillian.container.test.api.Deployment;
+import org.jboss.arquillian.container.test.api.OverProtocol;
+import org.jboss.arquillian.junit.Arquillian;
+import org.jboss.seam.Component;
+import org.jboss.seam.contexts.Contexts;
+import org.jboss.seam.contexts.Lifecycle;
+import org.jboss.seam.core.Manager;
+import org.jboss.seam.example.booking.Booking;
+import org.jboss.seam.example.booking.BookingList;
+import org.jboss.seam.example.booking.Hotel;
+import org.jboss.seam.example.booking.HotelBooking;
+import org.jboss.seam.example.booking.HotelSearching;
+import org.jboss.seam.example.booking.User;
+import org.jboss.seam.security.Identity;
+
+import static org.junit.Assert.*;
+
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+(a)RunWith(Arquillian.class)
+public class BookingTest
+{
+ @Deployment(name="BookingTest")
+ @OverProtocol("Servlet 3.0")
+ public static Archive<?> createDeployment()
+ {
+ WebArchive war = Deployments.bookingDeployment();
+
+ war.addClasses(BookingTest.class);
+
+ return war;
+ }
+
+ @Before
+ public void before() {
+ Lifecycle.beginCall();
+ }
+
+ @After
+ public void after() {
+ Lifecycle.endCall();
+ }
+
+ @Test
+ public void testBookHotel() throws Exception
+ {
+ Manager manager = Manager.instance();
+ Identity identity = Identity.instance();
+ HotelSearching hotelSearch = (HotelSearching)Component.getInstance("hotelSearch");
+ HotelBooking hotelBooking = (HotelBooking)Component.getInstance("hotelBooking");
+ BookingList bookingList = (BookingList)Component.getInstance("bookingList");
+
+ manager.initializeTemporaryConversation();
+ Contexts.getSessionContext().set("user", new User("Gavin King", "foobar", "gavin"));
+
+ identity.setUsername("gavin");
+ identity.setPassword("foobar");
+ identity.login();
+
+ hotelSearch.setSearchString("Union Square");
+ hotelSearch.find();
+
+ DataModel hotels = (DataModel) Contexts.getSessionContext().get("hotels");
+
+ assertEquals(1, hotels.getRowCount());
+ assertEquals("NY", ((Hotel) hotels.getRowData() ).getCity());
+ assertEquals("Union Square", hotelSearch.getSearchString());
+ assertFalse(manager.isLongRunningConversation());
+
+ hotels = (DataModel) Contexts.getSessionContext().get("hotels");
+ assertEquals(1, hotels.getRowCount());
+ hotelBooking.selectHotel( (Hotel) hotels.getRowData() );
+
+ Hotel hotel = (Hotel) Contexts.getConversationContext().get("hotel");
+ assertEquals("NY", hotel.getCity());
+ assertEquals("10011", hotel.getZip());
+ assertTrue(manager.isLongRunningConversation());
+
+ hotelBooking.bookHotel();
+
+ Booking booking = (Booking) Contexts.getConversationContext().get("booking");
+ assertNotNull(booking.getUser());
+ assertNotNull(booking.getHotel());
+ assertNull(booking.getCreditCard());
+ assertNull(booking.getCreditCardName());
+
+ assertEquals(Contexts.getConversationContext().get("hotel"), booking.getHotel());
+ assertEquals(Contexts.getSessionContext().get("user"), booking.getUser());
+ assertTrue(Manager.instance().isLongRunningConversation());
+
+ booking.setCreditCard("1234567891021234");
+ booking.setCreditCardName("GAVIN KING");
+ booking.setBeds(2);
+ Date now = new Date();
+ booking.setCheckinDate(now);
+ booking.setCheckoutDate(now);
+
+ hotelBooking.setBookingDetails();
+ assertFalse(hotelBooking.isBookingValid());
+
+ Calendar cal = Calendar.getInstance();
+ cal.add(Calendar.DAY_OF_MONTH, 2);
+ booking.setCheckoutDate(cal.getTime());
+
+ hotelBooking.setBookingDetails();
+ assertTrue(hotelBooking.isBookingValid());
+ assertTrue(manager.isLongRunningConversation());
+
+ hotelBooking.confirm();
+
+ ListDataModel bookings = (ListDataModel) Component.getInstance("bookings");
+ assertEquals(1, bookings.getRowCount());
+ bookings.setRowIndex(0);
+ booking = (Booking) bookings.getRowData();
+ assertEquals("NY", booking.getHotel().getCity());
+ assertEquals("gavin", booking.getUser().getUsername());
+ assertFalse(manager.isLongRunningConversation());
+
+ bookings = (ListDataModel) Contexts.getSessionContext().get("bookings");
+ bookings.setRowIndex(0);
+ bookingList.cancel();
+
+ bookings = (ListDataModel) Contexts.getSessionContext().get("bookings");
+ assertEquals(0, bookings.getRowCount());
+ assertFalse(manager.isLongRunningConversation());
+ }
+
+}
Added: branches/enterprise/WFK-2_1/examples/booking/booking-ejb/src/test/java/org/jboss/seam/example/booking/test/ChangePasswordTest.java
===================================================================
--- branches/enterprise/WFK-2_1/examples/booking/booking-ejb/src/test/java/org/jboss/seam/example/booking/test/ChangePasswordTest.java (rev 0)
+++ branches/enterprise/WFK-2_1/examples/booking/booking-ejb/src/test/java/org/jboss/seam/example/booking/test/ChangePasswordTest.java 2013-06-03 16:41:11 UTC (rev 15525)
@@ -0,0 +1,106 @@
+//$Id: ChangePasswordTest.java 5810 2007-07-16 06:46:47Z gavin $
+package org.jboss.seam.example.booking.test;
+
+import org.jboss.shrinkwrap.api.Archive;
+import org.jboss.shrinkwrap.api.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.Component;
+import org.jboss.seam.contexts.Contexts;
+import org.jboss.seam.contexts.Lifecycle;
+import org.jboss.seam.core.Manager;
+import org.jboss.seam.example.booking.ChangePassword;
+import org.jboss.seam.example.booking.User;
+import org.jboss.seam.security.Identity;
+
+import static org.junit.Assert.*;
+
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+(a)RunWith(Arquillian.class)
+public class ChangePasswordTest
+{
+ @Deployment(name="ChangePasswordTest")
+ @OverProtocol("Servlet 3.0")
+ public static Archive<?> createDeployment()
+ {
+ WebArchive war = Deployments.bookingDeployment();
+
+ war.addClasses(ChangePasswordTest.class);
+
+ return war;
+ }
+
+ @Before
+ public void before() {
+ Lifecycle.beginCall();
+ }
+
+ @After
+ public void after() {
+ Lifecycle.endCall();
+ }
+
+ @Test
+ public void testChangePassword() throws Exception
+ {
+ Identity identity = Identity.instance();
+
+ Contexts.getSessionContext().set("user", new User("Gavin King", "foobar", "gavin"));
+ identity.setUsername("gavin");
+ identity.setPassword("foobar");
+ identity.login();
+
+ User user = (User)Component.getInstance("user");
+ assertEquals("Gavin King", user.getName());
+ assertEquals("gavin", user.getUsername());
+ assertEquals("foobar", user.getPassword());
+ assertFalse(Manager.instance().isLongRunningConversation());
+ assertTrue(identity.isLoggedIn());
+
+ user.setPassword("xxxyyy");
+ ChangePassword changePassword = (ChangePassword)Component.getInstance("changePassword");
+ changePassword.setVerify("xxyyyx");
+ changePassword.changePassword();
+
+ user = (User)Component.getInstance("user");
+ assertEquals("Gavin King", user.getName());
+ assertEquals("gavin", user.getUsername());
+ assertEquals("foobar", user.getPassword());
+ assertFalse(Manager.instance().isLongRunningConversation());
+ assertTrue(identity.isLoggedIn());
+
+ user = (User)Component.getInstance("user");
+ user.setPassword("xxxyyy");
+ changePassword = (ChangePassword)Component.getInstance("changePassword");
+ changePassword.setVerify("xxxyyy");
+ changePassword.changePassword();
+
+ user = (User)Component.getInstance("user");
+ assertEquals("Gavin King", user.getName());
+ assertEquals("gavin", user.getUsername());
+ assertEquals("xxxyyy", user.getPassword());
+ assertFalse(Manager.instance().isLongRunningConversation());
+ assertTrue(identity.isLoggedIn());
+
+ user = (User)Component.getInstance("user");
+ assertEquals("xxxyyy", user.getPassword());
+ user.setPassword("foobar");
+ changePassword = (ChangePassword)Component.getInstance("changePassword");
+ changePassword.setVerify("foobar");
+ changePassword.changePassword();
+
+ user = (User)Component.getInstance("user");
+ assertEquals("Gavin King", user.getName());
+ assertEquals("gavin", user.getUsername());
+ assertEquals("foobar", user.getPassword());
+ assertFalse(Manager.instance().isLongRunningConversation());
+ assertTrue(identity.isLoggedIn());
+ }
+
+}
Added: branches/enterprise/WFK-2_1/examples/booking/booking-ejb/src/test/java/org/jboss/seam/example/booking/test/Deployments.java
===================================================================
--- branches/enterprise/WFK-2_1/examples/booking/booking-ejb/src/test/java/org/jboss/seam/example/booking/test/Deployments.java (rev 0)
+++ branches/enterprise/WFK-2_1/examples/booking/booking-ejb/src/test/java/org/jboss/seam/example/booking/test/Deployments.java 2013-06-03 16:41:11 UTC (rev 15525)
@@ -0,0 +1,30 @@
+package org.jboss.seam.example.booking.test;
+
+import java.io.File;
+import org.jboss.seam.example.booking.Booking;
+import org.jboss.shrinkwrap.api.ShrinkWrap;
+import org.jboss.shrinkwrap.api.spec.WebArchive;
+import org.jboss.shrinkwrap.resolver.api.maven.Maven;
+
+public class Deployments {
+
+ public static WebArchive bookingDeployment() {
+
+ File[] libs = Maven.resolver().loadPomFromFile("pom.xml")
+ .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-booking.war")
+ .addPackage(Booking.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);
+ }
+}
Added: branches/enterprise/WFK-2_1/examples/booking/booking-ejb/src/test/java/org/jboss/seam/example/booking/test/LoginTest.java
===================================================================
--- branches/enterprise/WFK-2_1/examples/booking/booking-ejb/src/test/java/org/jboss/seam/example/booking/test/LoginTest.java (rev 0)
+++ branches/enterprise/WFK-2_1/examples/booking/booking-ejb/src/test/java/org/jboss/seam/example/booking/test/LoginTest.java 2013-06-03 16:41:11 UTC (rev 15525)
@@ -0,0 +1,94 @@
+//$Id: LoginTest.java 5810 2007-07-16 06:46:47Z gavin $
+package org.jboss.seam.example.booking.test;
+
+import org.jboss.shrinkwrap.api.Archive;
+import org.jboss.shrinkwrap.api.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.Component;
+import org.jboss.seam.contexts.Lifecycle;
+import org.jboss.seam.core.Manager;
+import org.jboss.seam.example.booking.User;
+import org.jboss.seam.security.Identity;
+import org.jboss.seam.web.Session;
+
+import static org.junit.Assert.*;
+
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+(a)RunWith(Arquillian.class)
+public class LoginTest
+{
+ @Deployment(name="LoginTest")
+ @OverProtocol("Servlet 3.0")
+ public static Archive<?> createDeployment()
+ {
+ WebArchive war = Deployments.bookingDeployment();
+
+ war.addClasses(LoginTest.class);
+
+ return war;
+ }
+
+ @Before
+ public void before() {
+ Lifecycle.beginCall();
+ }
+
+ @After
+ public void after() {
+ Lifecycle.endCall();
+ }
+
+ @Test
+ public void testLoginComponent() throws Exception
+ {
+ Identity identity = Identity.instance();
+
+ assertFalse(identity.isLoggedIn());
+ identity.setUsername("gavin");
+ identity.setPassword("foobar");
+ identity.login();
+
+ User user = (User)Component.getInstance("user");
+ assertEquals("Gavin King", user.getName());
+ assertEquals("gavin", user.getUsername());
+ assertEquals("foobar", user.getPassword());
+ assertTrue(identity.isLoggedIn());
+ identity.logout();
+ assertFalse(identity.isLoggedIn());
+ identity.setUsername("gavin");
+ identity.setPassword("tiger");
+ identity.login();
+ assertFalse(identity.isLoggedIn());
+ }
+
+ @Test
+ public void testLogin() throws Exception
+ {
+ Identity identity = Identity.instance();
+
+ assertFalse(identity.isLoggedIn());
+
+ identity.setUsername("gavin");
+ identity.setPassword("foobar");
+ identity.login();
+
+ User user = (User)Component.getInstance("user");
+ assertEquals("Gavin King", user.getName());
+ assertEquals("gavin", user.getUsername());
+ assertEquals("foobar", user.getPassword());
+ assertFalse(Manager.instance().isLongRunningConversation());
+ assertTrue(identity.isLoggedIn());
+
+ identity.logout();
+ assertTrue(Session.instance().isInvalid());
+
+ assertFalse(identity.isLoggedIn());
+ }
+
+}
Added: branches/enterprise/WFK-2_1/examples/booking/booking-ejb/src/test/resources/arquillian.xml
===================================================================
(Binary files differ)
Property changes on: branches/enterprise/WFK-2_1/examples/booking/booking-ejb/src/test/resources/arquillian.xml
___________________________________________________________________
Added: svn:mime-type
+ application/xml
Added: branches/enterprise/WFK-2_1/examples/booking/booking-ejb/src/test/resources/components.xml
===================================================================
(Binary files differ)
Property changes on: branches/enterprise/WFK-2_1/examples/booking/booking-ejb/src/test/resources/components.xml
___________________________________________________________________
Added: svn:mime-type
+ application/xml
Added: branches/enterprise/WFK-2_1/examples/booking/booking-ejb/src/test/resources/jboss-deployment-structure.xml
===================================================================
--- branches/enterprise/WFK-2_1/examples/booking/booking-ejb/src/test/resources/jboss-deployment-structure.xml (rev 0)
+++ branches/enterprise/WFK-2_1/examples/booking/booking-ejb/src/test/resources/jboss-deployment-structure.xml 2013-06-03 16:41:11 UTC (rev 15525)
@@ -0,0 +1,12 @@
+<jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.0">
+ <deployment>
+ <dependencies>
+ <module name="org.apache.log4j" 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/booking/booking-ejb/src/test/resources/persistence.xml
===================================================================
(Binary files differ)
Property changes on: branches/enterprise/WFK-2_1/examples/booking/booking-ejb/src/test/resources/persistence.xml
___________________________________________________________________
Added: svn:mime-type
+ application/xml
Added: branches/enterprise/WFK-2_1/examples/booking/booking-ejb/src/test/resources/web.xml
===================================================================
(Binary files differ)
Property changes on: branches/enterprise/WFK-2_1/examples/booking/booking-ejb/src/test/resources/web.xml
___________________________________________________________________
Added: svn:mime-type
+ application/xml
Added: branches/enterprise/WFK-2_1/examples/groovybooking/README.md
===================================================================
--- branches/enterprise/WFK-2_1/examples/groovybooking/README.md (rev 0)
+++ branches/enterprise/WFK-2_1/examples/groovybooking/README.md 2013-06-03 16:41:11 UTC (rev 15525)
@@ -0,0 +1,22 @@
+Seam GroovyBooking Example
+=================
+
+This is the Hotel Booking example implemented in Groovy Beans and Hibernate JPA.
+The application is deployed as a WAR rather than an EAR.
+
+Running the example
+-------------------
+
+To deploy the example to a running JBoss AS instance, follow these steps:
+
+1. In the example root directory run:
+
+ mvn clean install
+
+2. Set JBOSS_HOME environment property.
+
+3. In the groovybooking-web directory run:
+
+ mvn jboss-as:deploy
+
+4. Open this URL in a web browser: http://localhost:8080/groovybooking-web
Added: branches/enterprise/WFK-2_1/examples/hibernate/README.md
===================================================================
--- branches/enterprise/WFK-2_1/examples/hibernate/README.md (rev 0)
+++ branches/enterprise/WFK-2_1/examples/hibernate/README.md 2013-06-03 16:41:11 UTC (rev 15525)
@@ -0,0 +1,60 @@
+Seam Hibernate Example
+=================
+
+This is the Hotel Booking example implemented in Seam and Hibernate POJOs.
+
+Running the example
+-------------------
+
+To deploy the example to a running JBoss AS instance, follow these steps:
+
+1. In the example root directory run:
+
+ mvn clean install
+
+2. Set JBOSS_HOME environment property.
+
+3. In the hibernate-web directory run:
+
+ mvn jboss-as:deploy
+
+4. Open this URL in a web browser: http://localhost:8080/hibernate-web
+
+
+Testing the example
+-------------------
+
+This example is covered by integration tests. All tests use the following technologies:
+
+* __Arquillian__ - as the framework for EE testing, for managing of container lifecycle and deployment of test archive,
+* __ShrinkWrap__ - to create the test archive (WAR).
+
+
+### Integration tests
+
+Integration tests cover core application logic and reside in the EJB module. In addition to Arquillian and ShrinkWrap, the integration tests also use:
+
+* __JUnitSeamTest__ - to hook into the JSF lifecycle and assert server-side state,
+* __ShrinkWrap Resolver__ - to resolve dependencies of the project for packaging in the test archive.
+
+_Note: For this test to function properly, it is necessary to run the JBoss AS instance with the **-ea** JVM argument (Enable Assertions)._
+
+The tests are executed in Maven's test phase. By default they are skipped and can be executed on JBoss AS with:
+
+ mvn clean test -Darquillian=jbossas-managed-7
+
+The `JBOSS_HOME` environment variable must be set and point to a JBoss AS instance directory.
+
+To test on a running server, use
+
+ mvn clean test -Darquillian=jbossas-remote-7
+
+Testing in JBDS
+---------------
+### Integration tests
+
+1. Open JBDS and start a configured instance of JBoss AS
+2. Import the example project and its submodules
+3. In the _Project Explorer_, select the Web module project, then
+ 1. Type `Ctrl+Alt+P` (_Select Maven Profiles_) and check `integration-tests` and `arq-jbossas-7-remote`
+ 2. Right-click the module and select _Run As_ - _JUnit Test_
Added: branches/enterprise/WFK-2_1/examples/hibernate/hibernate-web/src/test/java/org/jboss/seam/example/hibernate/test/BookingTest.java
===================================================================
--- branches/enterprise/WFK-2_1/examples/hibernate/hibernate-web/src/test/java/org/jboss/seam/example/hibernate/test/BookingTest.java (rev 0)
+++ branches/enterprise/WFK-2_1/examples/hibernate/hibernate-web/src/test/java/org/jboss/seam/example/hibernate/test/BookingTest.java 2013-06-03 16:41:11 UTC (rev 15525)
@@ -0,0 +1,300 @@
+//$Id: BookingTest.java 6987 2007-12-23 19:53:07Z pmuir $
+package org.jboss.seam.example.hibernate.test;
+
+import java.util.Calendar;
+import java.util.Date;
+import java.util.Iterator;
+
+import javax.faces.application.FacesMessage;
+import javax.faces.context.FacesContext;
+import javax.faces.model.DataModel;
+import javax.faces.model.ListDataModel;
+
+import org.jboss.arquillian.container.test.api.Deployment;
+import org.jboss.arquillian.container.test.api.OverProtocol;
+import org.jboss.arquillian.junit.Arquillian;
+import org.jboss.seam.contexts.Contexts;
+import org.jboss.seam.core.Manager;
+import org.jboss.seam.example.hibernate.Booking;
+import org.jboss.seam.example.hibernate.Hotel;
+import org.jboss.seam.example.hibernate.HotelBookingAction;
+import org.jboss.seam.example.hibernate.User;
+import org.jboss.seam.mock.JUnitSeamTest;
+import org.jboss.shrinkwrap.api.Archive;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+(a)RunWith(Arquillian.class)
+public class BookingTest extends JUnitSeamTest
+{
+ @Deployment(name="BookingTest")
+ @OverProtocol("Servlet 3.0")
+ public static Archive<?> createDeployment()
+ {
+ return Deployments.hibernateDeployment();
+ }
+
+ @Test
+ public void testBookHotel() throws Exception
+ {
+
+ new FacesRequest() {
+
+ @Override
+ protected void invokeApplication() throws Exception
+ {
+ Contexts.getSessionContext().set("user", new User("Gavin King", "foobar", "gavin"));
+ setValue("#{identity.username}", "gavin");
+ setValue("#{identity.password}", "foobar");
+ invokeAction("#{identity.login}");
+ }
+
+ }.run();
+
+ new FacesRequest("/main.xhtml") {
+
+ @Override
+ protected void updateModelValues() throws Exception
+ {
+ setValue("#{hotelSearch.searchString}", "Union Square");
+ }
+
+ @Override
+ protected void invokeApplication()
+ {
+ assert invokeAction("#{hotelSearch.find}")==null;
+ }
+
+ @Override
+ protected void renderResponse()
+ {
+ DataModel hotels = (DataModel) Contexts.getSessionContext().get("hotels");
+ assert hotels.getRowCount()==1;
+ assert ( (Hotel) hotels.getRowData() ).getCity().equals("NY");
+ assert getValue("#{hotelSearch.searchString}").equals("Union Square");
+ assert !Manager.instance().isLongRunningConversation();
+ }
+
+ }.run();
+
+ String id = new FacesRequest("/main.xhtml") {
+
+ @Override
+ protected void invokeApplication() throws Exception {
+ HotelBookingAction hotelBooking = (HotelBookingAction) getInstance("hotelBooking");
+ DataModel hotels = (DataModel) Contexts.getSessionContext().get("hotels");
+ assert hotels.getRowCount()==1;
+ hotelBooking.selectHotel( (Hotel) hotels.getRowData() );
+ }
+
+ @Override
+ protected void renderResponse()
+ {
+ Hotel hotel = (Hotel) Contexts.getConversationContext().get("hotel");
+ assert hotel.getCity().equals("NY");
+ assert hotel.getZip().equals("10011");
+ assert Manager.instance().isLongRunningConversation();
+ }
+
+ }.run();
+
+ id = new FacesRequest("/hotel.xhtml", id) {
+
+ @Override
+ protected void invokeApplication()
+ {
+ invokeAction("#{hotelBooking.bookHotel}");
+ }
+
+ @Override
+ protected void renderResponse()
+ {
+ assert getValue("#{booking.user}")!=null;
+ assert getValue("#{booking.hotel}")!=null;
+ assert getValue("#{booking.creditCard}")==null;
+ assert getValue("#{booking.creditCardName}")==null;
+ Booking booking = (Booking) Contexts.getConversationContext().get("booking");
+ assert booking.getHotel()==Contexts.getConversationContext().get("hotel");
+ assert booking.getUser()==Contexts.getSessionContext().get("user");
+ assert Manager.instance().isLongRunningConversation();
+ }
+
+ }.run();
+
+ new FacesRequest("/book.xhtml", id) {
+
+ @Override
+ protected void processValidations() throws Exception
+ {
+ validateValue("#{booking.creditCard}", "123");
+ assert isValidationFailure();
+ }
+
+ @Override
+ protected void renderResponse()
+ {
+ Iterator messages = FacesContext.getCurrentInstance().getMessages();
+ assert messages.hasNext();
+ assert ( (FacesMessage) messages.next() ).getSummary().equals("Credit card number must 16 digits long");
+ assert !messages.hasNext();
+ assert Manager.instance().isLongRunningConversation();
+ }
+
+ @Override
+ protected void afterRequest()
+ {
+ assert !isInvokeApplicationBegun();
+ }
+
+ }.run();
+
+ new FacesRequest("/book.xhtml", id) {
+
+ @Override
+ protected void processValidations() throws Exception
+ {
+ validateValue("#{booking.creditCardName}", "");
+ assert isValidationFailure();
+ }
+
+ @Override
+ protected void renderResponse()
+ {
+ Iterator messages = FacesContext.getCurrentInstance().getMessages();
+ assert messages.hasNext();
+ assert ( (FacesMessage) messages.next() ).getSummary().equals("Credit card name is required");
+ assert !messages.hasNext();
+ assert Manager.instance().isLongRunningConversation();
+ }
+
+ @Override
+ protected void afterRequest()
+ {
+ assert !isInvokeApplicationBegun();
+ }
+
+ }.run();
+
+ new FacesRequest("/book.xhtml", id) {
+
+ @Override @SuppressWarnings("deprecation")
+ protected void updateModelValues() throws Exception
+ {
+ setValue("#{booking.creditCard}", "1234567891021234");
+ setValue("#{booking.creditCardName}", "GAVIN KING");
+ setValue("#{booking.beds}", 2);
+ Date now = new Date();
+ setValue("#{booking.checkinDate}", now);
+ setValue("#{booking.checkoutDate}", now);
+ }
+
+ @Override
+ protected void invokeApplication()
+ {
+ assert invokeAction("#{hotelBooking.setBookingDetails}")==null;
+ }
+
+ @Override
+ protected void renderResponse()
+ {
+ Iterator messages = FacesContext.getCurrentInstance().getMessages();
+ assert messages.hasNext();
+ FacesMessage message = (FacesMessage) messages.next();
+ assert message.getSummary().equals("Check out date must be later than check in date");
+ assert !messages.hasNext();
+ assert Manager.instance().isLongRunningConversation();
+ }
+
+ @Override
+ protected void afterRequest()
+ {
+ assert isInvokeApplicationComplete();
+ }
+
+ }.run();
+
+ new FacesRequest("/book.xhtml", id) {
+
+ @Override @SuppressWarnings("deprecation")
+ protected void updateModelValues() throws Exception
+ {
+ Calendar cal = Calendar.getInstance();
+ cal.add(Calendar.DAY_OF_MONTH, 2);
+ setValue("#{booking.checkoutDate}", cal.getTime() );
+ }
+
+ @Override
+ protected void invokeApplication()
+ {
+ invokeAction("#{hotelBooking.setBookingDetails}");
+ }
+
+ @Override
+ protected void renderResponse()
+ {
+ assert Manager.instance().isLongRunningConversation();
+ }
+
+ @Override
+ protected void afterRequest()
+ {
+ assert isInvokeApplicationComplete();
+ }
+
+ }.run();
+
+ new FacesRequest("/confirm.xhtml", id) {
+
+ @Override
+ protected void invokeApplication()
+ {
+ invokeAction("#{hotelBooking.confirm}");
+ }
+
+ @Override
+ protected void afterRequest()
+ {
+ assert isInvokeApplicationComplete();
+ }
+
+ }.run();
+
+ new NonFacesRequest("/main.xhtml") {
+
+ @Override
+ protected void renderResponse()
+ {
+ ListDataModel bookings = (ListDataModel) getInstance("bookings");
+ assert bookings.getRowCount()==1;
+ bookings.setRowIndex(0);
+ Booking booking = (Booking) bookings.getRowData();
+ assert booking.getHotel().getCity().equals("NY");
+ assert booking.getUser().getUsername().equals("gavin");
+ assert !Manager.instance().isLongRunningConversation();
+ }
+
+ }.run();
+
+ new FacesRequest("/main.xhtml") {
+
+ @Override
+ protected void invokeApplication()
+ {
+ ListDataModel bookings = (ListDataModel) Contexts.getSessionContext().get("bookings");
+ bookings.setRowIndex(0);
+ invokeAction("#{bookingList.cancel}");
+ }
+
+ @Override
+ protected void renderResponse()
+ {
+ ListDataModel bookings = (ListDataModel) Contexts.getSessionContext().get("bookings");
+ assert bookings.getRowCount()==0;
+ assert !Manager.instance().isLongRunningConversation();
+ }
+
+ }.run();
+
+ }
+
+}
Added: branches/enterprise/WFK-2_1/examples/hibernate/hibernate-web/src/test/java/org/jboss/seam/example/hibernate/test/ChangePasswordTest.java
===================================================================
--- branches/enterprise/WFK-2_1/examples/hibernate/hibernate-web/src/test/java/org/jboss/seam/example/hibernate/test/ChangePasswordTest.java (rev 0)
+++ branches/enterprise/WFK-2_1/examples/hibernate/hibernate-web/src/test/java/org/jboss/seam/example/hibernate/test/ChangePasswordTest.java 2013-06-03 16:41:11 UTC (rev 15525)
@@ -0,0 +1,150 @@
+//$Id: ChangePasswordTest.java 6987 2007-12-23 19:53:07Z pmuir $
+package org.jboss.seam.example.hibernate.test;
+
+import org.jboss.arquillian.container.test.api.Deployment;
+import org.jboss.arquillian.container.test.api.OverProtocol;
+import org.jboss.arquillian.junit.Arquillian;
+import org.jboss.seam.contexts.Contexts;
+import org.jboss.seam.core.Manager;
+import org.jboss.seam.example.hibernate.User;
+import org.jboss.seam.mock.JUnitSeamTest;
+import org.jboss.shrinkwrap.api.Archive;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+(a)RunWith(Arquillian.class)
+public class ChangePasswordTest extends JUnitSeamTest
+{
+ @Deployment(name="ChangePasswordTest")
+ @OverProtocol("Servlet 3.0")
+ public static Archive<?> createDeployment()
+ {
+ return Deployments.hibernateDeployment();
+ }
+
+ @Test
+ public void testChangePassword() throws Exception
+ {
+
+ new FacesRequest() {
+
+ @Override
+ protected void invokeApplication() throws Exception
+ {
+ Contexts.getSessionContext().set("user", new User("Gavin King", "foobar", "gavin"));
+ setValue("#{identity.username}", "gavin");
+ setValue("#{identity.password}", "foobar");
+ invokeMethod("#{identity.login}");
+ }
+
+ }.run();
+
+ new FacesRequest() {
+
+ @Override
+ protected void processValidations() throws Exception
+ {
+ validateValue("#{user.password}", "xxx");
+ assert isValidationFailure();
+ }
+
+ @Override
+ protected void renderResponse()
+ {
+ assert getValue("#{user.name}").equals("Gavin King");
+ assert getValue("#{user.username}").equals("gavin");
+ assert getValue("#{user.password}").equals("foobar");
+ assert !Manager.instance().isLongRunningConversation();
+ assert getValue("#{identity.loggedIn}").equals(true);
+
+ }
+
+ }.run();
+
+ new FacesRequest() {
+
+ @Override
+ protected void updateModelValues() throws Exception
+ {
+ setValue("#{user.password}", "xxxyyy");
+ setValue("#{changePassword.verify}", "xxyyyx");
+ }
+
+ @Override
+ protected void invokeApplication()
+ {
+ assert invokeAction("#{changePassword.changePassword}")==null;
+ }
+
+ @Override
+ protected void renderResponse()
+ {
+ assert getValue("#{user.name}").equals("Gavin King");
+ assert getValue("#{user.username}").equals("gavin");
+ assert getValue("#{user.password}").equals("foobar");
+ assert !Manager.instance().isLongRunningConversation();
+ assert getValue("#{identity.loggedIn}").equals(true);
+ }
+
+ }.run();
+
+ new FacesRequest() {
+
+ @Override
+ protected void updateModelValues() throws Exception
+ {
+ setValue("#{user.password}", "xxxyyy");
+ setValue("#{changePassword.verify}", "xxxyyy");
+ }
+
+ @Override
+ protected void invokeApplication()
+ {
+ invokeMethod("#{changePassword.changePassword}");
+ }
+
+ @Override
+ protected void renderResponse()
+ {
+ assert getValue("#{user.name}").equals("Gavin King");
+ assert getValue("#{user.username}").equals("gavin");
+ assert getValue("#{user.password}").equals("xxxyyy");
+ assert !Manager.instance().isLongRunningConversation();
+ assert getValue("#{identity.loggedIn}").equals(true);
+
+ }
+
+ }.run();
+
+ new FacesRequest() {
+
+ @Override
+ protected void updateModelValues() throws Exception
+ {
+ assert getValue("#{user.password}").equals("xxxyyy");
+ setValue("#{user.password}", "foobar");
+ setValue("#{changePassword.verify}", "foobar");
+ }
+
+ @Override
+ protected void invokeApplication()
+ {
+ invokeMethod("#{changePassword.changePassword}");
+ }
+
+ @Override
+ protected void renderResponse()
+ {
+ assert getValue("#{user.name}").equals("Gavin King");
+ assert getValue("#{user.username}").equals("gavin");
+ assert getValue("#{user.password}").equals("foobar");
+ assert !Manager.instance().isLongRunningConversation();
+ assert getValue("#{identity.loggedIn}").equals(true);
+
+ }
+
+ }.run();
+
+ }
+
+}
Added: branches/enterprise/WFK-2_1/examples/hibernate/hibernate-web/src/test/java/org/jboss/seam/example/hibernate/test/Deployments.java
===================================================================
--- branches/enterprise/WFK-2_1/examples/hibernate/hibernate-web/src/test/java/org/jboss/seam/example/hibernate/test/Deployments.java (rev 0)
+++ branches/enterprise/WFK-2_1/examples/hibernate/hibernate-web/src/test/java/org/jboss/seam/example/hibernate/test/Deployments.java 2013-06-03 16:41:11 UTC (rev 15525)
@@ -0,0 +1,38 @@
+package org.jboss.seam.example.hibernate.test;
+
+import java.io.File;
+import org.jboss.seam.example.hibernate.Booking;
+import org.jboss.shrinkwrap.api.ShrinkWrap;
+import org.jboss.shrinkwrap.api.spec.WebArchive;
+import org.jboss.shrinkwrap.resolver.api.maven.Maven;
+
+public class Deployments {
+
+ public static WebArchive hibernateDeployment() {
+
+ File[] libs = Maven.resolver().loadPomFromFile("pom.xml")
+ .importCompileAndRuntimeDependencies()
+ .resolve().withTransitivity().asFile();
+
+ // Get File reference to src/main/webapp/WEB-INF, to avoid duplication of resources for the test archive
+ // Depends on shrinkwrap-resolver-maven-plugin to set the property
+ File webInf = new File(new File("pom.xml").getParentFile(), "src/main/webapp/WEB-INF");
+
+ return ShrinkWrap.create(WebArchive.class, "hibernate-web.war")
+ .addPackage(Booking.class.getPackage())
+
+ // copy classpath resources to WAR classpath
+ .addAsWebInfResource("import.sql", "classes/import.sql")
+ .addAsWebInfResource("seam.properties", "classes/seam.properties")
+ .addAsWebInfResource("hibernate.cfg.xml", "classes/hibernate.cfg.xml")
+
+ // copy files from src/main/webapp to test-archive's WEB-INF
+ .addAsWebInfResource(new File(webInf, "components.xml"))
+ .addAsWebInfResource(new File(webInf, "jboss-deployment-structure.xml"))
+ .addAsWebInfResource(new File(webInf, "pages.xml"))
+
+ // modified web.xml, defines only MockSeamListener
+ .addAsWebInfResource("web.xml")
+ .addAsLibraries(libs);
+ }
+}
Added: branches/enterprise/WFK-2_1/examples/hibernate/hibernate-web/src/test/java/org/jboss/seam/example/hibernate/test/LoginTest.java
===================================================================
--- branches/enterprise/WFK-2_1/examples/hibernate/hibernate-web/src/test/java/org/jboss/seam/example/hibernate/test/LoginTest.java (rev 0)
+++ branches/enterprise/WFK-2_1/examples/hibernate/hibernate-web/src/test/java/org/jboss/seam/example/hibernate/test/LoginTest.java 2013-06-03 16:41:11 UTC (rev 15525)
@@ -0,0 +1,127 @@
+//$Id: LoginTest.java 6987 2007-12-23 19:53:07Z pmuir $
+package org.jboss.seam.example.hibernate.test;
+
+import org.jboss.arquillian.container.test.api.Deployment;
+import org.jboss.arquillian.container.test.api.OverProtocol;
+import org.jboss.arquillian.junit.Arquillian;
+import org.jboss.seam.core.Manager;
+import org.jboss.seam.web.Session;
+import org.jboss.seam.mock.JUnitSeamTest;
+import org.jboss.shrinkwrap.api.Archive;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+(a)RunWith(Arquillian.class)
+public class LoginTest extends JUnitSeamTest
+{
+ @Deployment(name="LoginTest")
+ @OverProtocol("Servlet 3.0")
+ public static Archive<?> createDeployment()
+ {
+ return Deployments.hibernateDeployment();
+ }
+
+ @Test
+ public void testLoginComponent() throws Exception
+ {
+ new ComponentTest() {
+
+ @Override
+ protected void testComponents() throws Exception
+ {
+ assert getValue("#{identity.loggedIn}").equals(false);
+ setValue("#{identity.username}", "gavin");
+ setValue("#{identity.password}", "foobar");
+ invokeMethod("#{identity.login}");
+ assert getValue("#{user.name}").equals("Gavin King");
+ assert getValue("#{user.username}").equals("gavin");
+ assert getValue("#{user.password}").equals("foobar");
+ assert getValue("#{identity.loggedIn}").equals(true);
+ invokeMethod("#{identity.logout}");
+ assert getValue("#{identity.loggedIn}").equals(false);
+ setValue("#{identity.username}", "gavin");
+ setValue("#{identity.password}", "tiger");
+ invokeMethod("#{identity.login}");
+ assert getValue("#{identity.loggedIn}").equals(false);
+ }
+
+ }.run();
+ }
+
+ @Test
+ public void testLogin() throws Exception
+ {
+
+ new FacesRequest() {
+
+ @Override
+ protected void invokeApplication()
+ {
+ assert !isSessionInvalid();
+ assert getValue("#{identity.loggedIn}").equals(false);
+ }
+
+ }.run();
+
+ new FacesRequest() {
+
+ @Override
+ protected void updateModelValues() throws Exception
+ {
+ assert !isSessionInvalid();
+ setValue("#{identity.username}", "gavin");
+ setValue("#{identity.password}", "foobar");
+ }
+
+ @Override
+ protected void invokeApplication()
+ {
+ invokeAction("#{identity.login}");
+ }
+
+ @Override
+ protected void renderResponse()
+ {
+ assert getValue("#{user.name}").equals("Gavin King");
+ assert getValue("#{user.username}").equals("gavin");
+ assert getValue("#{user.password}").equals("foobar");
+ assert !Manager.instance().isLongRunningConversation();
+ assert getValue("#{identity.loggedIn}").equals(true);
+ }
+
+ }.run();
+
+ new FacesRequest() {
+
+ @Override
+ protected void invokeApplication()
+ {
+ assert !isSessionInvalid();
+ assert getValue("#{identity.loggedIn}").equals(true);
+ }
+
+ }.run();
+
+ new FacesRequest() {
+
+ @Override
+ protected void invokeApplication()
+ {
+ assert !Manager.instance().isLongRunningConversation();
+ assert !isSessionInvalid();
+ invokeMethod("#{identity.logout}");
+ assert Session.instance().isInvalid();
+ }
+
+ @Override
+ protected void renderResponse()
+ {
+ assert getValue("#{identity.loggedIn}").equals(false);
+ assert Session.instance().isInvalid();
+ }
+
+ }.run();
+
+ }
+
+}
Added: branches/enterprise/WFK-2_1/examples/hibernate/hibernate-web/src/test/resources/arquillian.xml
===================================================================
(Binary files differ)
Property changes on: branches/enterprise/WFK-2_1/examples/hibernate/hibernate-web/src/test/resources/arquillian.xml
___________________________________________________________________
Added: svn:mime-type
+ application/xml
Added: branches/enterprise/WFK-2_1/examples/hibernate/hibernate-web/src/test/resources/web.xml
===================================================================
(Binary files differ)
Property changes on: branches/enterprise/WFK-2_1/examples/hibernate/hibernate-web/src/test/resources/web.xml
___________________________________________________________________
Added: svn:mime-type
+ application/xml
Added: branches/enterprise/WFK-2_1/examples/jee6/README.md
===================================================================
--- branches/enterprise/WFK-2_1/examples/jee6/README.md (rev 0)
+++ branches/enterprise/WFK-2_1/examples/jee6/README.md 2013-06-03 16:41:11 UTC (rev 15525)
@@ -0,0 +1,60 @@
+Seam Booking Example
+====================
+
+This example demonstrates the use of Seam in a Java EE 6 environment.
+Transaction and persistence context management is handled by the
+EJB container. This example runs on JBoss AS as a WAR
+
+Running the example
+-------------------
+
+To deploy the example to a running JBoss AS instance, follow these steps:
+
+1. In the example root directory run:
+
+ mvn clean install
+
+2. Set JBOSS_HOME environment property.
+
+3. In the jee6-web directory run:
+
+ mvn jboss-as:deploy
+
+* Open this URL in a web browser: http://localhost:8080/jee6-web
+
+
+Testing the example
+-------------------
+
+This example is covered by integration tests. All tests use the following technologies:
+
+* __Arquillian__ - as the framework for EE testing, for managing of container lifecycle and deployment of test archive,
+* __ShrinkWrap__ - to create the test archive (WAR).
+
+
+### Integration tests
+
+Integration tests cover core application logic and reside in the EJB module. In addition to Arquillian and ShrinkWrap, the integration tests also use:
+
+* __JUnitSeamTest__ - to hook into the JSF lifecycle and assert server-side state,
+* __ShrinkWrap Resolver__ - to resolve dependencies of the project for packaging in the test archive.
+
+The tests are executed in Maven's test phase. By default they are skipped and can be executed on JBoss AS with:
+
+ mvn clean test -Darquillian=jbossas-managed-7
+
+The `JBOSS_HOME` environment variable must be set and point to a JBoss AS instance directory.
+
+To test on a running server, use
+
+ mvn clean test -Darquillian=jbossas-remote-7
+
+Testing in JBDS
+---------------
+### Integration tests
+
+1. Open JBDS and start a configured instance of JBoss AS
+2. Import the example project and its submodules
+3. In the _Project Explorer_, select the Web module project, then
+ 1. Type `Ctrl+Alt+P` (_Select Maven Profiles_) and check `integration-tests` and `arq-jbossas-7-remote`
+ 2. Right-click the module and select _Run As_ - _JUnit Test_
Added: branches/enterprise/WFK-2_1/examples/jee6/jee6-web/src/test/java/org/jboss/seam/example/booking/test/BookingTest.java
===================================================================
--- branches/enterprise/WFK-2_1/examples/jee6/jee6-web/src/test/java/org/jboss/seam/example/booking/test/BookingTest.java (rev 0)
+++ branches/enterprise/WFK-2_1/examples/jee6/jee6-web/src/test/java/org/jboss/seam/example/booking/test/BookingTest.java 2013-06-03 16:41:11 UTC (rev 15525)
@@ -0,0 +1,142 @@
+//$Id: BookingTest.java 5810 2007-07-16 06:46:47Z gavin $
+package org.jboss.seam.example.booking.test;
+
+import java.util.Calendar;
+import java.util.Date;
+
+import javax.faces.model.DataModel;
+import javax.faces.model.ListDataModel;
+
+import org.jboss.shrinkwrap.api.Archive;
+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.Contexts;
+import org.jboss.seam.contexts.Lifecycle;
+import org.jboss.seam.core.Manager;
+import org.jboss.seam.example.booking.Booking;
+import org.jboss.seam.example.booking.BookingListAction;
+import org.jboss.seam.example.booking.Hotel;
+import org.jboss.seam.example.booking.HotelBookingAction;
+import org.jboss.seam.example.booking.HotelSearchingAction;
+import org.jboss.seam.example.booking.RecentBookingsAction;
+import org.jboss.seam.example.booking.User;
+import org.jboss.seam.security.Identity;
+
+import static org.junit.Assert.*;
+
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+(a)RunWith(Arquillian.class)
+public class BookingTest {
+
+ @Deployment(name = "BookingTest")
+ @OverProtocol("Servlet 3.0")
+ public static Archive<?> createDeployment() {
+ return Deployments.bookingDeployment();
+ }
+
+ @Before
+ public void before() {
+ Lifecycle.beginCall();
+ }
+
+ @After
+ public void after() {
+ Lifecycle.endCall();
+ }
+
+ @Test
+ public void testBookHotel() throws Exception {
+ Manager manager = Manager.instance();
+ Identity identity = Identity.instance();
+ HotelSearchingAction hotelSearch = (HotelSearchingAction) Component.getInstance("hotelSearch");
+ HotelBookingAction hotelBooking = (HotelBookingAction) Component.getInstance("hotelBooking");
+ BookingListAction bookingList = (BookingListAction) Component.getInstance("bookingList");
+
+ manager.initializeTemporaryConversation();
+ Contexts.getSessionContext().set("user", new User("Gavin King", "foobar", "gavin"));
+
+ identity.setUsername("gavin");
+ identity.setPassword("foobar");
+ identity.login();
+
+ hotelSearch.setSearchString("Union Square");
+ hotelSearch.find();
+
+ DataModel hotels = (DataModel) Contexts.getSessionContext().get("hotels");
+
+ assertEquals(1, hotels.getRowCount());
+ assertEquals("NY", ((Hotel) hotels.getRowData()).getCity());
+ assertEquals("Union Square", hotelSearch.getSearchString());
+ assertFalse(manager.isLongRunningConversation());
+
+ long hotelId = ((Hotel) hotels.getRowData()).getId();
+ RecentBookingsAction recentBookings = (RecentBookingsAction) Component.getInstance("recentBookings");
+ assertNull(recentBookings.getMostRecentBookingDate(hotelId));
+
+ hotels = (DataModel) Contexts.getSessionContext().get("hotels");
+ assertEquals(1, hotels.getRowCount());
+ hotelBooking.selectHotel((Hotel) hotels.getRowData());
+
+ Hotel hotel = (Hotel) Contexts.getConversationContext().get("hotel");
+ assertEquals("NY", hotel.getCity());
+ assertEquals("10011", hotel.getZip());
+ assertTrue(manager.isLongRunningConversation());
+
+ hotelBooking.bookHotel();
+
+ Booking booking = (Booking) Contexts.getConversationContext().get("booking");
+ assertNotNull(booking.getUser());
+ assertNotNull(booking.getHotel());
+ assertNull(booking.getCreditCard());
+ assertNull(booking.getCreditCardName());
+
+ assertEquals(Contexts.getConversationContext().get("hotel"), booking.getHotel());
+ assertEquals(Contexts.getSessionContext().get("user"), booking.getUser());
+ assertTrue(Manager.instance().isLongRunningConversation());
+
+ booking.setCreditCard("1234567891021234");
+ booking.setCreditCardName("GAVIN KING");
+ booking.setBeds(2);
+ Date now = new Date();
+ booking.setCheckinDate(now);
+ booking.setCheckoutDate(now);
+
+ hotelBooking.setBookingDetails();
+ assertFalse(hotelBooking.isBookingValid());
+
+ Calendar cal = Calendar.getInstance();
+ cal.add(Calendar.DAY_OF_MONTH, 2);
+ booking.setCheckoutDate(cal.getTime());
+
+ hotelBooking.setBookingDetails();
+ assertTrue(hotelBooking.isBookingValid());
+ assertTrue(manager.isLongRunningConversation());
+
+ hotelBooking.confirm();
+
+ ListDataModel bookings = (ListDataModel) Component.getInstance("bookings");
+ assertEquals(1, bookings.getRowCount());
+ bookings.setRowIndex(0);
+ booking = (Booking) bookings.getRowData();
+ assertEquals("NY", booking.getHotel().getCity());
+ assertEquals("gavin", booking.getUser().getUsername());
+ assertFalse(manager.isLongRunningConversation());
+
+ recentBookings = (RecentBookingsAction) Component.getInstance("recentBookings");
+ assertNotNull(recentBookings.getMostRecentBookingDate(hotelId));
+
+ bookings = (ListDataModel) Contexts.getSessionContext().get("bookings");
+ bookings.setRowIndex(0);
+ bookingList.cancel();
+
+ bookings = (ListDataModel) Contexts.getSessionContext().get("bookings");
+ assertEquals(0, bookings.getRowCount());
+ assertFalse(manager.isLongRunningConversation());
+ }
+}
Added: branches/enterprise/WFK-2_1/examples/jee6/jee6-web/src/test/java/org/jboss/seam/example/booking/test/ChangePasswordTest.java
===================================================================
--- branches/enterprise/WFK-2_1/examples/jee6/jee6-web/src/test/java/org/jboss/seam/example/booking/test/ChangePasswordTest.java (rev 0)
+++ branches/enterprise/WFK-2_1/examples/jee6/jee6-web/src/test/java/org/jboss/seam/example/booking/test/ChangePasswordTest.java 2013-06-03 16:41:11 UTC (rev 15525)
@@ -0,0 +1,97 @@
+//$Id: ChangePasswordTest.java 5810 2007-07-16 06:46:47Z gavin $
+package org.jboss.seam.example.booking.test;
+
+import org.jboss.shrinkwrap.api.Archive;
+import org.jboss.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.Contexts;
+import org.jboss.seam.contexts.Lifecycle;
+import org.jboss.seam.core.Manager;
+import org.jboss.seam.example.booking.ChangePasswordAction;
+import org.jboss.seam.example.booking.User;
+import org.jboss.seam.security.Identity;
+
+import static org.junit.Assert.*;
+
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+(a)RunWith(Arquillian.class)
+public class ChangePasswordTest {
+
+ @Deployment(name = "ChangePasswordTest")
+ @OverProtocol("Servlet 3.0")
+ public static Archive<?> createDeployment() {
+ return Deployments.bookingDeployment();
+ }
+
+ @Before
+ public void before() {
+ Lifecycle.beginCall();
+ }
+
+ @After
+ public void after() {
+ Lifecycle.endCall();
+ }
+
+ @Test
+ public void testChangePassword() throws Exception {
+ Identity identity = Identity.instance();
+
+ Contexts.getSessionContext().set("user", new User("Gavin King", "foobar", "gavin"));
+ identity.setUsername("gavin");
+ identity.setPassword("foobar");
+ identity.login();
+
+ User user = (User) Component.getInstance("user");
+ assertEquals("Gavin King", user.getName());
+ assertEquals("gavin", user.getUsername());
+ assertEquals("foobar", user.getPassword());
+ assertFalse(Manager.instance().isLongRunningConversation());
+ assertTrue(identity.isLoggedIn());
+
+ user.setPassword("xxxyyy");
+ ChangePasswordAction changePassword = (ChangePasswordAction) Component.getInstance("changePassword");
+ changePassword.setVerify("xxyyyx");
+ changePassword.changePassword();
+
+ user = (User) Component.getInstance("user");
+ assertEquals("Gavin King", user.getName());
+ assertEquals("gavin", user.getUsername());
+ assertEquals("foobar", user.getPassword());
+ assertFalse(Manager.instance().isLongRunningConversation());
+ assertTrue(identity.isLoggedIn());
+
+ user = (User) Component.getInstance("user");
+ user.setPassword("xxxyyy");
+ changePassword = (ChangePasswordAction) Component.getInstance("changePassword");
+ changePassword.setVerify("xxxyyy");
+ changePassword.changePassword();
+
+ user = (User) Component.getInstance("user");
+ assertEquals("Gavin King", user.getName());
+ assertEquals("gavin", user.getUsername());
+ assertEquals("xxxyyy", user.getPassword());
+ assertFalse(Manager.instance().isLongRunningConversation());
+ assertTrue(identity.isLoggedIn());
+
+ user = (User) Component.getInstance("user");
+ assertEquals("xxxyyy", user.getPassword());
+ user.setPassword("foobar");
+ changePassword = (ChangePasswordAction) Component.getInstance("changePassword");
+ changePassword.setVerify("foobar");
+ changePassword.changePassword();
+
+ user = (User) Component.getInstance("user");
+ assertEquals("Gavin King", user.getName());
+ assertEquals("gavin", user.getUsername());
+ assertEquals("foobar", user.getPassword());
+ assertFalse(Manager.instance().isLongRunningConversation());
+ assertTrue(identity.isLoggedIn());
+ }
+}
Added: branches/enterprise/WFK-2_1/examples/jee6/jee6-web/src/test/java/org/jboss/seam/example/booking/test/Deployments.java
===================================================================
--- branches/enterprise/WFK-2_1/examples/jee6/jee6-web/src/test/java/org/jboss/seam/example/booking/test/Deployments.java (rev 0)
+++ branches/enterprise/WFK-2_1/examples/jee6/jee6-web/src/test/java/org/jboss/seam/example/booking/test/Deployments.java 2013-06-03 16:41:11 UTC (rev 15525)
@@ -0,0 +1,39 @@
+package org.jboss.seam.example.booking.test;
+
+import java.io.File;
+import org.jboss.seam.example.booking.Booking;
+
+import org.jboss.shrinkwrap.api.ShrinkWrap;
+import org.jboss.shrinkwrap.api.spec.WebArchive;
+import org.jboss.shrinkwrap.resolver.api.maven.Maven;
+
+public class Deployments {
+
+ public static WebArchive bookingDeployment() {
+
+ File[] libs = Maven.resolver().loadPomFromFile("pom.xml")
+ .importCompileAndRuntimeDependencies()
+ .resolve().withTransitivity().asFile();
+
+ // Get File reference to src/main/webapp/WEB-INF, to avoid duplication of resources for the test archive
+ // Depends on shrinkwrap-resolver-maven-plugin to set the property
+ File webInf = new File(new File("pom.xml").getParentFile(), "src/main/webapp/WEB-INF");
+
+ return ShrinkWrap.create(WebArchive.class, "jee6-web.war")
+ .addPackage(Booking.class.getPackage())
+
+ // copy classpath resources to WAR classpath
+ .addAsWebInfResource("import.sql", "classes/import.sql")
+ .addAsWebInfResource("seam.properties", "classes/seam.properties")
+ .addAsWebInfResource("persistence.xml", "classes/META-INF/persistence.xml")
+ .addAsWebInfResource("components.xml")
+
+ // copy files from src/main/webapp to test-archive's WEB-INF
+ .addAsWebInfResource(new File(webInf, "jboss-deployment-structure.xml"))
+ .addAsWebInfResource(new File(webInf, "pages.xml"))
+ .addAsWebInfResource(new File(webInf, "ejb-jar.xml"))
+ .addAsWebInfResource(new File(webInf, "web.xml"))
+
+ .addAsLibraries(libs);
+ }
+}
Added: branches/enterprise/WFK-2_1/examples/jee6/jee6-web/src/test/java/org/jboss/seam/example/booking/test/LoginTest.java
===================================================================
--- branches/enterprise/WFK-2_1/examples/jee6/jee6-web/src/test/java/org/jboss/seam/example/booking/test/LoginTest.java (rev 0)
+++ branches/enterprise/WFK-2_1/examples/jee6/jee6-web/src/test/java/org/jboss/seam/example/booking/test/LoginTest.java 2013-06-03 16:41:11 UTC (rev 15525)
@@ -0,0 +1,85 @@
+//$Id: LoginTest.java 5810 2007-07-16 06:46:47Z gavin $
+package org.jboss.seam.example.booking.test;
+
+import org.jboss.shrinkwrap.api.Archive;
+import org.jboss.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.core.Manager;
+import org.jboss.seam.example.booking.User;
+import org.jboss.seam.security.Identity;
+import org.jboss.seam.web.Session;
+
+import static org.junit.Assert.*;
+
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+(a)RunWith(Arquillian.class)
+public class LoginTest {
+
+ @Deployment(name = "LoginTest")
+ @OverProtocol("Servlet 3.0")
+ public static Archive<?> createDeployment() {
+ return Deployments.bookingDeployment();
+ }
+
+ @Before
+ public void before() {
+ Lifecycle.beginCall();
+ }
+
+ @After
+ public void after() {
+ Lifecycle.endCall();
+ }
+
+ @Test
+ public void testLoginComponent() throws Exception {
+ Identity identity = Identity.instance();
+
+ assertFalse(identity.isLoggedIn());
+ identity.setUsername("gavin");
+ identity.setPassword("foobar");
+ identity.login();
+
+ User user = (User) Component.getInstance("user");
+ assertEquals("Gavin King", user.getName());
+ assertEquals("gavin", user.getUsername());
+ assertEquals("foobar", user.getPassword());
+ assertTrue(identity.isLoggedIn());
+ identity.logout();
+ assertFalse(identity.isLoggedIn());
+ identity.setUsername("gavin");
+ identity.setPassword("tiger");
+ identity.login();
+ assertFalse(identity.isLoggedIn());
+ }
+
+ @Test
+ public void testLogin() throws Exception {
+ Identity identity = Identity.instance();
+
+ assertFalse(identity.isLoggedIn());
+
+ identity.setUsername("gavin");
+ identity.setPassword("foobar");
+ identity.login();
+
+ User user = (User) Component.getInstance("user");
+ assertEquals("Gavin King", user.getName());
+ assertEquals("gavin", user.getUsername());
+ assertEquals("foobar", user.getPassword());
+ assertFalse(Manager.instance().isLongRunningConversation());
+ assertTrue(identity.isLoggedIn());
+
+ identity.logout();
+ assertTrue(Session.instance().isInvalid());
+
+ assertFalse(identity.isLoggedIn());
+ }
+}
Added: branches/enterprise/WFK-2_1/examples/jee6/jee6-web/src/test/resources/arquillian.xml
===================================================================
(Binary files differ)
Property changes on: branches/enterprise/WFK-2_1/examples/jee6/jee6-web/src/test/resources/arquillian.xml
___________________________________________________________________
Added: svn:mime-type
+ application/xml
Added: branches/enterprise/WFK-2_1/examples/jee6/jee6-web/src/test/resources/components.xml
===================================================================
(Binary files differ)
Property changes on: branches/enterprise/WFK-2_1/examples/jee6/jee6-web/src/test/resources/components.xml
___________________________________________________________________
Added: svn:mime-type
+ application/xml
Added: branches/enterprise/WFK-2_1/examples/jee6/jee6-web/src/test/resources/persistence.xml
===================================================================
(Binary files differ)
Property changes on: branches/enterprise/WFK-2_1/examples/jee6/jee6-web/src/test/resources/persistence.xml
___________________________________________________________________
Added: svn:mime-type
+ application/xml
11 years, 5 months
Seam SVN: r15524 - in branches/enterprise/WFK-2_1/examples: blog/blog-ear and 13 other directories.
by seam-commits@lists.jboss.org
Author: rsmeral
Date: 2013-06-03 12:29:26 -0400 (Mon, 03 Jun 2013)
New Revision: 15524
Modified:
branches/enterprise/WFK-2_1/examples/blog/blog-ear/pom.xml
branches/enterprise/WFK-2_1/examples/blog/blog-ejb/pom.xml
branches/enterprise/WFK-2_1/examples/blog/blog-web/pom.xml
branches/enterprise/WFK-2_1/examples/blog/blog-web/src/main/webapp/WEB-INF/pages.xml
branches/enterprise/WFK-2_1/examples/blog/pom.xml
branches/enterprise/WFK-2_1/examples/booking/booking-ear/pom.xml
branches/enterprise/WFK-2_1/examples/booking/booking-ejb/pom.xml
branches/enterprise/WFK-2_1/examples/booking/booking-web/pom.xml
branches/enterprise/WFK-2_1/examples/booking/build.xml
branches/enterprise/WFK-2_1/examples/booking/pom.xml
branches/enterprise/WFK-2_1/examples/groovybooking/groovybooking-web/pom.xml
branches/enterprise/WFK-2_1/examples/groovybooking/pom.xml
branches/enterprise/WFK-2_1/examples/hibernate/hibernate-web/pom.xml
branches/enterprise/WFK-2_1/examples/hibernate/pom.xml
branches/enterprise/WFK-2_1/examples/jee6/jee6-web/pom.xml
branches/enterprise/WFK-2_1/examples/jee6/pom.xml
Log:
blog, booking, groovybooking, hibernate, jee6 converted
Modified: branches/enterprise/WFK-2_1/examples/blog/blog-ear/pom.xml
===================================================================
--- branches/enterprise/WFK-2_1/examples/blog/blog-ear/pom.xml 2013-06-03 15:13:18 UTC (rev 15523)
+++ branches/enterprise/WFK-2_1/examples/blog/blog-ear/pom.xml 2013-06-03 16:29:26 UTC (rev 15524)
@@ -1,129 +1,139 @@
<?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>blog</artifactId>
- <groupId>org.jboss.seam.examples</groupId>
- <version>2.3.1.Final-redhat-2</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <artifactId>blog</artifactId>
+ <groupId>org.jboss.seam.examples</groupId>
+ <version>2.3.1-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
- <groupId>org.jboss.seam.examples.blog</groupId>
- <artifactId>blog-ear</artifactId>
- <packaging>ear</packaging>
- <name>Blog EAR Module (EE6)</name>
+ <groupId>org.jboss.seam.examples.blog</groupId>
+ <artifactId>blog-ear</artifactId>
+ <packaging>ear</packaging>
+ <name>Blog EAR Module (EE6)</name>
- <dependencies>
- <dependency>
- <groupId>org.jboss.seam.examples.blog</groupId>
- <artifactId>blog-web</artifactId>
- <type>war</type>
- </dependency>
- <dependency>
- <groupId>org.jboss.seam.examples.blog</groupId>
- <artifactId>blog-ejb</artifactId>
- <type>ejb</type>
- </dependency>
- <dependency>
- <groupId>org.jboss.seam</groupId>
- <artifactId>jboss-seam</artifactId>
- <type>ejb</type>
- <scope>compile</scope>
- </dependency>
- </dependencies>
+ <dependencies>
+ <dependency>
+ <groupId>org.jboss.seam.examples.blog</groupId>
+ <artifactId>blog-web</artifactId>
+ <type>war</type>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.seam.examples.blog</groupId>
+ <artifactId>blog-ejb</artifactId>
+ <type>ejb</type>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.seam</groupId>
+ <artifactId>jboss-seam</artifactId>
+ <type>ejb</type>
+ <scope>compile</scope>
+ </dependency>
+ </dependencies>
- <build>
- <finalName>seam-blog</finalName>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-ear-plugin</artifactId>
- <configuration>
- <version>6</version>
- <defaultLibBundleDir>lib</defaultLibBundleDir>
- <filtering>true</filtering>
- <!-- Required as indexerService cannot be initialized before the blogEntityManagerFactory is available -->
- <initializeInOrder>true</initializeInOrder>
- <modules>
+ <build>
+ <finalName>seam-blog</finalName>
+ <pluginManagement>
+ <plugins>
+ <plugin>
+ <groupId>org.jboss.as.plugins</groupId>
+ <artifactId>jboss-as-maven-plugin</artifactId>
+ <version>${version.jboss.maven.plugin}</version>
+ </plugin>
+ </plugins>
+ </pluginManagement>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-ear-plugin</artifactId>
+ <version>${version.ear.plugin}</version>
+ <configuration>
+ <version>6</version>
+ <defaultLibBundleDir>lib</defaultLibBundleDir>
+ <filtering>true</filtering>
+ <!-- Required as indexerService cannot be initialized before the blogEntityManagerFactory is available -->
+ <initializeInOrder>true</initializeInOrder>
+ <modules>
- <ejbModule>
- <groupId>org.jboss.seam.examples.blog</groupId>
- <artifactId>blog-ejb</artifactId>
- <bundleFileName>blog-ejb.jar</bundleFileName>
- </ejbModule>
+ <ejbModule>
+ <groupId>org.jboss.seam.examples.blog</groupId>
+ <artifactId>blog-ejb</artifactId>
+ <bundleFileName>blog-ejb.jar</bundleFileName>
+ </ejbModule>
- <webModule>
- <groupId>org.jboss.seam.examples.blog</groupId>
- <artifactId>blog-web</artifactId>
- <contextRoot>/seam-blog</contextRoot>
- <bundleFileName>blog-web.war</bundleFileName>
- </webModule>
+ <webModule>
+ <groupId>org.jboss.seam.examples.blog</groupId>
+ <artifactId>blog-web</artifactId>
+ <contextRoot>/seam-blog</contextRoot>
+ <bundleFileName>blog-web.war</bundleFileName>
+ </webModule>
- <ejbModule>
- <groupId>org.jboss.seam</groupId>
- <artifactId>jboss-seam</artifactId>
- <bundleFileName>jboss-seam.jar</bundleFileName>
- </ejbModule>
- </modules>
- </configuration>
- </plugin>
- </plugins>
- </build>
+ <ejbModule>
+ <groupId>org.jboss.seam</groupId>
+ <artifactId>jboss-seam</artifactId>
+ <bundleFileName>jboss-seam.jar</bundleFileName>
+ </ejbModule>
+ </modules>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
- <profiles>
- <profile>
- <id>exploded</id>
- <properties>
- <example.name>blog</example.name>
- </properties>
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-dependency-plugin</artifactId>
- <executions>
- <execution>
- <id>unpack</id>
- <phase>package</phase>
- <goals>
- <goal>unpack</goal>
- </goals>
- <configuration>
- <artifactItems>
- <artifactItem>
- <groupId>org.jboss.seam.examples.blog</groupId>
- <artifactId>blog-ear</artifactId>
- <type>ear</type>
- <overWrite>true</overWrite>
- <outputDirectory>${project.build.directory}/${project.build.finalName}-exploded/${project.build.finalName}.ear
- </outputDirectory>
- </artifactItem>
- <artifactItem>
- <groupId>org.jboss.seam.examples.blog</groupId>
- <artifactId>blog-web</artifactId>
- <type>war</type>
- <overWrite>true</overWrite>
- <outputDirectory>
- ${project.build.directory}/${project.build.finalName}-exploded/${project.build.finalName}.ear/${example.name}-web.war
- </outputDirectory>
- </artifactItem>
- <artifactItem>
- <groupId>org.jboss.seam.examples.blog</groupId>
- <artifactId>blog-ejb</artifactId>
- <type>jar</type>
- <overWrite>true</overWrite>
- <outputDirectory>
- ${project.build.directory}/${project.build.finalName}-exploded/${project.build.finalName}.ear/${example.name}-ejb.jar
- </outputDirectory>
- </artifactItem>
- </artifactItems>
- </configuration>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
- </profile>
- </profiles>
+ <profiles>
+ <profile>
+ <id>exploded</id>
+ <properties>
+ <example.name>blog</example.name>
+ </properties>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-dependency-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>unpack</id>
+ <phase>package</phase>
+ <goals>
+ <goal>unpack</goal>
+ </goals>
+ <configuration>
+ <artifactItems>
+ <artifactItem>
+ <groupId>org.jboss.seam.examples.blog</groupId>
+ <artifactId>blog-ear</artifactId>
+ <type>ear</type>
+ <overWrite>true</overWrite>
+ <outputDirectory>${project.build.directory}/${project.build.finalName}-exploded/${project.build.finalName}.ear
+ </outputDirectory>
+ </artifactItem>
+ <artifactItem>
+ <groupId>org.jboss.seam.examples.blog</groupId>
+ <artifactId>blog-web</artifactId>
+ <type>war</type>
+ <overWrite>true</overWrite>
+ <outputDirectory>
+ ${project.build.directory}/${project.build.finalName}-exploded/${project.build.finalName}.ear/${example.name}-web.war
+ </outputDirectory>
+ </artifactItem>
+ <artifactItem>
+ <groupId>org.jboss.seam.examples.blog</groupId>
+ <artifactId>blog-ejb</artifactId>
+ <type>jar</type>
+ <overWrite>true</overWrite>
+ <outputDirectory>
+ ${project.build.directory}/${project.build.finalName}-exploded/${project.build.finalName}.ear/${example.name}-ejb.jar
+ </outputDirectory>
+ </artifactItem>
+ </artifactItems>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ </profiles>
</project>
Modified: branches/enterprise/WFK-2_1/examples/blog/blog-ejb/pom.xml
===================================================================
--- branches/enterprise/WFK-2_1/examples/blog/blog-ejb/pom.xml 2013-06-03 15:13:18 UTC (rev 15523)
+++ branches/enterprise/WFK-2_1/examples/blog/blog-ejb/pom.xml 2013-06-03 16:29:26 UTC (rev 15524)
@@ -1,108 +1,222 @@
<?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>
- <groupId>org.jboss.seam.examples</groupId>
- <artifactId>blog</artifactId>
- <version>2.3.1.Final-redhat-2</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.jboss.seam.examples</groupId>
+ <artifactId>blog</artifactId>
+ <version>2.3.1-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
- <groupId>org.jboss.seam.examples.blog</groupId>
- <artifactId>blog-ejb</artifactId>
- <packaging>ejb</packaging>
- <name>Blog EJB Module (EE6)</name>
+ <groupId>org.jboss.seam.examples.blog</groupId>
+ <artifactId>blog-ejb</artifactId>
+ <packaging>ejb</packaging>
+ <name>Blog 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.slf4j</groupId>
- <artifactId>slf4j-log4j12</artifactId>
- <scope>test</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.hibernate</groupId>
- <artifactId>hibernate-core</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.hibernate</groupId>
- <artifactId>hibernate-validator</artifactId>
- <scope>provided</scope>
- </dependency>
- <!--<dependency>-->
- <!--<groupId>org.hibernate</groupId>-->
- <!--<artifactId>hibernate-annotations</artifactId>-->
- <!--</dependency>-->
- <dependency>
- <groupId>org.hibernate</groupId>
- <artifactId>hibernate-entitymanager</artifactId>
- <scope>provided</scope>
- </dependency>
+ <dependencies>
+ <!-- Seam is provided-scoped, because it is bundled as an EJB module in the EAR -->
+ <dependency>
+ <groupId>org.jboss.seam</groupId>
+ <artifactId>jboss-seam</artifactId>
+ <type>ejb</type>
+ <scope>provided</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>
+ <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.hibernate</groupId>
+ <artifactId>hibernate-core</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.hibernate</groupId>
+ <artifactId>hibernate-validator</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.hibernate</groupId>
+ <artifactId>hibernate-entitymanager</artifactId>
+ <scope>provided</scope>
+ </dependency>
- <dependency>
- <groupId>org.hibernate</groupId>
- <artifactId>hibernate-search</artifactId>
- <exclusions>
- <exclusion>
- <groupId>org.hibernate</groupId>
- <artifactId>hibernate-core</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.hibernate</groupId>
- <artifactId>ejb3-persistence</artifactId>
- </exclusion>
- <exclusion>
- <groupId>javax.transaction</groupId>
- <artifactId>jta</artifactId>
- </exclusion>
- <exclusion>
- <groupId>hsqldb</groupId>
- <artifactId>hsqldb</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
+ <dependency>
+ <groupId>org.hibernate</groupId>
+ <artifactId>hibernate-search</artifactId>
+ <exclusions>
+ <exclusion>
+ <groupId>org.hibernate</groupId>
+ <artifactId>hibernate-core</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.hibernate</groupId>
+ <artifactId>ejb3-persistence</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>javax.transaction</groupId>
+ <artifactId>jta</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>hsqldb</groupId>
+ <artifactId>hsqldb</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
- <dependency>
- <groupId>org.infinispan</groupId>
- <artifactId>infinispan-core</artifactId>
- </dependency>
- <dependency>
- <groupId>org.infinispan</groupId>
- <artifactId>infinispan-tree</artifactId>
- </dependency>
+ <dependency>
+ <groupId>org.infinispan</groupId>
+ <artifactId>infinispan-core</artifactId>
+ <exclusions>
+ <exclusion>
+ <groupId>org.jboss.spec.javax.transaction</groupId>
+ <artifactId>jboss-transaction-api_1.1_spec</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.infinispan</groupId>
+ <artifactId>infinispan-tree</artifactId>
+ </dependency>
- <dependency>
- <groupId>javax.validation</groupId>
- <artifactId>validation-api</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>
+ <dependency>
+ <groupId>javax.validation</groupId>
+ <artifactId>validation-api</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>
+ <!-- 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-blog/#{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>
+
+ <plugin>
+ <artifactId>maven-ejb-plugin</artifactId>
+ <version>${version.ejb.plugin}</version>
+ <configuration>
+ <ejbVersion>3.1</ejbVersion>
+ </configuration>
+ </plugin>
+ <!-- Skip tests by default, since they require a container -->
+ <plugin>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <skip>true</skip>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
</project>
Modified: branches/enterprise/WFK-2_1/examples/blog/blog-web/pom.xml
===================================================================
--- branches/enterprise/WFK-2_1/examples/blog/blog-web/pom.xml 2013-06-03 15:13:18 UTC (rev 15523)
+++ branches/enterprise/WFK-2_1/examples/blog/blog-web/pom.xml 2013-06-03 16:29:26 UTC (rev 15524)
@@ -6,7 +6,7 @@
<parent>
<artifactId>blog</artifactId>
<groupId>org.jboss.seam.examples</groupId>
- <version>2.3.1.Final-redhat-2</version>
+ <version>2.3.1-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
@@ -80,6 +80,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/blog/blog-web/src/main/webapp/WEB-INF/pages.xml
===================================================================
--- branches/enterprise/WFK-2_1/examples/blog/blog-web/src/main/webapp/WEB-INF/pages.xml 2013-06-03 15:13:18 UTC (rev 15523)
+++ branches/enterprise/WFK-2_1/examples/blog/blog-web/src/main/webapp/WEB-INF/pages.xml 2013-06-03 16:29:26 UTC (rev 15524)
@@ -58,9 +58,10 @@
<action execute="#{blog.hitCount.hit}"/>
</page>
- <exception class="org.hibernate.search.errors.EmptyQueryException">
+ <exception class="org.hibernate.search.errors.EmptyQueryException">
<redirect view-id="/search.xhtml">
<message severity="warn">Given query is too simple. Try again.</message>
</redirect>
</exception>
+
</pages>
Modified: branches/enterprise/WFK-2_1/examples/blog/pom.xml
===================================================================
--- branches/enterprise/WFK-2_1/examples/blog/pom.xml 2013-06-03 15:13:18 UTC (rev 15523)
+++ branches/enterprise/WFK-2_1/examples/blog/pom.xml 2013-06-03 16:29:26 UTC (rev 15524)
@@ -1,49 +1,167 @@
<?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>
- <groupId>org.jboss.seam</groupId>
- <artifactId>examples</artifactId>
- <version>2.3.1.Final-redhat-2</version>
- </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.jboss.seam.examples</groupId>
+ <artifactId>blog</artifactId>
+ <version>2.3.1.Final-redhat-2</version>
+ <packaging>pom</packaging>
+ <name>Blog Example (EE6)</name>
- <modelVersion>4.0.0</modelVersion>
- <groupId>org.jboss.seam.examples</groupId>
- <artifactId>blog</artifactId>
- <packaging>pom</packaging>
- <name>Blog Example (EE6)</name>
+ <modules>
+ <module>blog-ejb</module>
+ <module>blog-web</module>
+ <module>blog-ear</module>
+ </modules>
- <modules>
- <module>blog-ejb</module>
- <module>blog-web</module>
- <module>blog-ear</module>
- <module>blog-tests</module>
- </modules>
+ <properties>
+ <example.name>blog</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 with ShrinkWrap Resolver, uncomment
+ and customize the following property. -->
+ <!--<maven.user.settings>/path/to/custom/settings.xml</maven.user.settings>-->
+
+ <version.commons.logging>1.1.1</version.commons.logging>
+ <version.slf4j>1.6.1</version.slf4j>
+ <version.shrinkwrap.resolver>2.0.0-beta-4</version.shrinkwrap.resolver>
+
+ <!-- Plugin versions -->
+ <version.clean.plugin>2.5</version.clean.plugin>
+ <version.resources.plugin>2.6</version.resources.plugin>
+ <version.dependency.plugin>2.5.1</version.dependency.plugin>
+ <version.compiler.plugin>2.3.1</version.compiler.plugin>
+ <version.surefire.plugin>2.10</version.surefire.plugin>
+ <version.ear.plugin>2.6</version.ear.plugin>
+ <version.war.plugin>2.1.1</version.war.plugin>
+ <version.ejb.plugin>2.3</version.ejb.plugin>
+ <version.jboss.maven.plugin>7.4.Final</version.jboss.maven.plugin>
+ </properties>
- <properties>
- <example.name>blog</example.name>
- </properties>
+ <dependencyManagement>
+ <dependencies>
+ <!-- Modules -->
+ <dependency>
+ <groupId>org.jboss.seam.examples.blog</groupId>
+ <artifactId>blog-ejb</artifactId>
+ <version>${project.version}</version>
+ <type>ejb</type>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.seam.examples.blog</groupId>
+ <artifactId>blog-web</artifactId>
+ <version>${project.version}</version>
+ <type>war</type>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.seam.examples.blog</groupId>
+ <artifactId>blog-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>
+
+ <!-- Common dependencies -->
+ <dependency>
+ <groupId>commons-logging</groupId>
+ <artifactId>commons-logging</artifactId>
+ <version>${version.commons.logging}</version>
+ <scope>provided</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-log4j12</artifactId>
+ <version>${version.slf4j}</version>
+ </dependency>
+
+ <!-- TestNG is not necessary -->
+ <dependency>
+ <groupId>org.jboss.seam</groupId>
+ <artifactId>jboss-seam</artifactId>
+ <version>${project.version}</version>
+ <exclusions>
+ <exclusion>
+ <groupId>org.testng</groupId>
+ <artifactId>testng</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ </dependencies>
- <dependencyManagement>
- <dependencies>
- <dependency>
- <groupId>org.jboss.seam.examples.blog</groupId>
- <artifactId>blog-ejb</artifactId>
- <version>${project.version}</version>
- <type>ejb</type>
- </dependency>
- <dependency>
- <groupId>org.jboss.seam.examples.blog</groupId>
- <artifactId>blog-web</artifactId>
- <version>${project.version}</version>
- <type>war</type>
- </dependency>
- <dependency>
- <groupId>org.jboss.seam.examples.blog</groupId>
- <artifactId>blog-ear</artifactId>
- <version>${project.version}</version>
- </dependency>
- </dependencies>
- </dependencyManagement>
+ </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>
+ </systemPropertyVariables>
+ </configuration>
+ </plugin>
+ <plugin>
+ <artifactId>maven-dependency-plugin</artifactId>
+ <version>${version.dependency.plugin}</version>
+ </plugin>
+ <plugin>
+ <artifactId>maven-resources-plugin</artifactId>
+ <version>${version.resources.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>
+
+ <plugins>
+ <plugin>
+ <artifactId>maven-clean-plugin</artifactId>
+ <version>${version.clean.plugin}</version>
+ <!-- Delete lucene indexes on clean -->
+ <configuration>
+ <filesets>
+ <fileset>
+ <directory>blogindexes</directory>
+ </fileset>
+ </filesets>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
</project>
Modified: branches/enterprise/WFK-2_1/examples/booking/booking-ear/pom.xml
===================================================================
--- branches/enterprise/WFK-2_1/examples/booking/booking-ear/pom.xml 2013-06-03 15:13:18 UTC (rev 15523)
+++ branches/enterprise/WFK-2_1/examples/booking/booking-ear/pom.xml 2013-06-03 16:29:26 UTC (rev 15524)
@@ -2,16 +2,16 @@
<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>booking</artifactId>
<groupId>org.jboss.seam.examples</groupId>
- <version>2.3.1.Final-redhat-2</version>
+ <artifactId>booking</artifactId>
+ <version>2.3.1-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<groupId>org.jboss.seam.examples.booking</groupId>
<artifactId>booking-ear</artifactId>
<packaging>ear</packaging>
- <name>Booking EAR Module</name>
+ <name>Booking EAR Module (EE6)</name>
<dependencies>
<dependency>
@@ -53,10 +53,20 @@
<build>
<finalName>seam-booking</finalName>
+ <pluginManagement>
+ <plugins>
+ <plugin>
+ <groupId>org.jboss.as.plugins</groupId>
+ <artifactId>jboss-as-maven-plugin</artifactId>
+ <version>${version.jboss.maven.plugin}</version>
+ </plugin>
+ </plugins>
+ </pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-ear-plugin</artifactId>
+ <version>${version.ear.plugin}</version>
<configuration>
<defaultLibBundleDir>lib</defaultLibBundleDir>
<filtering>true</filtering>
@@ -80,39 +90,6 @@
</modules>
</configuration>
</plugin>
- <plugin>
- <groupId>org.jboss.as.plugins</groupId>
- <artifactId>jboss-as-maven-plugin</artifactId>
- <executions>
- <!-- This requires to be enabled manually as <enabled>true</enabled> doesn't
- work -->
- <!-- <execution> -->
- <!-- <id>add-datasource</id> -->
- <!-- <phase>package</phase> -->
- <!-- <configuration> -->
- <!-- <address>subsystem=datasources,data-source=java:/bookingDatasource</address> -->
- <!-- <properties> -->
- <!-- <connection-url>jdbc:h2:mem:test;DB_CLOSE_DELAY=-1</connection-url> -->
- <!-- <jndi-name>java:/bookingDatasource</jndi-name> -->
- <!-- <enabled>true</enabled> -->
- <!-- <pool-name>bookingDSPool</pool-name> -->
- <!-- <user-name>sa</user-name> -->
- <!-- <driver-name>h2</driver-name> -->
- <!-- </properties> -->
- <!-- </configuration> -->
- <!-- <goals> -->
- <!-- <goal>add-resource</goal> -->
- <!-- </goals> -->
- <!-- </execution> -->
- <!-- Datasource has to be created before running deploy -->
- <execution>
- <phase></phase>
- <goals>
- <goal>deploy</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
</plugins>
</build>
@@ -162,8 +139,8 @@
</execution>
</executions>
</plugin>
- </plugins>
- </build>
+ </plugins>
+ </build>
</profile>
</profiles>
</project>
Modified: branches/enterprise/WFK-2_1/examples/booking/booking-ejb/pom.xml
===================================================================
--- branches/enterprise/WFK-2_1/examples/booking/booking-ejb/pom.xml 2013-06-03 15:13:18 UTC (rev 15523)
+++ branches/enterprise/WFK-2_1/examples/booking/booking-ejb/pom.xml 2013-06-03 16:29:26 UTC (rev 15524)
@@ -2,19 +2,18 @@
<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>booking</artifactId>
- <groupId>org.jboss.seam.examples</groupId>
- <version>2.3.1.Final-redhat-2</version>
+ <version>2.3.1-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<groupId>org.jboss.seam.examples.booking</groupId>
<artifactId>booking-ejb</artifactId>
<packaging>ejb</packaging>
- <name>Booking EJB Module</name>
-
+ <name>Booking EJB Module (EE6)</name>
+
<dependencies>
-
<dependency>
<groupId>org.hibernate.javax.persistence</groupId>
<artifactId>hibernate-jpa-2.0-api</artifactId>
@@ -51,6 +50,32 @@
<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>
@@ -60,6 +85,7 @@
<plugins>
<plugin>
<artifactId>maven-resources-plugin</artifactId>
+ <version>${version.resources.plugin}</version>
<executions>
<execution>
<id>copy-cluster-resources</id>
@@ -76,7 +102,7 @@
<include>**/*</include>
</includes>
</resource>
- </resources>
+ </resources>
</configuration>
</execution>
</executions>
@@ -84,6 +110,83 @@
</plugins>
</build>
</profile>
+
+ <profile>
+ <id>integration-tests</id>
+ <activation>
+ <property>
+ <name>arquillian</name>
+ </property>
+ </activation>
+ <properties>
+ <jndiPattern>java:app/seam-booking/#{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>
Modified: branches/enterprise/WFK-2_1/examples/booking/booking-web/pom.xml
===================================================================
--- branches/enterprise/WFK-2_1/examples/booking/booking-web/pom.xml 2013-06-03 15:13:18 UTC (rev 15523)
+++ branches/enterprise/WFK-2_1/examples/booking/booking-web/pom.xml 2013-06-03 16:29:26 UTC (rev 15524)
@@ -2,16 +2,16 @@
<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>booking</artifactId>
- <groupId>org.jboss.seam.examples</groupId>
- <version>2.3.1.Final-redhat-2</version>
+ <version>2.3.1-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<groupId>org.jboss.seam.examples.booking</groupId>
<artifactId>booking-web</artifactId>
<packaging>war</packaging>
- <name>Booking Web Module</name>
+ <name>Booking Web Module (EE6)</name>
<properties>
<!-- filtering property for components.xml -->
@@ -84,6 +84,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/booking/build.xml
===================================================================
(Binary files differ)
Modified: branches/enterprise/WFK-2_1/examples/booking/pom.xml
===================================================================
--- branches/enterprise/WFK-2_1/examples/booking/pom.xml 2013-06-03 15:13:18 UTC (rev 15523)
+++ branches/enterprise/WFK-2_1/examples/booking/pom.xml 2013-06-03 16:29:26 UTC (rev 15524)
@@ -1,30 +1,49 @@
<?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>
- <groupId>org.jboss.seam.examples</groupId>
- <artifactId>booking</artifactId>
- <parent>
- <groupId>org.jboss.seam</groupId>
- <artifactId>examples</artifactId>
- <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>booking</artifactId>
+ <version>2.3.1.Final-redhat-2</version>
<packaging>pom</packaging>
<name>Booking Example (EE6)</name>
<properties>
<example.name>booking</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 with ShrinkWrap Resolver, uncomment
+ and customize the following property. -->
+ <!--<maven.user.settings>/path/to/custom/settings.xml</maven.user.settings>-->
+
+ <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.resources.plugin>2.6</version.resources.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.ejb.plugin>2.3</version.ejb.plugin>
+ <version.jboss.maven.plugin>7.4.Final</version.jboss.maven.plugin>
</properties>
<modules>
- <module>booking-ear</module>
- <module>booking-ejb</module>
- <module>booking-web</module>
- <module>booking-tests</module>
+ <module>booking-ear</module>
+ <module>booking-ejb</module>
+ <module>booking-web</module>
</modules>
<dependencyManagement>
<dependencies>
+ <!-- Modules -->
<dependency>
<groupId>org.jboss.seam.examples.booking</groupId>
<artifactId>booking-ejb</artifactId>
@@ -43,6 +62,82 @@
<version>${project.version}</version>
<type>ear</type>
</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>
+
+ <!-- Common provided dependencies -->
+ <dependency>
+ <groupId>commons-logging</groupId>
+ <artifactId>commons-logging</artifactId>
+ <version>${version.commons.logging}</version>
+ <scope>provided</scope>
+ </dependency>
+
+ <!-- TestNG is not necessary -->
+ <dependency>
+ <groupId>org.jboss.seam</groupId>
+ <artifactId>jboss-seam</artifactId>
+ <version>${project.version}</version>
+ <exclusions>
+ <exclusion>
+ <groupId>org.testng</groupId>
+ <artifactId>testng</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>junit</groupId>
+ <artifactId>junit</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>
+ </systemPropertyVariables>
+ </configuration>
+ </plugin>
+ <plugin>
+ <artifactId>maven-dependency-plugin</artifactId>
+ <version>${version.dependency.plugin}</version>
+ </plugin>
+ <plugin>
+ <artifactId>maven-resources-plugin</artifactId>
+ <version>${version.resources.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/groovybooking/groovybooking-web/pom.xml
===================================================================
--- branches/enterprise/WFK-2_1/examples/groovybooking/groovybooking-web/pom.xml 2013-06-03 15:13:18 UTC (rev 15523)
+++ branches/enterprise/WFK-2_1/examples/groovybooking/groovybooking-web/pom.xml 2013-06-03 16:29:26 UTC (rev 15524)
@@ -1,282 +1,234 @@
<?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>
+ <modelVersion>4.0.0</modelVersion>
- <parent>
- <artifactId>groovybooking</artifactId>
- <groupId>org.jboss.seam.examples</groupId>
- <version>2.3.1.Final-redhat-2</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
+ <parent>
+ <artifactId>groovybooking</artifactId>
+ <groupId>org.jboss.seam.examples</groupId>
+ <version>2.3.1-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
- <groupId>org.jboss.seam.examples.groovybooking</groupId>
- <artifactId>groovybooking-web</artifactId>
- <packaging>war</packaging>
- <name>Groovy Booking Web Module (EE6)</name>
+ <groupId>org.jboss.seam.examples.groovybooking</groupId>
+ <artifactId>groovybooking-web</artifactId>
+ <packaging>war</packaging>
+ <name>Groovy Booking Web Module (EE6)</name>
- <properties>
- <!-- filtering property for components.xml -->
- <jndiPattern>java:app/groovybooking-ejb/#{ejbName}</jndiPattern>
- <debug>true</debug>
- <loadPersistenceUnits>false</loadPersistenceUnits>
- <gmaven.runtime>1.5</gmaven.runtime>
- </properties>
+ <properties>
+ <!-- filtering property for components.xml -->
+ <jndiPattern>java:app/groovybooking-web/#{ejbName}</jndiPattern>
+ <debug>true</debug>
+ <loadPersistenceUnits>false</loadPersistenceUnits>
+ <gmaven.runtime>1.5</gmaven.runtime>
+ </properties>
- <dependencies>
- <dependency>
- <groupId>org.jboss.seam</groupId>
- <artifactId>jboss-seam</artifactId>
- <type>ejb</type>
- <scope>compile</scope>
- </dependency>
- <dependency>
- <groupId>org.jboss.seam</groupId>
- <artifactId>jboss-seam-ui</artifactId>
- </dependency>
- <dependency>
- <groupId>org.jboss.seam</groupId>
- <artifactId>jboss-seam-debug</artifactId>
- </dependency>
- <dependency>
- <groupId>commons-beanutils</groupId>
- <artifactId>commons-beanutils</artifactId>
- <exclusions>
- <exclusion>
- <groupId>commons-collections</groupId>
- <artifactId>commons-collections</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- <dependency>
- <groupId>commons-logging</groupId>
- <artifactId>commons-logging</artifactId>
- </dependency>
- <dependency>
- <groupId>org.richfaces.ui</groupId>
- <artifactId>richfaces-components-ui</artifactId>
- </dependency>
- <dependency>
- <groupId>org.richfaces.core</groupId>
- <artifactId>richfaces-core-impl</artifactId>
- </dependency>
- <dependency>
- <groupId>org.richfaces.core</groupId>
- <artifactId>richfaces-core-api</artifactId>
- </dependency>
- <dependency>
- <groupId>org.codehaus.groovy</groupId>
- <artifactId>groovy-all</artifactId>
- </dependency>
- <!-- <dependency>
- <groupId>org.eclipse.jdt</groupId>
- <artifactId>core</artifactId>
- </dependency>-->
- <dependency>
- <groupId>org.drools</groupId>
- <artifactId>drools-core</artifactId>
- <exclusions>
- <exclusion>
- <groupId>joda-time</groupId>
- <artifactId>joda-time</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- <dependency>
- <groupId>org.drools</groupId>
- <artifactId>drools-decisiontables</artifactId>
- </dependency>
- <dependency>
- <groupId>org.drools</groupId>
- <artifactId>drools-compiler</artifactId>
- </dependency>
- <dependency>
- <groupId>org.drools</groupId>
- <artifactId>drools-templates</artifactId>
- </dependency>
- <dependency>
- <groupId>org.drools</groupId>
- <artifactId>knowledge-api</artifactId>
- </dependency>
- <dependency>
- <groupId>org.jboss.el</groupId>
- <artifactId>jboss-el</artifactId>
- </dependency>
- <dependency>
- <groupId>org.hibernate</groupId>
- <artifactId>hibernate-validator</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>
- <dependency>
- <groupId>org.jboss.spec.javax.servlet</groupId>
- <artifactId>jboss-servlet-api_3.0_spec</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.hibernate.javax.persistence</groupId>
- <artifactId>hibernate-jpa-2.0-api</artifactId>
- <scope>provided</scope>
- </dependency>
- </dependencies>
+ <dependencies>
+ <dependency>
+ <groupId>org.jboss.seam</groupId>
+ <artifactId>jboss-seam</artifactId>
+ <type>ejb</type>
+ <scope>compile</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.seam</groupId>
+ <artifactId>jboss-seam-ui</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.seam</groupId>
+ <artifactId>jboss-seam-debug</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>commons-beanutils</groupId>
+ <artifactId>commons-beanutils</artifactId>
+ <exclusions>
+ <exclusion>
+ <groupId>commons-collections</groupId>
+ <artifactId>commons-collections</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>commons-logging</groupId>
+ <artifactId>commons-logging</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.richfaces.ui</groupId>
+ <artifactId>richfaces-components-ui</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.richfaces.core</groupId>
+ <artifactId>richfaces-core-impl</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.richfaces.core</groupId>
+ <artifactId>richfaces-core-api</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.codehaus.groovy</groupId>
+ <artifactId>groovy-all</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.eclipse.jdt</groupId>
+ <artifactId>core</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.drools</groupId>
+ <artifactId>drools-core</artifactId>
+ <exclusions>
+ <exclusion>
+ <groupId>joda-time</groupId>
+ <artifactId>joda-time</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.drools</groupId>
+ <artifactId>drools-decisiontables</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.drools</groupId>
+ <artifactId>drools-compiler</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.drools</groupId>
+ <artifactId>drools-templates</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.drools</groupId>
+ <artifactId>knowledge-api</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.el</groupId>
+ <artifactId>jboss-el</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.hibernate</groupId>
+ <artifactId>hibernate-validator</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>
+ <dependency>
+ <groupId>org.jboss.spec.javax.servlet</groupId>
+ <artifactId>jboss-servlet-api_3.0_spec</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.hibernate.javax.persistence</groupId>
+ <artifactId>hibernate-jpa-2.0-api</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ </dependencies>
- <build>
- <finalName>groovybooking-web</finalName>
- <plugins>
- <!-- Can't use gmaven-plugin because hot deployment won't work otherwise -->
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-antrun-plugin</artifactId>
- <executions>
- <execution>
- <id>compile-groovy-files</id>
- <phase>generate-resources</phase>
- <configuration>
- <tasks>
- <taskdef name="groovyc" classname="org.codehaus.groovy.ant.Groovyc">
- <classpath refid="maven.compile.classpath"/>
- </taskdef>
- <mkdir dir="${project.build.outputDirectory}"/>
- <groovyc destdir="${project.build.outputDirectory}"
+ <build>
+ <finalName>groovybooking-web</finalName>
+ <pluginManagement>
+ <plugins>
+ <plugin>
+ <groupId>org.jboss.as.plugins</groupId>
+ <artifactId>jboss-as-maven-plugin</artifactId>
+ <version>${version.jboss.maven.plugin}</version>
+ </plugin>
+ </plugins>
+ </pluginManagement>
+ <plugins>
+ <!-- Can't use gmaven-plugin because hot deployment won't work otherwise -->
+ <plugin>
+ <artifactId>maven-antrun-plugin</artifactId>
+ <version>${version.antrun.plugin}</version>
+ <executions>
+ <execution>
+ <id>compile-groovy-files</id>
+ <phase>generate-resources</phase>
+ <configuration>
+ <tasks>
+ <taskdef name="groovyc" classname="org.codehaus.groovy.ant.Groovyc">
+ <classpath refid="maven.compile.classpath"/>
+ </taskdef>
+ <mkdir dir="${project.build.outputDirectory}"/>
+ <groovyc destdir="${project.build.outputDirectory}"
srcdir="${basedir}/src/main/groovy/"
listfiles="true">
- <classpath refid="maven.compile.classpath"/>
- <include name="**/model/**"/>
- </groovyc>
- </tasks>
- </configuration>
- <goals>
- <goal>run</goal>
- </goals>
- </execution>
- <execution>
- <id>copy-class-files</id>
- <phase>prepare-package</phase>
- <configuration>
- <tasks>
- <property name="dev.dir"
+ <classpath refid="maven.compile.classpath"/>
+ <include name="**/model/**"/>
+ </groovyc>
+ </tasks>
+ </configuration>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ </execution>
+ <execution>
+ <id>copy-class-files</id>
+ <phase>prepare-package</phase>
+ <configuration>
+ <tasks>
+ <property name="dev.dir"
value="${project.build.directory}/${project.build.finalName}/WEB-INF/dev"/>
- <mkdir dir="${dev.dir}"/>
- <copy todir="${dev.dir}">
- <fileset dir="${basedir}/src/main/groovy/">
- <include name="**/action/**"/>
- </fileset>
- </copy>
- <move todir="${dev.dir}">
- <fileset dir="${project.build.outputDirectory}">
- <include name="**/AuthenticatorAction.class"/>
- <include name="**/ChangePasswordAction.class"/>
- </fileset>
- </move>
- </tasks>
- </configuration>
- <goals>
- <goal>run</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
+ <mkdir dir="${dev.dir}"/>
+ <copy todir="${dev.dir}">
+ <fileset dir="${basedir}/src/main/groovy/">
+ <include name="**/action/**"/>
+ </fileset>
+ </copy>
+ <move todir="${dev.dir}">
+ <fileset dir="${project.build.outputDirectory}">
+ <include name="**/AuthenticatorAction.class"/>
+ <include name="**/ChangePasswordAction.class"/>
+ </fileset>
+ </move>
+ </tasks>
+ </configuration>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
- <plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>build-helper-maven-plugin</artifactId>
- <executions>
- <execution>
- <id>add-source</id>
- <phase>generate-sources</phase>
- <goals>
- <goal>add-source</goal>
- </goals>
- <configuration>
- <sources>
- <source>${basedir}/src/main/groovy/action</source>
- </sources>
- <resources>
- <!-- setup classpath with files previously compiled with groovyc -->
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>build-helper-maven-plugin</artifactId>
+ <version>${version.build.helper.plugin}</version>
+ <executions>
+ <execution>
+ <id>add-source</id>
+ <phase>generate-sources</phase>
+ <goals>
+ <goal>add-source</goal>
+ </goals>
+ <configuration>
+ <sources>
+ <source>${basedir}/src/main/groovy/action</source>
+ </sources>
+ <resources>
+ <!-- setup classpath with files previously compiled with groovyc -->
+ <resource>
+ <directory>${project.build.outputDirectory}</directory>
+ </resource>
+ </resources>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-war-plugin</artifactId>
+ <version>${version.war.plugin}</version>
+ <configuration>
+ <webResources>
<resource>
- <directory>${project.build.outputDirectory}</directory>
+ <directory>src/main/webapp</directory>
+ <filtering>true</filtering>
</resource>
- </resources>
- </configuration>
- </execution>
- </executions>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-war-plugin</artifactId>
- <configuration>
- <webResources>
- <resource>
- <directory>src/main/webapp</directory>
- <filtering>true</filtering>
- </resource>
- </webResources>
- <attachClasses>true</attachClasses>
- </configuration>
- </plugin>
- </plugins>
- <pluginManagement>
- <plugins>
- <!--This plugin's configuration is used to store Eclipse m2e settings only. It has no influence on the Maven build itself.-->
- <plugin>
- <groupId>org.eclipse.m2e</groupId>
- <artifactId>lifecycle-mapping</artifactId>
- <version>1.0.0</version>
- <configuration>
- <lifecycleMappingMetadata>
- <pluginExecutions>
- <pluginExecution>
- <pluginExecutionFilter>
- <groupId>
- org.apache.maven.plugins
- </groupId>
- <artifactId>
- maven-antrun-plugin
- </artifactId>
- <versionRange>
- [1.3,)
- </versionRange>
- <goals>
- <goal>run</goal>
- </goals>
- </pluginExecutionFilter>
- <action>
- <ignore></ignore>
- </action>
- </pluginExecution>
- </pluginExecutions>
- </lifecycleMappingMetadata>
- </configuration>
- </plugin>
- </plugins>
- </pluginManagement>
- </build>
-
- <profiles>
- <profile>
- <id>ftest-jbossas</id>
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-antrun-plugin</artifactId>
- <executions>
- <execution>
- <id>wait-for-application</id>
- <phase>none</phase>
- </execution>
- <execution>
- <id>stop-selenium</id>
- <phase>none</phase>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
- </profile>
- </profiles>
+ </webResources>
+ <attachClasses>true</attachClasses>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
</project>
Modified: branches/enterprise/WFK-2_1/examples/groovybooking/pom.xml
===================================================================
--- branches/enterprise/WFK-2_1/examples/groovybooking/pom.xml 2013-06-03 15:13:18 UTC (rev 15523)
+++ branches/enterprise/WFK-2_1/examples/groovybooking/pom.xml 2013-06-03 16:29:26 UTC (rev 15524)
@@ -3,25 +3,41 @@
<modelVersion>4.0.0</modelVersion>
<groupId>org.jboss.seam.examples</groupId>
<artifactId>groovybooking</artifactId>
- <parent>
- <groupId>org.jboss.seam</groupId>
- <artifactId>examples</artifactId>
- <version>2.3.1.Final-redhat-2</version>
- </parent>
+ <version>2.3.1.Final-redhat-2</version>
<packaging>pom</packaging>
<name>Groovy Booking Example (EE6)</name>
<properties>
<example.name>groovybooking</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 custom Maven settings with ShrinkWrap Resolver, uncomment
+ and customize the following property. -->
+ <!--<maven.user.settings>/path/to/custom/settings.xml</maven.user.settings>-->
+
+ <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.resources.plugin>2.6</version.resources.plugin>
+ <version.antrun.plugin>1.7</version.antrun.plugin>
+ <version.build.helper.plugin>1.7</version.build.helper.plugin>
+ <version.surefire.plugin>2.10</version.surefire.plugin>
+ <version.compiler.plugin>2.3.1</version.compiler.plugin>
+ <version.war.plugin>2.1.1</version.war.plugin>
+ <version.jboss.maven.plugin>7.4.Final</version.jboss.maven.plugin>
</properties>
<modules>
<module>groovybooking-web</module>
- <module>groovybooking-tests</module>
</modules>
<dependencyManagement>
<dependencies>
+ <!-- Modules -->
<dependency>
<groupId>org.jboss.seam.examples.groovybooking</groupId>
<artifactId>groovybooking-web</artifactId>
@@ -34,6 +50,82 @@
<version>${project.version}</version>
<classifier>classes</classifier>
</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>
+
+ <!-- Common provided dependencies -->
+ <dependency>
+ <groupId>commons-logging</groupId>
+ <artifactId>commons-logging</artifactId>
+ <version>${version.commons.logging}</version>
+ <scope>provided</scope>
+ </dependency>
+
+ <!-- TestNG is not necessary -->
+ <dependency>
+ <groupId>org.jboss.seam</groupId>
+ <artifactId>jboss-seam</artifactId>
+ <version>${project.version}</version>
+ <exclusions>
+ <exclusion>
+ <groupId>org.testng</groupId>
+ <artifactId>testng</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>junit</groupId>
+ <artifactId>junit</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>
+ </systemPropertyVariables>
+ </configuration>
+ </plugin>
+ <plugin>
+ <artifactId>maven-dependency-plugin</artifactId>
+ <version>${version.dependency.plugin}</version>
+ </plugin>
+ <plugin>
+ <artifactId>maven-resources-plugin</artifactId>
+ <version>${version.resources.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/hibernate/hibernate-web/pom.xml
===================================================================
--- branches/enterprise/WFK-2_1/examples/hibernate/hibernate-web/pom.xml 2013-06-03 15:13:18 UTC (rev 15523)
+++ branches/enterprise/WFK-2_1/examples/hibernate/hibernate-web/pom.xml 2013-06-03 16:29:26 UTC (rev 15524)
@@ -1,106 +1,211 @@
<?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>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.jboss.seam.examples</groupId>
+ <artifactId>hibernate</artifactId>
+ <version>2.3.1-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
- <parent>
- <artifactId>hibernate</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.hibernate</groupId>
+ <artifactId>hibernate-web</artifactId>
+ <packaging>war</packaging>
+ <name>Hibernate Web Module (EE6)</name>
- <groupId>org.jboss.seam.examples.hibernate</groupId>
- <artifactId>hibernate-web</artifactId>
- <packaging>war</packaging>
- <name>Hibernate Web Module (EE6)</name>
+ <dependencies>
+ <dependency>
+ <groupId>org.jboss.seam</groupId>
+ <artifactId>jboss-seam</artifactId>
+ <type>ejb</type>
+ <scope>compile</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.seam</groupId>
+ <artifactId>jboss-seam-ui</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.seam</groupId>
+ <artifactId>jboss-seam-debug</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>commons-beanutils</groupId>
+ <artifactId>commons-beanutils</artifactId>
+ <exclusions>
+ <exclusion>
+ <groupId>commons-collections</groupId>
+ <artifactId>commons-collections</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>commons-logging</groupId>
+ <artifactId>commons-logging</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.el</groupId>
+ <artifactId>jboss-el</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.hibernate</groupId>
+ <artifactId>hibernate-validator</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.hibernate</groupId>
+ <artifactId>hibernate-core</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.faces</groupId>
+ <artifactId>jboss-jsf-api_2.1_spec</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.richfaces.ui</groupId>
+ <artifactId>richfaces-components-ui</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.richfaces.core</groupId>
+ <artifactId>richfaces-core-impl</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.richfaces.core</groupId>
+ <artifactId>richfaces-core-api</artifactId>
+ </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/hibernate-web/#{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>
- <build>
- <finalName>hibernate-web</finalName>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-war-plugin</artifactId>
- <configuration>
- <webResources>
- <resource>
- <directory>src/main/webapp</directory>
- <filtering>true</filtering>
- </resource>
- </webResources>
- <attachClasses>true</attachClasses>
- </configuration>
- </plugin>
- </plugins>
- </build>
+ <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>
- <dependencies>
- <dependency>
- <groupId>org.jboss.seam</groupId>
- <artifactId>jboss-seam</artifactId>
- <type>ejb</type>
- <scope>compile</scope>
- </dependency>
- <dependency>
- <groupId>org.jboss.seam</groupId>
- <artifactId>jboss-seam-ui</artifactId>
- </dependency>
- <dependency>
- <groupId>org.jboss.seam</groupId>
- <artifactId>jboss-seam-debug</artifactId>
- </dependency>
- <dependency>
- <groupId>commons-beanutils</groupId>
- <artifactId>commons-beanutils</artifactId>
- <exclusions>
- <exclusion>
- <groupId>commons-collections</groupId>
- <artifactId>commons-collections</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- <dependency>
- <groupId>commons-logging</groupId>
- <artifactId>commons-logging</artifactId>
- </dependency>
- <dependency>
- <groupId>org.jboss.el</groupId>
- <artifactId>jboss-el</artifactId>
- </dependency>
- <dependency>
- <groupId>org.hibernate</groupId>
- <artifactId>hibernate-validator</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.hibernate</groupId>
- <artifactId>hibernate-core</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.faces</groupId>
- <artifactId>jboss-jsf-api_2.1_spec</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.richfaces.ui</groupId>
- <artifactId>richfaces-components-ui</artifactId>
- </dependency>
- <dependency>
- <groupId>org.richfaces.core</groupId>
- <artifactId>richfaces-core-impl</artifactId>
- </dependency>
- <dependency>
- <groupId>org.richfaces.core</groupId>
- <artifactId>richfaces-core-api</artifactId>
- </dependency>
-
- </dependencies>
+ <build>
+ <finalName>hibernate-web</finalName>
+ <pluginManagement>
+ <plugins>
+ <plugin>
+ <groupId>org.jboss.as.plugins</groupId>
+ <artifactId>jboss-as-maven-plugin</artifactId>
+ <version>${version.jboss.maven.plugin}</version>
+ </plugin>
+ </plugins>
+ </pluginManagement>
+ <plugins>
+ <!-- Skip tests by default -->
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <skip>true</skip>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-war-plugin</artifactId>
+ <version>${version.war.plugin}</version>
+ <configuration>
+ <webResources>
+ <resource>
+ <directory>src/main/webapp</directory>
+ <filtering>true</filtering>
+ </resource>
+ </webResources>
+ <attachClasses>true</attachClasses>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
</project>
Modified: branches/enterprise/WFK-2_1/examples/hibernate/pom.xml
===================================================================
--- branches/enterprise/WFK-2_1/examples/hibernate/pom.xml 2013-06-03 15:13:18 UTC (rev 15523)
+++ branches/enterprise/WFK-2_1/examples/hibernate/pom.xml 2013-06-03 16:29:26 UTC (rev 15524)
@@ -1,44 +1,134 @@
<?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>
+ <groupId>org.jboss.seam.examples</groupId>
+ <artifactId>hibernate</artifactId>
+ <version>2.3.1.Final-redhat-2</version>
+ <packaging>pom</packaging>
+ <name>Hibernate Example (EE6)</name>
- <parent>
- <groupId>org.jboss.seam</groupId>
- <artifactId>examples</artifactId>
- <version>2.3.1.Final-redhat-2</version>
- </parent>
+ <properties>
+ <example.name>hibernate</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 with ShrinkWrap Resolver, uncomment
+ and customize the following property. -->
+ <!--<maven.user.settings>/path/to/custom/settings.xml</maven.user.settings>-->
+
+ <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.resources.plugin>2.6</version.resources.plugin>
+ <version.surefire.plugin>2.10</version.surefire.plugin>
+ <version.compiler.plugin>2.3.1</version.compiler.plugin>
+ <version.war.plugin>2.1.1</version.war.plugin>
+ <version.jboss.maven.plugin>7.4.Final</version.jboss.maven.plugin>
+ </properties>
- <modelVersion>4.0.0</modelVersion>
- <groupId>org.jboss.seam.examples</groupId>
- <artifactId>hibernate</artifactId>
- <packaging>pom</packaging>
+ <modules>
+ <module>hibernate-web</module>
+ </modules>
- <name>Hibernate Example (EE6)</name>
-
- <properties>
- <example.name>hibernate</example.name>
- </properties>
-
- <modules>
- <module>hibernate-web</module>
- <module>hibernate-tests</module>
- </modules>
-
- <dependencyManagement>
- <dependencies>
- <dependency>
- <groupId>org.jboss.seam.examples.hibernate</groupId>
- <artifactId>hibernate-web</artifactId>
- <version>${project.version}</version>
- <type>war</type>
- </dependency>
- <dependency>
- <groupId>org.jboss.seam.examples.hibernate</groupId>
- <artifactId>hibernate-web</artifactId>
- <version>${project.version}</version>
- <classifier>classes</classifier>
- </dependency>
- </dependencies>
- </dependencyManagement>
-
+ <dependencyManagement>
+ <dependencies>
+ <!-- Modules -->
+ <dependency>
+ <groupId>org.jboss.seam.examples.hibernate</groupId>
+ <artifactId>hibernate-web</artifactId>
+ <version>${project.version}</version>
+ <type>war</type>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.seam.examples.hibernate</groupId>
+ <artifactId>hibernate-web</artifactId>
+ <version>${project.version}</version>
+ <classifier>classes</classifier>
+ </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>
+
+ <!-- Common provided dependencies -->
+ <dependency>
+ <groupId>commons-logging</groupId>
+ <artifactId>commons-logging</artifactId>
+ <version>${version.commons.logging}</version>
+ <scope>provided</scope>
+ </dependency>
+
+ <!-- TestNG is not necessary -->
+ <dependency>
+ <groupId>org.jboss.seam</groupId>
+ <artifactId>jboss-seam</artifactId>
+ <version>${project.version}</version>
+ <exclusions>
+ <exclusion>
+ <groupId>org.testng</groupId>
+ <artifactId>testng</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>junit</groupId>
+ <artifactId>junit</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>
+ </systemPropertyVariables>
+ </configuration>
+ </plugin>
+ <plugin>
+ <artifactId>maven-dependency-plugin</artifactId>
+ <version>${version.dependency.plugin}</version>
+ </plugin>
+ <plugin>
+ <artifactId>maven-resources-plugin</artifactId>
+ <version>${version.resources.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/jee6/jee6-web/pom.xml
===================================================================
--- branches/enterprise/WFK-2_1/examples/jee6/jee6-web/pom.xml 2013-06-03 15:13:18 UTC (rev 15523)
+++ branches/enterprise/WFK-2_1/examples/jee6/jee6-web/pom.xml 2013-06-03 16:29:26 UTC (rev 15524)
@@ -1,26 +1,32 @@
<?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">
+<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>jee6</artifactId>
- <groupId>org.jboss.seam.examples</groupId>
- <version>2.3.1.Final-redhat-2</version>
+ <version>2.3.1-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
-
- <groupId>org.jboss.seam.examples</groupId>
+
+ <groupId>org.jboss.seam.examples.jee6</groupId>
<artifactId>jee6-web</artifactId>
<packaging>war</packaging>
- <name>Booking Web Module</name>
-
+ <name>Booking EE6 Web Module</name>
+
<properties>
- <!-- filtering property for components.xml -->
<jndiPattern>java:app/jee6-web/#{ejbName}</jndiPattern>
<distributable>false</distributable>
</properties>
-
+
<dependencies>
<dependency>
+ <groupId>org.jboss.seam</groupId>
+ <artifactId>jboss-seam</artifactId>
+ <type>ejb</type>
+ <scope>compile</scope>
+ </dependency>
+ <dependency>
<groupId>org.hibernate.javax.persistence</groupId>
<artifactId>hibernate-jpa-2.0-api</artifactId>
<scope>provided</scope>
@@ -52,25 +58,6 @@
</dependency>
<dependency>
<groupId>org.jboss.seam</groupId>
- <artifactId>jboss-seam</artifactId>
- <type>ejb</type>
- <exclusions>
- <exclusion>
- <groupId>org.testng</groupId>
- <artifactId>testng</artifactId>
- </exclusion>
- <exclusion>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- </exclusion>
- <exclusion>
- <groupId>javax.el</groupId>
- <artifactId>el-api</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- <dependency>
- <groupId>org.jboss.seam</groupId>
<artifactId>jboss-seam-ui</artifactId>
</dependency>
<dependency>
@@ -102,30 +89,94 @@
<dependency>
<groupId>org.richfaces.core</groupId>
<artifactId>richfaces-core-api</artifactId>
- </dependency>
+ </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>
-
- <build>
- <finalName>jee6-web</finalName>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-war-plugin</artifactId>
- <configuration>
- <webResources>
- <resource>
- <directory>src/main/webapp</directory>
- <filtering>true</filtering>
- </resource>
- </webResources>
- <attachClasses>true</attachClasses>
- </configuration>
- </plugin>
- </plugins>
- </build>
-
+
<profiles>
<profile>
+ <id>integration-tests</id>
+ <activation>
+ <property>
+ <name>arquillian</name>
+ </property>
+ </activation>
+ <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>
+ <profile>
<id>cluster</id>
<properties>
<distributable>true</distributable>
@@ -156,4 +207,42 @@
</build>
</profile>
</profiles>
+
+ <build>
+ <finalName>jee6-web</finalName>
+ <pluginManagement>
+ <plugins>
+ <plugin>
+ <groupId>org.jboss.as.plugins</groupId>
+ <artifactId>jboss-as-maven-plugin</artifactId>
+ <version>${version.jboss.maven.plugin}</version>
+ </plugin>
+ </plugins>
+ </pluginManagement>
+ <plugins>
+ <!-- Skip tests by default -->
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <skip>true</skip>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-war-plugin</artifactId>
+ <version>${version.war.plugin}</version>
+ <configuration>
+ <webResources>
+ <resource>
+ <directory>src/main/webapp</directory>
+ <filtering>true</filtering>
+ </resource>
+ </webResources>
+ <attachClasses>true</attachClasses>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
</project>
Modified: branches/enterprise/WFK-2_1/examples/jee6/pom.xml
===================================================================
--- branches/enterprise/WFK-2_1/examples/jee6/pom.xml 2013-06-03 15:13:18 UTC (rev 15523)
+++ branches/enterprise/WFK-2_1/examples/jee6/pom.xml 2013-06-03 16:29:26 UTC (rev 15524)
@@ -1,34 +1,128 @@
<?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">
+<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>
<groupId>org.jboss.seam.examples</groupId>
<artifactId>jee6</artifactId>
- <parent>
- <groupId>org.jboss.seam</groupId>
- <artifactId>examples</artifactId>
- <version>2.3.1.Final-redhat-2</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
+ <version>2.3.1.Final-redhat-2</version>
<packaging>pom</packaging>
<name>Booking Example EE6</name>
<properties>
<example.name>jee6</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 with ShrinkWrap Resolver, uncomment
+ and customize the following property. -->
+ <!--<maven.user.settings>/path/to/custom/settings.xml</maven.user.settings>-->
+
+ <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.resources.plugin>2.6</version.resources.plugin>
+ <version.surefire.plugin>2.10</version.surefire.plugin>
+ <version.compiler.plugin>2.3.1</version.compiler.plugin>
+ <version.war.plugin>2.1.1</version.war.plugin>
+ <version.jboss.maven.plugin>7.4.Final</version.jboss.maven.plugin>
</properties>
-
+
<modules>
<module>jee6-web</module>
- <module>jee6-tests</module>
</modules>
<dependencyManagement>
<dependencies>
+ <!-- Modules -->
<dependency>
<groupId>org.jboss.seam.examples</groupId>
<artifactId>jee6-web</artifactId>
<version>${project.version}</version>
<classifier>classes</classifier>
</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>
+
+ <!-- Common provided dependencies -->
+ <dependency>
+ <groupId>commons-logging</groupId>
+ <artifactId>commons-logging</artifactId>
+ <version>${version.commons.logging}</version>
+ <scope>provided</scope>
+ </dependency>
+
+ <!-- TestNG is not necessary -->
+ <dependency>
+ <groupId>org.jboss.seam</groupId>
+ <artifactId>jboss-seam</artifactId>
+ <version>${project.version}</version>
+ <exclusions>
+ <exclusion>
+ <groupId>org.testng</groupId>
+ <artifactId>testng</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>junit</groupId>
+ <artifactId>junit</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>
+ </systemPropertyVariables>
+ </configuration>
+ </plugin>
+ <plugin>
+ <artifactId>maven-dependency-plugin</artifactId>
+ <version>${version.dependency.plugin}</version>
+ </plugin>
+ <plugin>
+ <artifactId>maven-resources-plugin</artifactId>
+ <version>${version.resources.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>
11 years, 5 months
Seam SVN: r15523 - in branches/enterprise/WFK-2_1/examples: contactlist/contactlist-ear and 36 other directories.
by seam-commits@lists.jboss.org
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>
11 years, 5 months