Seam SVN: r14602 - branches/community/Seam_2_3.
by seam-commits@lists.jboss.org
Author: manaRH
Date: 2012-04-17 11:20:21 -0400 (Tue, 17 Apr 2012)
New Revision: 14602
Modified:
branches/community/Seam_2_3/pom.xml
Log:
JBSEAM-4929 attached jboss-parent into seam-parent and clean up redundant plugin management
Modified: branches/community/Seam_2_3/pom.xml
===================================================================
--- branches/community/Seam_2_3/pom.xml 2012-04-17 14:30:04 UTC (rev 14601)
+++ branches/community/Seam_2_3/pom.xml 2012-04-17 15:20:21 UTC (rev 14602)
@@ -1,6 +1,12 @@
<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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.jboss</groupId>
+ <artifactId>jboss-parent</artifactId>
+ <version>8</version>
+ </parent>
+
<groupId>org.jboss.seam</groupId>
<artifactId>jboss-seam-parent</artifactId>
<name>Seam Parent</name>
@@ -33,13 +39,12 @@
<!-- General properties -->
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
- <java.compiler.version>1.5</java.compiler.version>
<seam.docbook.version>1.1.0.GA</seam.docbook.version>
<jbossorg.docbook.version>1.1.0</jbossorg.docbook.version>
<pdf.name>${project.artifactId}.pdf</pdf.name>
<!-- Version string properties -->
- <version.arquillian_core>1.0.0.CR7</version.arquillian_core>
+ <version.arquillian_core>1.0.0.Final</version.arquillian_core>
<version.arquillian_seam2>1.0.0.Alpha2</version.arquillian_seam2>
<version.wicket>1.4.14</version.wicket>
<version.drools>5.1.1</version.drools>
@@ -1264,135 +1269,6 @@
<finalName>${project.artifactId}</finalName>
<pluginManagement>
<plugins>
- <plugin>
- <artifactId>maven-assembly-plugin</artifactId>
- <version>2.2</version>
- </plugin>
-
- <!-- Building -->
- <plugin>
- <artifactId>maven-clean-plugin</artifactId>
- <version>2.4.1</version>
- </plugin>
-
- <plugin>
- <artifactId>maven-resources-plugin</artifactId>
- <version>2.4.1</version>
- </plugin>
-
- <plugin>
- <artifactId>maven-compiler-plugin</artifactId>
- <version>2.3.2</version>
- <configuration>
- <source>${java.compiler.version}</source>
- <target>${java.compiler.version}</target>
- </configuration>
- </plugin>
-
- <plugin>
- <artifactId>maven-surefire-report-plugin</artifactId>
- <version>2.6</version>
- </plugin>
-
- <plugin>
- <artifactId>maven-surefire-plugin</artifactId>
- <version>2.6</version>
- </plugin>
-
- <plugin>
- <artifactId>maven-source-plugin</artifactId>
- <version>2.1.2</version>
- <configuration>
- <archive>
- <manifest>
- <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
- <addDefaultSpecificationEntries>true</addDefaultSpecificationEntries>
- </manifest>
- <manifestEntries>
- <Seam-Version>${project.version}</Seam-Version>
- </manifestEntries>
- </archive>
- </configuration>
- </plugin>
-
- <plugin>
- <artifactId>maven-install-plugin</artifactId>
- <version>2.3.1</version>
- </plugin>
-
- <plugin>
- <artifactId>maven-deploy-plugin</artifactId>
- <version>2.5</version>
- </plugin>
-
- <plugin>
- <artifactId>maven-war-plugin</artifactId>
- <version>2.1.1</version>
- <inherited>true</inherited>
- <configuration>
- <failOnMissingWebXml>false</failOnMissingWebXml>
- <warName>${project.build.finalName}</warName>
- </configuration>
- </plugin>
-
- <plugin>
- <artifactId>maven-ear-plugin</artifactId>
- <version>2.4.2</version>
- </plugin>
-
- <plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>build-helper-maven-plugin</artifactId>
- <version>1.5</version>
- </plugin>
-
- <plugin>
- <artifactId>maven-site-plugin</artifactId>
- <version>2.2</version>
- </plugin>
- <plugin>
- <artifactId>maven-enforcer-plugin</artifactId>
- <version>1.0</version>
- <executions>
- <execution>
- <id>enforce</id>
- <phase>none</phase>
- </execution>
- <execution>
- <id>seam-build-req</id>
- <goals>
- <goal>enforce</goal>
- </goals>
- <inherited>true</inherited>
- <configuration>
- <rules>
- <requireJavaVersion>
- <version>1.5.0</version>
- </requireJavaVersion>
- <requireMavenVersion>
- <version>[3.0.0,)</version>
- </requireMavenVersion>
- </rules>
- </configuration>
- </execution>
- </executions>
- </plugin>
- <!-- Packaging -->
- <plugin>
- <artifactId>maven-jar-plugin</artifactId>
- <version>2.3.2</version>
- <configuration>
- <archive>
- <manifest>
- <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
- <addDefaultSpecificationEntries>true</addDefaultSpecificationEntries>
- </manifest>
- <manifestEntries>
- <Seam-Version>${project.version}</Seam-Version>
- </manifestEntries>
- </archive>
- </configuration>
- </plugin>
<!-- just for jboss-seam core as it is EJB type not jar -->
<plugin>
<artifactId>maven-ejb-plugin</artifactId>
@@ -1416,6 +1292,17 @@
<plugins>
<plugin>
<artifactId>maven-source-plugin</artifactId>
+ <configuration>
+ <archive>
+ <manifest>
+ <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
+ <addDefaultSpecificationEntries>true</addDefaultSpecificationEntries>
+ </manifest>
+ <manifestEntries>
+ <Seam-Version>${project.version}</Seam-Version>
+ </manifestEntries>
+ </archive>
+ </configuration>
<executions>
<execution>
<id>attach-sources</id>
@@ -1426,6 +1313,31 @@
</execution>
</executions>
</plugin>
+
+ <!-- Packaging -->
+ <plugin>
+ <artifactId>maven-jar-plugin</artifactId>
+ <configuration>
+ <archive>
+ <manifest>
+ <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
+ <addDefaultSpecificationEntries>true</addDefaultSpecificationEntries>
+ </manifest>
+ <manifestEntries>
+ <Seam-Version>${project.version}</Seam-Version>
+ </manifestEntries>
+ </archive>
+ </configuration>
+ </plugin>
+
+ <plugin>
+ <artifactId>maven-war-plugin</artifactId>
+ <inherited>true</inherited>
+ <configuration>
+ <failOnMissingWebXml>false</failOnMissingWebXml>
+ <warName>${project.build.finalName}</warName>
+ </configuration>
+ </plugin>
</plugins>
</build>
@@ -1604,7 +1516,6 @@
<plugins>
<plugin>
<artifactId>maven-release-plugin</artifactId>
- <version>2.2.1</version>
<configuration>
<tagBase>https://svn.jboss.org/repos/seam/tags</tagBase>
<stagingRepository>https://repository.jboss.org/nexus/content/groups/staging</stagingRepository>
@@ -1619,6 +1530,5 @@
</modules>
</profile>
</profiles>
-
-
+
</project>
10 years, 11 months
Seam SVN: r14601 - in branches/community/Seam_2_3/examples-ee6/dvdstore: dvdstore-ear/src/main/application/META-INF and 2 other directories.
by seam-commits@lists.jboss.org
Author: manaRH
Date: 2012-04-17 10:30:04 -0400 (Tue, 17 Apr 2012)
New Revision: 14601
Modified:
branches/community/Seam_2_3/examples-ee6/dvdstore/dvdstore-ear/pom.xml
branches/community/Seam_2_3/examples-ee6/dvdstore/dvdstore-ear/src/main/application/META-INF/jboss-deployment-structure.xml
branches/community/Seam_2_3/examples-ee6/dvdstore/dvdstore-ejb/pom.xml
branches/community/Seam_2_3/examples-ee6/dvdstore/dvdstore-web/pom.xml
Log:
rolled back of dom4j and javassist inclusion in dvdstore ear and war
Modified: branches/community/Seam_2_3/examples-ee6/dvdstore/dvdstore-ear/pom.xml
===================================================================
--- branches/community/Seam_2_3/examples-ee6/dvdstore/dvdstore-ear/pom.xml 2012-04-17 14:29:46 UTC (rev 14600)
+++ branches/community/Seam_2_3/examples-ee6/dvdstore/dvdstore-ear/pom.xml 2012-04-17 14:30:04 UTC (rev 14601)
@@ -23,6 +23,16 @@
<groupId>org.jboss.seam.examples-ee6.dvdstore</groupId>
<artifactId>dvdstore-ejb</artifactId>
<type>ejb</type>
+ <exclusions>
+ <exclusion>
+ <artifactId>dom4j</artifactId>
+ <groupId>dom4j</groupId>
+ </exclusion>
+ <exclusion>
+ <artifactId>javassist</artifactId>
+ <groupId>javassist</groupId>
+ </exclusion>
+ </exclusions>
</dependency>
<dependency>
<groupId>org.jboss.seam</groupId>
Modified: branches/community/Seam_2_3/examples-ee6/dvdstore/dvdstore-ear/src/main/application/META-INF/jboss-deployment-structure.xml
===================================================================
--- branches/community/Seam_2_3/examples-ee6/dvdstore/dvdstore-ear/src/main/application/META-INF/jboss-deployment-structure.xml 2012-04-17 14:29:46 UTC (rev 14600)
+++ branches/community/Seam_2_3/examples-ee6/dvdstore/dvdstore-ear/src/main/application/META-INF/jboss-deployment-structure.xml 2012-04-17 14:30:04 UTC (rev 14601)
@@ -7,6 +7,7 @@
<module name="org.slf4j" export="true"/>
<module name="org.hibernate" export="true"/>
<module name="org.hibernate.validator" export="true"/>
+ <module name="org.dom4j" export="true" />
<module name="javax.faces.api" export="true"/>
<module name="com.sun.jsf-impl" export="true"/>
</dependencies>
Modified: branches/community/Seam_2_3/examples-ee6/dvdstore/dvdstore-ejb/pom.xml
===================================================================
--- branches/community/Seam_2_3/examples-ee6/dvdstore/dvdstore-ejb/pom.xml 2012-04-17 14:29:46 UTC (rev 14600)
+++ branches/community/Seam_2_3/examples-ee6/dvdstore/dvdstore-ejb/pom.xml 2012-04-17 14:30:04 UTC (rev 14601)
@@ -39,6 +39,10 @@
<artifactId>jboss-logging</artifactId>
<groupId>org.jboss.logging</groupId>
</exclusion>
+ <exclusion>
+ <artifactId>dom4j</artifactId>
+ <groupId>dom4j</groupId>
+ </exclusion>
</exclusions>
</dependency>
@@ -111,6 +115,10 @@
<artifactId>hibernate-ehcache</artifactId>
<groupId>org.hibernate</groupId>
</exclusion>
+ <exclusion>
+ <artifactId>dom4j</artifactId>
+ <groupId>dom4j</groupId>
+ </exclusion>
</exclusions>
</dependency>
<dependency>
Modified: branches/community/Seam_2_3/examples-ee6/dvdstore/dvdstore-web/pom.xml
===================================================================
--- branches/community/Seam_2_3/examples-ee6/dvdstore/dvdstore-web/pom.xml 2012-04-17 14:29:46 UTC (rev 14600)
+++ branches/community/Seam_2_3/examples-ee6/dvdstore/dvdstore-web/pom.xml 2012-04-17 14:30:04 UTC (rev 14601)
@@ -24,6 +24,16 @@
<artifactId>dvdstore-ejb</artifactId>
<type>ejb</type>
<scope>provided</scope>
+ <exclusions>
+ <exclusion>
+ <artifactId>dom4j</artifactId>
+ <groupId>dom4j</groupId>
+ </exclusion>
+ <exclusion>
+ <artifactId>javassist</artifactId>
+ <groupId>javassist</groupId>
+ </exclusion>
+ </exclusions>
</dependency>
<dependency>
<groupId>org.jboss.seam</groupId>
10 years, 11 months
Seam SVN: r14600 - branches/community/Seam_2_3/jboss-seam.
by seam-commits@lists.jboss.org
Author: manaRH
Date: 2012-04-17 10:29:46 -0400 (Tue, 17 Apr 2012)
New Revision: 14600
Modified:
branches/community/Seam_2_3/jboss-seam/pom.xml
Log:
JBSEAM-4921 corrected scopes for infinispan dependencies
Modified: branches/community/Seam_2_3/jboss-seam/pom.xml
===================================================================
--- branches/community/Seam_2_3/jboss-seam/pom.xml 2012-04-17 14:29:38 UTC (rev 14599)
+++ branches/community/Seam_2_3/jboss-seam/pom.xml 2012-04-17 14:29:46 UTC (rev 14600)
@@ -80,10 +80,12 @@
<dependency>
<groupId>org.infinispan</groupId>
<artifactId>infinispan-core</artifactId>
+ <optional>true</optional>
</dependency>
<dependency>
<groupId>org.infinispan</groupId>
<artifactId>infinispan-tree</artifactId>
+ <optional>true</optional>
</dependency>
<dependency>
10 years, 11 months
Seam SVN: r14599 - branches/community/Seam_2_3/jboss-seam/src/main/java/org/jboss/seam/jsf.
by seam-commits@lists.jboss.org
Author: manaRH
Date: 2012-04-17 10:29:38 -0400 (Tue, 17 Apr 2012)
New Revision: 14599
Modified:
branches/community/Seam_2_3/jboss-seam/src/main/java/org/jboss/seam/jsf/SeamPhaseListener.java
Log:
JBSEAM-4917 adding conversation init in RESTORE_VIEW
Modified: branches/community/Seam_2_3/jboss-seam/src/main/java/org/jboss/seam/jsf/SeamPhaseListener.java
===================================================================
--- branches/community/Seam_2_3/jboss-seam/src/main/java/org/jboss/seam/jsf/SeamPhaseListener.java 2012-04-17 14:29:17 UTC (rev 14598)
+++ branches/community/Seam_2_3/jboss-seam/src/main/java/org/jboss/seam/jsf/SeamPhaseListener.java 2012-04-17 14:29:38 UTC (rev 14599)
@@ -27,6 +27,7 @@
import org.jboss.seam.contexts.Context;
import org.jboss.seam.contexts.Contexts;
import org.jboss.seam.contexts.FacesLifecycle;
+import org.jboss.seam.core.ConversationPropagation;
import org.jboss.seam.core.Events;
import org.jboss.seam.core.Init;
import org.jboss.seam.core.Manager;
@@ -387,7 +388,14 @@
boolean conversationFound = Contexts.isPageContextActive() ? Contexts.getPageContext().isSet("org.jboss.seam.jsf.SeamPhaseListener.conversationFound") : false;
FacesLifecycle.resumePage();
Map parameters = facesContext.getExternalContext().getRequestParameterMap();
+ if (!conversationFound) // there is exceptional case when restoring of conversation wasn't called while page context was lazily initialized
+ {
+ ConversationPropagation.instance().restoreConversationId(parameters);
+ conversationFound = Manager.instance().restoreConversation();
+ }
+ FacesLifecycle.resumeConversation( facesContext.getExternalContext() );
postRestorePage(facesContext, parameters, conversationFound);
+
}
public void raiseEventsBeforePhase(PhaseEvent event)
10 years, 11 months
Seam SVN: r14597 - branches/community/Seam_2_3/examples-ee6/restbay/restbay-ejb/src/main/java/org/jboss/seam/example/restbay.
by seam-commits@lists.jboss.org
Author: maschmid
Date: 2012-04-17 06:07:32 -0400 (Tue, 17 Apr 2012)
New Revision: 14597
Modified:
branches/community/Seam_2_3/examples-ee6/restbay/restbay-ejb/src/main/java/org/jboss/seam/example/restbay/Category.java
Log:
restbay example, change Category id generation strategy to Identity, so it works with the current import.sql script
Modified: branches/community/Seam_2_3/examples-ee6/restbay/restbay-ejb/src/main/java/org/jboss/seam/example/restbay/Category.java
===================================================================
--- branches/community/Seam_2_3/examples-ee6/restbay/restbay-ejb/src/main/java/org/jboss/seam/example/restbay/Category.java 2012-04-17 08:05:45 UTC (rev 14596)
+++ branches/community/Seam_2_3/examples-ee6/restbay/restbay-ejb/src/main/java/org/jboss/seam/example/restbay/Category.java 2012-04-17 10:07:32 UTC (rev 14597)
@@ -4,6 +4,7 @@
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
@@ -20,7 +21,7 @@
private Category parent;
@Id
- @GeneratedValue
+ @GeneratedValue(strategy=GenerationType.IDENTITY)
public Integer getCategoryId()
{
return categoryId;
10 years, 11 months
Seam SVN: r14596 - branches/community/Seam_2_3/seam-reference-guide/src/docbook/en-US.
by seam-commits@lists.jboss.org
Author: manaRH
Date: 2012-04-17 04:05:45 -0400 (Tue, 17 Apr 2012)
New Revision: 14596
Modified:
branches/community/Seam_2_3/seam-reference-guide/src/docbook/en-US/Cache.xml
Log:
JBSEAM-4921 documentation changes for Infinispan Cache Provider
Modified: branches/community/Seam_2_3/seam-reference-guide/src/docbook/en-US/Cache.xml
===================================================================
--- branches/community/Seam_2_3/seam-reference-guide/src/docbook/en-US/Cache.xml 2012-04-17 08:05:30 UTC (rev 14595)
+++ branches/community/Seam_2_3/seam-reference-guide/src/docbook/en-US/Cache.xml 2012-04-17 08:05:45 UTC (rev 14596)
@@ -84,7 +84,7 @@
<para>
The application can cache transactional state using the Seam
<literal>cacheProvider</literal> component, which integrates
- JBossCache, JBoss POJO Cache or EHCache into the Seam environment.
+ JBossCache, JBoss POJO Cache, Infinispan or EHCache into the Seam environment.
This state will be visible to other nodes if your cache supports
running in a clustered mode.
</para>
@@ -119,6 +119,17 @@
<variablelist>
<varlistentry>
<term>
+ Infinispan 5.x (suitable for use in JBoss AS 7.1.x or later and other
+ containers)
+ </term>
+ <listitem>
+ <para>
+ <literal>org.infninispan.tree.TreeCache</literal>
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>
JBoss Cache 1.x (suitable for use in JBoss 4.2.x or later and other
containers)
</term>
@@ -179,6 +190,28 @@
<variablelist>
<varlistentry>
<term>
+ Infinispan 5.x
+ </term>
+ <listitem>
+ <itemizedlist>
+ <listitem>
+ <para>
+ <literal>infinispan-core.jar</literal> - Infinispan Core 5.1.x.Final
+ </para>
+ <para>
+ <literal>infinispan-tree.jar</literal> - Infinispan TreeCache 5.1.x.Final
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <literal>jgroups.jar</literal> - JGroups 3.0
+ </para>
+ </listitem>
+ </itemizedlist>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>
JBoss Cache 1.x
</term>
<listitem>
@@ -257,30 +290,33 @@
<tip>
<para>
- If you are using JBoss Cache in containers other than JBoss
- Application Server, look at the JBoss Cache
- <ulink url="http://wiki.jboss.org/wiki/JBossCache">wiki</ulink> page
- for more dependencies.
+ If you would like to know more details about Infinispan, look at the Infinispan
+ <ulink url="https://docs.jboss.org/author/display/ISPN/Home">Documentation</ulink> page.
</para>
</tip>
<para>
- For an EAR deployment of Seam, we recommend that the cache jars and
+ For an EAR deployment of Seam, we recommend that the infinispan jars and
configuration go directly into the EAR.
</para>
+ <note>
+ <para>JBoss AS7 already provides Infinispan and JGroups jars, so you need to turn on that
+ dependencies in your JBoss AS 7 deployment file or modify <literal>META-INF/Manifest.mf</literal>
+ to have this dependencies. Check the Blog example or JBoss AS7 documentation how to do that.</para>
+ </note>
+
<para>
- You'll also need to provide a configuration file for JBossCache. Place
- <literal>treecache.xml</literal> with an appropriate cache
- configuration into the classpath (e.g. the ejb jar or
- <literal>WEB-INF/classes</literal>). JBossCache has many scary and
- confusing configuration settings, so we won't discuss them here. Please
- refer to the JBossCache documentation for more information.
+ You'll also need to provide a configuration file for Infinispan. Place
+ <literal>infinispan.xml</literal> with an appropriate cache
+ configuration into the Web applicaiton classpath (e.g. the ejb jar or
+ <literal>WEB-INF/classes</literal>). Infinispan has many configuration settings,
+ so we won't discuss them here. Please refer to the Infinispan documentation for more information.
</para>
<para>
- You can find a sample <literal>treecache.xml</literal> in
- <literal>examples/blog/resources/treecache.xml</literal>.
+ You can find a sample configuration file <literal>infinispan.xml</literal> in
+ <literal>examples-ee6/blog/blog-web/src/main/resources/infinispan.xml</literal>.
</para>
<para>
@@ -293,9 +329,9 @@
<literal>components.xml</literal>:
</para>
- <programlisting role="XML"><![CDATA[<components xmlns="http://jboss.com/products/seam/components"
- xmlns:cache="http://jboss.com/products/seam/cache">
- <cache:jboss-cache-provider configuration="META-INF/cache/treecache.xml" />
+ <programlisting role="XML"><![CDATA[<components xmlns="http://jboss.org/schema/seam/components"
+ xmlns:cache="http://jboss.org/schema/seam/cache">
+ <cache:infinispan-cache-provider configuration="infinispan.xml" />
</components>]]></programlisting>
<para>Now you can inject the cache into any Seam component:</para>
@@ -325,8 +361,8 @@
<programlisting role="XML"><![CDATA[<components xmlns="http://jboss.com/products/seam/components"
xmlns:cache="http://jboss.com/products/seam/cache">
- <cache:jboss-cache-provider name="myCache" configuration="myown/cache.xml"/>
- <cache:jboss-cache-provider name="myOtherCache" configuration="myother/cache.xml"/>
+ <cache:infinispan-cache-provider name="myCache" configuration="myown/cache.xml"/>
+ <cache:infinispan-cache-provider name="myOtherCache" configuration="myother/cache.xml"/>
</components>]]></programlisting>
</section>
10 years, 11 months
Seam SVN: r14595 - in branches/community/Seam_2_3/examples-ee6/blog: blog-ear/src/main/application/META-INF and 2 other directories.
by seam-commits@lists.jboss.org
Author: manaRH
Date: 2012-04-17 04:05:30 -0400 (Tue, 17 Apr 2012)
New Revision: 14595
Added:
branches/community/Seam_2_3/examples-ee6/blog/blog-web/src/main/resources/infinispan.xml
branches/community/Seam_2_3/examples-ee6/blog/blog-web/src/main/resources/jgroupsConfig.xml
Removed:
branches/community/Seam_2_3/examples-ee6/blog/blog-ear/src/main/application/treecache.xml
Modified:
branches/community/Seam_2_3/examples-ee6/blog/blog-ear/src/main/application/META-INF/jboss-deployment-structure.xml
branches/community/Seam_2_3/examples-ee6/blog/blog-web/src/main/webapp/WEB-INF/components.xml
Log:
JBSEAM-4921 changed Blog example to use Infinispan Cache instead of EH Cache
Modified: branches/community/Seam_2_3/examples-ee6/blog/blog-ear/src/main/application/META-INF/jboss-deployment-structure.xml
===================================================================
--- branches/community/Seam_2_3/examples-ee6/blog/blog-ear/src/main/application/META-INF/jboss-deployment-structure.xml 2012-04-17 08:04:56 UTC (rev 14594)
+++ branches/community/Seam_2_3/examples-ee6/blog/blog-ear/src/main/application/META-INF/jboss-deployment-structure.xml 2012-04-17 08:05:30 UTC (rev 14595)
@@ -8,6 +8,7 @@
<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>
Deleted: branches/community/Seam_2_3/examples-ee6/blog/blog-ear/src/main/application/treecache.xml
===================================================================
--- branches/community/Seam_2_3/examples-ee6/blog/blog-ear/src/main/application/treecache.xml 2012-04-17 08:04:56 UTC (rev 14594)
+++ branches/community/Seam_2_3/examples-ee6/blog/blog-ear/src/main/application/treecache.xml 2012-04-17 08:05:30 UTC (rev 14595)
@@ -1,147 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<!-- ===================================================================== -->
-<!-- -->
-<!-- Sample TreeCache Service Configuration -->
-<!-- -->
-<!-- ===================================================================== -->
-
-<server>
-
- <classpath codebase="./lib" archives="${jboss-cache.lib},${jgroups.lib}"/>
-
-
- <!-- ==================================================================== -->
- <!-- Defines TreeCache configuration -->
- <!-- ==================================================================== -->
-
- <mbean code="org.jboss.cache.TreeCache"
- name="jboss.cache:service=TreeCache">
-
- <depends>jboss:service=Naming</depends>
- <depends>jboss:service=TransactionManager</depends>
-
- <!--
- Configure the TransactionManager
- -->
- <attribute name="TransactionManagerLookupClass">org.jboss.cache.JBossTransactionManagerLookup</attribute>
-
- <!--
- Isolation level : SERIALIZABLE
- REPEATABLE_READ (default)
- READ_COMMITTED
- READ_UNCOMMITTED
- NONE
- -->
- <attribute name="IsolationLevel">REPEATABLE_READ</attribute>
-
- <!--
- Valid modes are LOCAL
- REPL_ASYNC
- REPL_SYNC
- INVALIDATION_ASYNC
- INVALIDATION_SYNC
- -->
- <attribute name="CacheMode">LOCAL</attribute>
-
- <!--
- Just used for async repl: use a replication queue
- -->
- <attribute name="UseReplQueue">false</attribute>
-
- <!--
- Replication interval for replication queue (in ms)
- -->
- <attribute name="ReplQueueInterval">0</attribute>
-
- <!--
- Max number of elements which trigger replication
- -->
- <attribute name="ReplQueueMaxElements">0</attribute>
-
- <!-- Name of cluster. Needs to be the same for all clusters, in order
- to find each other
- -->
- <attribute name="ClusterName">TreeCache-Cluster</attribute>
-
- <!-- JGroups protocol stack properties. Can also be a URL,
- e.g. file:/home/bela/default.xml
- <attribute name="ClusterProperties"></attribute>
- -->
-
- <attribute name="ClusterConfig">
- <config>
- <!-- UDP: if you have a multihomed machine,
- set the bind_addr attribute to the appropriate NIC IP address -->
- <!-- UDP: On Windows machines, because of the media sense feature
- being broken with multicast (even after disabling media sense)
- set the loopback attribute to true -->
- <UDP mcast_addr="228.1.2.3" mcast_port="48866"
- ip_ttl="64" ip_mcast="true"
- mcast_send_buf_size="150000" mcast_recv_buf_size="80000"
- ucast_send_buf_size="150000" ucast_recv_buf_size="80000"
- loopback="false"/>
- <PING timeout="2000" num_initial_members="3"
- up_thread="false" down_thread="false"/>
- <MERGE2 min_interval="10000" max_interval="20000"/>
- <!-- <FD shun="true" up_thread="true" down_thread="true" />-->
- <FD_SOCK/>
- <VERIFY_SUSPECT timeout="1500"
- up_thread="false" down_thread="false"/>
- <pbcast.NAKACK gc_lag="50" retransmit_timeout="600,1200,2400,4800"
- max_xmit_size="8192" up_thread="false" down_thread="false"/>
- <UNICAST timeout="600,1200,2400" window_size="100" min_threshold="10"
- down_thread="false"/>
- <pbcast.STABLE desired_avg_gossip="20000"
- up_thread="false" down_thread="false"/>
- <FRAG frag_size="8192"
- down_thread="false" up_thread="false"/>
- <pbcast.GMS join_timeout="5000" join_retry_timeout="2000"
- shun="true" print_local_addr="true"/>
- <pbcast.STATE_TRANSFER up_thread="true" down_thread="true"/>
- </config>
- </attribute>
-
- <!--
- Whether or not to fetch state on joining a cluster
- NOTE this used to be called FetchStateOnStartup and has been renamed to be more descriptive.
- -->
- <attribute name="FetchInMemoryState">true</attribute>
-
- <!--
- The max amount of time (in milliseconds) we wait until the
- initial state (ie. the contents of the cache) are retrieved from
- existing members in a clustered environment
- -->
- <attribute name="InitialStateRetrievalTimeout">20000</attribute>
-
- <!--
- Number of milliseconds to wait until all responses for a
- synchronous call have been received.
- -->
- <attribute name="SyncReplTimeout">20000</attribute>
-
- <!-- Max number of milliseconds to wait for a lock acquisition -->
- <attribute name="LockAcquisitionTimeout">15000</attribute>
-
-
- <!-- Name of the eviction policy class. -->
- <attribute name="EvictionPolicyClass"></attribute>
-
- <!--
- Indicate whether to use marshalling or not. Set this to true if you are running under a scoped
- class loader, e.g., inside an application server. Default is "false".
- -->
- <attribute name="UseMarshalling">false</attribute>
-
- </mbean>
-
-
- <!-- Uncomment to get a graphical view of the TreeCache MBean above -->
- <!-- <mbean code="org.jboss.cache.TreeCacheView" name="jboss.cache:service=TreeCacheView">-->
- <!-- <depends>jboss.cache:service=TreeCache</depends>-->
- <!-- <attribute name="CacheService">jboss.cache:service=TreeCache</attribute>-->
- <!-- </mbean>-->
-
-
-</server>
Added: branches/community/Seam_2_3/examples-ee6/blog/blog-web/src/main/resources/infinispan.xml
===================================================================
--- branches/community/Seam_2_3/examples-ee6/blog/blog-web/src/main/resources/infinispan.xml (rev 0)
+++ branches/community/Seam_2_3/examples-ee6/blog/blog-web/src/main/resources/infinispan.xml 2012-04-17 08:05:30 UTC (rev 14595)
@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<infinispan xmlns="urn:infinispan:config:5.1">
+ <global>
+ <asyncListenerExecutor factory="org.infinispan.executors.DefaultExecutorFactory">
+ <properties>
+ <property name="maxThreads" value="1"/>
+ <property name="queueSize" value="1000000"/>
+ <property name="threadNamePrefix" value="AsyncListenerThread"/>
+ </properties>
+ </asyncListenerExecutor>
+ <asyncTransportExecutor factory="org.infinispan.executors.DefaultExecutorFactory">
+ <properties>
+ <property name="threadNamePrefix" value="AsyncSerializationThread"/>
+ </properties>
+ </asyncTransportExecutor>
+ <evictionScheduledExecutor factory="org.infinispan.executors.DefaultScheduledExecutorFactory">
+ <properties>
+ <property name="threadNamePrefix" value="EvictionThread"/>
+ </properties>
+ </evictionScheduledExecutor>
+ <replicationQueueScheduledExecutor factory="org.infinispan.executors.DefaultScheduledExecutorFactory">
+ <properties>
+ <property name="threadNamePrefix" value="ReplicationQueueThread"/>
+ </properties>
+ </replicationQueueScheduledExecutor>
+ <globalJmxStatistics jmxDomain="infinispan" enabled="false"/>
+ <transport transportClass="org.infinispan.remoting.transport.jgroups.JGroupsTransport" clusterName="Infinispan-Cache" distributedSyncTimeout="20000">
+ <properties>
+ <property name="configurationFile" value="jgroupsConfig.xml"/>
+ </properties>
+ </transport>
+ <shutdown hookBehavior="DEFAULT"/>
+ </global>
+ <default>
+ <locking isolationLevel="REPEATABLE_READ" lockAcquisitionTimeout="20000" concurrencyLevel="500"/>
+ <transaction transactionManagerLookupClass="org.infinispan.transaction.lookup.JBossTransactionManagerLookup" syncRollbackPhase="false" syncCommitPhase="false"/>
+ <jmxStatistics enabled="false"/>
+ <invocationBatching enabled="true"/>
+ <clustering mode="replication">
+ <stateRetrieval timeout="20000" fetchInMemoryState="false"/>
+ <sync replTimeout="20000"/>
+ </clustering>
+ </default>
+</infinispan>
\ No newline at end of file
Added: branches/community/Seam_2_3/examples-ee6/blog/blog-web/src/main/resources/jgroupsConfig.xml
===================================================================
--- branches/community/Seam_2_3/examples-ee6/blog/blog-web/src/main/resources/jgroupsConfig.xml (rev 0)
+++ branches/community/Seam_2_3/examples-ee6/blog/blog-web/src/main/resources/jgroupsConfig.xml 2012-04-17 08:05:30 UTC (rev 14595)
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<config>
+ <UDP discard_incompatible_packets="true" enable_bundling="false" enable_diagnostics="false" ip_ttl="2" loopback="false" max_bundle_size="64000" max_bundle_timeout="30" mcast_addr="228.10.10.10" mcast_port="45588" mcast_recv_buf_size="25000000" mcast_send_buf_size="640000" oob_thread_pool.enabled="true" oob_thread_pool.keep_alive_time="10000" oob_thread_pool.max_threads="4" oob_thread_pool.min_threads="1" oob_thread_pool.queue_enabled="true" oob_thread_pool.queue_max_size="10" oob_thread_pool.rejection_policy="Run" thread_naming_pattern="pl" thread_pool.enabled="true" thread_pool.keep_alive_time="30000" thread_pool.max_threads="25" thread_pool.min_threads="1" thread_pool.queue_enabled="true" thread_pool.queue_max_size="10" thread_pool.rejection_policy="Run" tos="8" ucast_recv_buf_size="20000000" ucast_send_buf_size="640000" />
+ <PING num_initial_members="3" timeout="2000"/>
+ <MERGE2 max_interval="30000" min_interval="10000"/>
+ <FD_SOCK/>
+ <FD max_tries="5" timeout="10000"/>
+ <VERIFY_SUSPECT timeout="1500"/>
+ <pbcast.NAKACK discard_delivered_msgs="true" retransmit_timeout="300,600,1200,2400,4800" use_mcast_xmit="false"/>
+ <UNICAST timeout="300,600,1200,2400,3600"/>
+ <pbcast.STABLE desired_avg_gossip="50000" max_bytes="400000" stability_delay="1000"/>
+ <pbcast.GMS join_timeout="5000" print_local_addr="true" view_ack_collection_timeout="5000" view_bundling="true"/>
+ <FRAG2 frag_size="60000"/>
+<!-- <pbcast.STREAMING_STATE_TRANSFER/> -->
+ <pbcast.FLUSH timeout="0"/>
+</config>
\ No newline at end of file
Modified: branches/community/Seam_2_3/examples-ee6/blog/blog-web/src/main/webapp/WEB-INF/components.xml
===================================================================
--- branches/community/Seam_2_3/examples-ee6/blog/blog-web/src/main/webapp/WEB-INF/components.xml 2012-04-17 08:04:56 UTC (rev 14594)
+++ branches/community/Seam_2_3/examples-ee6/blog/blog-web/src/main/webapp/WEB-INF/components.xml 2012-04-17 08:05:30 UTC (rev 14595)
@@ -30,11 +30,13 @@
</theme:available-themes>
</theme:theme-selector>
- <cache:eh-cache-provider/>
+ <cache:infinispan-cache-provider/>
<persistence:managed-persistence-context name="entityManager"
auto-create="true"
persistence-unit-jndi-name="java:/blogEntityManagerFactory"/>
-
+ <component class="org.jboss.seam.transaction.EjbSynchronizations" jndi-name="java:app/jboss-seam/EjbSynchronizations"/>
+ <component class="org.jboss.seam.async.TimerServiceDispatcher" jndi-name="java:app/jboss-seam/TimerServiceDispatcher"/>
+
</components>
10 years, 11 months
Seam SVN: r14594 - in branches/community/Seam_2_3: jboss-seam and 2 other directories.
by seam-commits@lists.jboss.org
Author: manaRH
Date: 2012-04-17 04:04:56 -0400 (Tue, 17 Apr 2012)
New Revision: 14594
Added:
branches/community/Seam_2_3/jboss-seam/src/main/java/org/jboss/seam/cache/AbstractInfinispanCacheProvider.java
branches/community/Seam_2_3/jboss-seam/src/main/java/org/jboss/seam/cache/InfinispanCacheProvider.java
Modified:
branches/community/Seam_2_3/bom/pom.xml
branches/community/Seam_2_3/jboss-seam/pom.xml
branches/community/Seam_2_3/jboss-seam/src/main/resources/org/jboss/seam/cache-2.3.xsd
Log:
JBSEAM-4921 added InfinispanCacheProvider
Modified: branches/community/Seam_2_3/bom/pom.xml
===================================================================
--- branches/community/Seam_2_3/bom/pom.xml 2012-04-16 17:15:14 UTC (rev 14593)
+++ branches/community/Seam_2_3/bom/pom.xml 2012-04-17 08:04:56 UTC (rev 14594)
@@ -41,9 +41,9 @@
<version.jbossas7>7.1.1.Final</version.jbossas7>
<version.jsf2>2.1.7</version.jsf2>
<version.webdriver>0.9.7376</version.webdriver>
+ <version.infinispan>5.1.3.FINAL</version.infinispan>
-
<!-- ***************** -->
<!-- Repository Deployment URLs -->
<!-- ***************** -->
@@ -1006,7 +1006,16 @@
<artifactId>jboss-as-arquillian-container-remote</artifactId>
<version>${version.jbossas7}</version>
</dependency>
-
+ <dependency>
+ <groupId>org.infinispan</groupId>
+ <artifactId>infinispan-core</artifactId>
+ <version>${version.infinispan}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.infinispan</groupId>
+ <artifactId>infinispan-tree</artifactId>
+ <version>${version.infinispan}</version>
+ </dependency>
</dependencies>
</dependencyManagement>
Modified: branches/community/Seam_2_3/jboss-seam/pom.xml
===================================================================
--- branches/community/Seam_2_3/jboss-seam/pom.xml 2012-04-16 17:15:14 UTC (rev 14593)
+++ branches/community/Seam_2_3/jboss-seam/pom.xml 2012-04-17 08:04:56 UTC (rev 14594)
@@ -77,6 +77,15 @@
<dependencies>
+ <dependency>
+ <groupId>org.infinispan</groupId>
+ <artifactId>infinispan-core</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.infinispan</groupId>
+ <artifactId>infinispan-tree</artifactId>
+ </dependency>
+
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-core</artifactId>
Added: branches/community/Seam_2_3/jboss-seam/src/main/java/org/jboss/seam/cache/AbstractInfinispanCacheProvider.java
===================================================================
--- branches/community/Seam_2_3/jboss-seam/src/main/java/org/jboss/seam/cache/AbstractInfinispanCacheProvider.java (rev 0)
+++ branches/community/Seam_2_3/jboss-seam/src/main/java/org/jboss/seam/cache/AbstractInfinispanCacheProvider.java 2012-04-17 08:04:56 UTC (rev 14594)
@@ -0,0 +1,38 @@
+package org.jboss.seam.cache;
+
+import org.infinispan.tree.Fqn;
+
+public abstract class AbstractInfinispanCacheProvider<T> extends CacheProvider<T>
+{
+
+ public AbstractInfinispanCacheProvider()
+ {
+ super.setConfiguration("infinispan.xml");
+ }
+
+ private Fqn defaultFqn;
+
+ protected Fqn getFqn(String region)
+ {
+ if (region != null)
+ {
+ return Fqn.fromString(region);
+ }
+ else
+ {
+ if (defaultFqn == null)
+ {
+ defaultFqn = Fqn.fromString(getDefaultRegion());
+ }
+ return defaultFqn;
+ }
+ }
+
+ @Override
+ public void setDefaultRegion(String defaultRegion)
+ {
+ super.setDefaultRegion(defaultRegion);
+ this.defaultFqn = Fqn.fromString(defaultRegion);
+ }
+
+}
\ No newline at end of file
Added: branches/community/Seam_2_3/jboss-seam/src/main/java/org/jboss/seam/cache/InfinispanCacheProvider.java
===================================================================
--- branches/community/Seam_2_3/jboss-seam/src/main/java/org/jboss/seam/cache/InfinispanCacheProvider.java (rev 0)
+++ branches/community/Seam_2_3/jboss-seam/src/main/java/org/jboss/seam/cache/InfinispanCacheProvider.java 2012-04-17 08:04:56 UTC (rev 14594)
@@ -0,0 +1,129 @@
+package org.jboss.seam.cache;
+
+import static org.jboss.seam.ScopeType.APPLICATION;
+import static org.jboss.seam.annotations.Install.BUILT_IN;
+
+import java.lang.reflect.Method;
+
+import org.infinispan.Cache;
+import org.infinispan.tree.Fqn;
+import org.infinispan.tree.TreeCache;
+import org.infinispan.tree.TreeCacheFactory;
+import org.infinispan.configuration.cache.Configuration;
+import org.infinispan.configuration.cache.ConfigurationBuilder;
+import org.infinispan.manager.DefaultCacheManager;
+import org.jboss.seam.annotations.AutoCreate;
+import org.jboss.seam.annotations.Create;
+import org.jboss.seam.annotations.Destroy;
+import org.jboss.seam.annotations.Install;
+import org.jboss.seam.annotations.Name;
+import org.jboss.seam.annotations.Scope;
+import org.jboss.seam.annotations.intercept.BypassInterceptors;
+import org.jboss.seam.log.LogProvider;
+import org.jboss.seam.log.Logging;
+import org.jboss.seam.util.Reflections;
+
+/**
+ * Implementation of CacheProvider backed by Infinispan 5.x. for simple objects.
+ *
+ * @author Marek Novotny
+ */
+
+@Name("org.jboss.seam.cache.cacheProvider")
+@Scope(APPLICATION)
+@BypassInterceptors
+@Install(value = false, precedence = BUILT_IN, classDependencies = { "org.infinispan.tree.TreeCache", "org.jgroups.MembershipListener" })
+@AutoCreate
+@SuppressWarnings("rawtypes")
+public class InfinispanCacheProvider extends AbstractInfinispanCacheProvider<TreeCache<Object, Object>>
+{
+
+ private org.infinispan.tree.TreeCache cache;
+
+ private static final LogProvider log = Logging.getLogProvider(InfinispanCacheProvider.class);
+
+ private static Method GET;
+ private static Method PUT;
+ private static Method REMOVE;
+ private static Method REMOVE_NODE;
+
+ static
+ {
+ try
+ {
+ GET = TreeCache.class.getDeclaredMethod("get", Fqn.class, Object.class);
+ PUT = TreeCache.class.getDeclaredMethod("put", Fqn.class, Object.class, Object.class);
+ REMOVE = TreeCache.class.getDeclaredMethod("remove", Fqn.class, Object.class);
+ REMOVE_NODE = TreeCache.class.getDeclaredMethod("removeNode", Fqn.class);
+ }
+ catch (Exception e)
+ {
+ log.error(e);
+ throw new IllegalStateException("Unable to use Infinispan Cache", e);
+ }
+ }
+
+ @SuppressWarnings("unchecked")
+ @Create
+ public void create()
+ {
+ log.debug("Starting Infinispan Cache");
+
+ try
+ {
+ DefaultCacheManager manager = new DefaultCacheManager(getConfigurationAsStream());
+ Cache defaultCache = manager.getCache();
+ cache = new TreeCacheFactory().createTreeCache(defaultCache);
+ }
+ catch (Exception e)
+ {
+ throw new IllegalStateException("Error starting Infinispan Cache", e);
+ }
+ }
+
+ @Destroy
+ public void destroy()
+ {
+ log.debug("Stopping Infinispan Cache");
+ try
+ {
+ cache.stop();
+ cache = null;
+ }
+ catch (Exception e)
+ {
+ throw new IllegalStateException("Error stopping Infinispan Cache", e);
+ }
+ }
+
+ @Override
+ public Object get(String region, String key)
+ {
+ return Reflections.invokeAndWrap(GET, cache, getFqn(region), key);
+ }
+
+ @Override
+ public void put(String region, String key, Object object)
+ {
+ Reflections.invokeAndWrap(PUT, cache, getFqn(region), key, object);
+ }
+
+ @Override
+ public void remove(String region, String key)
+ {
+ Reflections.invokeAndWrap(REMOVE, cache, getFqn(region), key);
+ }
+
+ @Override
+ public void clear()
+ {
+ Reflections.invokeAndWrap(REMOVE_NODE, cache, getFqn(null));
+ }
+
+ @Override
+ public TreeCache getDelegate()
+ {
+ return cache;
+ }
+
+}
\ No newline at end of file
Modified: branches/community/Seam_2_3/jboss-seam/src/main/resources/org/jboss/seam/cache-2.3.xsd
===================================================================
--- branches/community/Seam_2_3/jboss-seam/src/main/resources/org/jboss/seam/cache-2.3.xsd 2012-04-16 17:15:14 UTC (rev 14593)
+++ branches/community/Seam_2_3/jboss-seam/src/main/resources/org/jboss/seam/cache-2.3.xsd 2012-04-17 08:04:56 UTC (rev 14594)
@@ -48,6 +48,15 @@
</xs:complexType>
</xs:element>
+ <xs:element name="infinispan-cache-provider">
+ <xs:annotation>
+ <xs:documentation>The Infinispan 5.x Cache provider</xs:documentation>
+ </xs:annotation>
+ <xs:complexType mixed="true">
+ <xs:attributeGroup ref="components:attlist.component" />
+ <xs:attributeGroup ref="cache:attlist.cacheProvider" />
+ </xs:complexType>
+ </xs:element>
<xs:attributeGroup name="attlist.cacheProvider">
<xs:attribute name="default-region" type="components:string" />
<xs:attribute name="configuration" type="components:string" />
10 years, 11 months
Seam SVN: r14593 - in branches/community/Seam_2_3/examples-ee6/restbay/restbay-tests: src/test/java/org/jboss/seam/example/restbay/test and 1 other directories.
by seam-commits@lists.jboss.org
Author: maschmid
Date: 2012-04-16 13:15:14 -0400 (Mon, 16 Apr 2012)
New Revision: 14593
Added:
branches/community/Seam_2_3/examples-ee6/restbay/restbay-tests/src/test/java/org/jboss/seam/example/restbay/test/Deployments.java
branches/community/Seam_2_3/examples-ee6/restbay/restbay-tests/src/test/resources-integration/arquillian.xml
branches/community/Seam_2_3/examples-ee6/restbay/restbay-tests/src/test/resources-integration/web.xml
Modified:
branches/community/Seam_2_3/examples-ee6/restbay/restbay-tests/pom.xml
branches/community/Seam_2_3/examples-ee6/restbay/restbay-tests/src/test/java/org/jboss/seam/example/restbay/test/AuctionServiceTest.java
branches/community/Seam_2_3/examples-ee6/restbay/restbay-tests/src/test/java/org/jboss/seam/example/restbay/test/BasicServiceTest.java
branches/community/Seam_2_3/examples-ee6/restbay/restbay-tests/src/test/java/org/jboss/seam/example/restbay/test/ContextDataTest.java
branches/community/Seam_2_3/examples-ee6/restbay/restbay-tests/src/test/java/org/jboss/seam/example/restbay/test/ResourceHomeTest.java
branches/community/Seam_2_3/examples-ee6/restbay/restbay-tests/src/test/java/org/jboss/seam/example/restbay/test/ResourceQueryTest.java
branches/community/Seam_2_3/examples-ee6/restbay/restbay-tests/src/test/java/org/jboss/seam/example/restbay/test/SecurityTest.java
branches/community/Seam_2_3/examples-ee6/restbay/restbay-tests/src/test/java/org/jboss/seam/example/restbay/test/SubresourceTest.java
Log:
update restbay seamtest
Modified: branches/community/Seam_2_3/examples-ee6/restbay/restbay-tests/pom.xml
===================================================================
--- branches/community/Seam_2_3/examples-ee6/restbay/restbay-tests/pom.xml 2012-04-16 16:06:53 UTC (rev 14592)
+++ branches/community/Seam_2_3/examples-ee6/restbay/restbay-tests/pom.xml 2012-04-16 17:15:14 UTC (rev 14593)
@@ -53,7 +53,25 @@
<dependency>
<groupId>org.jboss.spec.javax.el</groupId>
<artifactId>jboss-el-api_2.2_spec</artifactId>
- </dependency>
+ </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>
+
</dependencies>
<build>
@@ -62,6 +80,9 @@
<directory>src/test/resources</directory>
<filtering>true</filtering>
</testResource>
+ <testResource>
+ <directory>src/test/resources-integration</directory>
+ </testResource>
</testResources>
<plugins>
<plugin>
@@ -72,6 +93,45 @@
</configuration>
</plugin>
</plugins>
- </build>
+ </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>
+ </profiles>
</project>
Modified: branches/community/Seam_2_3/examples-ee6/restbay/restbay-tests/src/test/java/org/jboss/seam/example/restbay/test/AuctionServiceTest.java
===================================================================
--- branches/community/Seam_2_3/examples-ee6/restbay/restbay-tests/src/test/java/org/jboss/seam/example/restbay/test/AuctionServiceTest.java 2012-04-16 16:06:53 UTC (rev 14592)
+++ branches/community/Seam_2_3/examples-ee6/restbay/restbay-tests/src/test/java/org/jboss/seam/example/restbay/test/AuctionServiceTest.java 2012-04-16 17:15:14 UTC (rev 14593)
@@ -1,11 +1,17 @@
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.SeamTest;
+import org.jboss.seam.mock.JUnitSeamTest;
import org.jboss.seam.mock.ResourceRequestEnvironment;
-import org.testng.annotations.BeforeClass;
-import org.testng.annotations.Test;
-import org.junit.Ignore;
+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;
@@ -13,13 +19,22 @@
import java.util.HashMap;
import java.util.Map;
-@Ignore
-public class AuctionServiceTest extends SeamTest
+(a)RunWith(Arquillian.class)
+public class AuctionServiceTest extends JUnitSeamTest
{
+ @Deployment(name="AuctionServiceTest")
+ @OverProtocol("Servlet 3.0")
+ public static Archive<?> createDeployment()
+ {
+ EnterpriseArchive er = Deployments.restbayDeployment();
+ WebArchive web = er.getAsType(WebArchive.class, "restbay-web.war");
+ web.addClasses(AuctionServiceTest.class);
+ return er;
+ }
ResourceRequestEnvironment requestEnv;
- @BeforeClass
+ @Before
public void prepareEnv() throws Exception
{
requestEnv = new ResourceRequestEnvironment(this)
Modified: branches/community/Seam_2_3/examples-ee6/restbay/restbay-tests/src/test/java/org/jboss/seam/example/restbay/test/BasicServiceTest.java
===================================================================
--- branches/community/Seam_2_3/examples-ee6/restbay/restbay-tests/src/test/java/org/jboss/seam/example/restbay/test/BasicServiceTest.java 2012-04-16 16:06:53 UTC (rev 14592)
+++ branches/community/Seam_2_3/examples-ee6/restbay/restbay-tests/src/test/java/org/jboss/seam/example/restbay/test/BasicServiceTest.java 2012-04-16 17:15:14 UTC (rev 14593)
@@ -1,16 +1,25 @@
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.SeamTest;
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.testng.annotations.Test;
-import org.testng.annotations.DataProvider;
-import org.testng.annotations.BeforeClass;
-import static org.testng.Assert.assertEquals;
+
+import org.junit.Before;
import org.junit.Ignore;
+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;
@@ -69,13 +78,22 @@
* </pre>
*
*/
-@Ignore
-public class BasicServiceTest extends SeamTest
+(a)RunWith(Arquillian.class)
+public class BasicServiceTest extends JUnitSeamTest
{
+ @Deployment(name="BasicServiceTest")
+ @OverProtocol("Servlet 3.0")
+ public static Archive<?> createDeployment()
+ {
+ EnterpriseArchive er = Deployments.restbayDeployment();
+ WebArchive web = er.getAsType(WebArchive.class, "restbay-web.war");
+ web.addClasses(BasicServiceTest.class);
+ return er;
+ }
ResourceRequestEnvironment requestEnv;
- @BeforeClass
+ @Before
public void prepareEnv() throws Exception
{
requestEnv = new ResourceRequestEnvironment(this)
@@ -84,9 +102,9 @@
public Map<String, Object> getDefaultHeaders()
{
return new HashMap<String, Object>()
- {{
- put("Accept", "text/plain");
- }};
+ {{
+ put("Accept", "text/plain");
+ }};
}
@Override
@@ -98,22 +116,21 @@
};
}
- @DataProvider(name = "queryPaths")
- public Object[][] getData()
+ public String[] getQueryPaths()
{
- return new String[][] {
- { "/restv1/plainTest" },
+ return new String[] {
+ "/restv1/plainTest",
- { "/restv1/eventComponentTest" },
- { "/restv1/applicationComponentTest" },
- { "/restv1/statelessComponentTest" },
+ "/restv1/eventComponentTest",
+ "/restv1/applicationComponentTest",
+ "/restv1/statelessComponentTest",
- { "/restv1/interfaceEventComponentTest" },
- { "/restv1/interfaceApplicationComponentTest" },
- { "/restv1/interfaceStatelessComponentTest" },
+ "/restv1/interfaceEventComponentTest",
+ "/restv1/interfaceApplicationComponentTest",
+ "/restv1/interfaceStatelessComponentTest",
- { "/restv1/statelessEjbTest" },
- { "/restv1/statelessEjbComponentTest" }
+ "/restv1/statelessEjbTest",
+ "/restv1/statelessEjbComponentTest"
};
}
@@ -125,308 +142,325 @@
@Override
protected void onResponse(EnhancedMockHttpServletResponse response)
{
- assertEquals(response.getStatus(), 200);
- assertEquals(response.getContentAsString(), "Root");
+ assertEquals(200, response.getStatus());
+ assertEquals("Root", response.getContentAsString());
}
}.run();
}
- @Test(dataProvider = "queryPaths")
- public void testExeptionMapping(final String resourcePath) throws Exception
+ @Test
+ public void testExeptionMapping() throws Exception
{
- new ResourceRequest(requestEnv, Method.GET, resourcePath + "/trigger/unsupported")
+ for (String resourcePath : getQueryPaths())
{
-
- @Override
- protected void onResponse(EnhancedMockHttpServletResponse response)
+ new ResourceRequest(requestEnv, Method.GET, resourcePath + "/trigger/unsupported")
{
- assert response.getStatus() == 501;
- assert response.getStatusMessage().equals("The request operation is not supported: foo");
- }
- }.run();
+ @Override
+ protected void onResponse(EnhancedMockHttpServletResponse response)
+ {
+ assert response.getStatus() == 501;
+ assert response.getStatusMessage().equals("The request operation is not supported: foo");
+ }
+ }.run();
+ }
}
- @Test(dataProvider = "queryPaths")
- public void testEchos(final String resourcePath) throws Exception
+ @Test
+ public void testEchos() throws Exception
{
- new ResourceRequest(requestEnv, Method.GET, resourcePath + "/echouri")
+ for (String resourcePath : getQueryPaths())
{
-
- @Override
- protected void onResponse(EnhancedMockHttpServletResponse response)
+ new ResourceRequest(requestEnv, Method.GET, resourcePath + "/echouri")
{
- assert response.getStatus() == 200;
- assert response.getContentAsString().endsWith("/echouri");
- }
- }.run();
-
- reset();
+ @Override
+ protected void onResponse(EnhancedMockHttpServletResponse response)
+ {
+ assert response.getStatus() == 200;
+ assert response.getContentAsString().endsWith("/echouri");
+ }
- new ResourceRequest(requestEnv, Method.GET, resourcePath + "/echoquery")
- {
+ }.run();
- @Override
- protected void prepareRequest(EnhancedMockHttpServletRequest request)
- {
- request.setQueryString("asdf=123");
- request.addQueryParameter("bar", "bbb");
- request.addQueryParameter("baz", "bzzz");
- }
+ reset();
- @Override
- protected void onResponse(EnhancedMockHttpServletResponse response)
+ new ResourceRequest(requestEnv, Method.GET, resourcePath + "/echoquery")
{
- assert response.getStatus() == 200;
- assert response.getContentAsString().equals("bbb");
- }
- }.run();
-
- reset();
+ @Override
+ protected void prepareRequest(EnhancedMockHttpServletRequest request)
+ {
+ request.setQueryString("asdf=123");
+ request.addQueryParameter("bar", "bbb");
+ request.addQueryParameter("baz", "bzzz");
+ }
- new ResourceRequest(requestEnv, Method.GET, resourcePath + "/echoheader")
- {
+ @Override
+ protected void onResponse(EnhancedMockHttpServletResponse response)
+ {
+ assert response.getStatus() == 200;
+ assert response.getContentAsString().equals("bbb");
+ }
- @Override
- protected void prepareRequest(EnhancedMockHttpServletRequest request)
- {
- request.addHeader("bar", "baz");
- }
+ }.run();
- @Override
- protected void onResponse(EnhancedMockHttpServletResponse response)
+ reset();
+
+ new ResourceRequest(requestEnv, Method.GET, resourcePath + "/echoheader")
{
- assert response.getStatus() == 200;
- assert response.getContentAsString().equals("baz");
- }
- }.run();
-
- reset();
+ @Override
+ protected void prepareRequest(EnhancedMockHttpServletRequest request)
+ {
+ request.addHeader("bar", "baz");
+ }
- new ResourceRequest(requestEnv, Method.GET, resourcePath + "/echocookie")
- {
+ @Override
+ protected void onResponse(EnhancedMockHttpServletResponse response)
+ {
+ assert response.getStatus() == 200;
+ assert response.getContentAsString().equals("baz");
+ }
- @Override
- protected void prepareRequest(EnhancedMockHttpServletRequest request)
- {
- request.addCookie(new Cookie("bar", "baz"));
- }
+ }.run();
- @Override
- protected void onResponse(EnhancedMockHttpServletResponse response)
+ reset();
+
+ new ResourceRequest(requestEnv, Method.GET, resourcePath + "/echocookie")
{
- assert response.getStatus() == 200;
- assert response.getContentAsString().equals("baz");
- }
- }.run();
-
- reset();
+ @Override
+ protected void prepareRequest(EnhancedMockHttpServletRequest request)
+ {
+ request.addCookie(new Cookie("bar", "baz"));
+ }
- new ResourceRequest(requestEnv, Method.GET, resourcePath + "/foo/bar/asdf")
- {
+ @Override
+ protected void onResponse(EnhancedMockHttpServletResponse response)
+ {
+ assert response.getStatus() == 200;
+ assert response.getContentAsString().equals("baz");
+ }
- @Override
- protected void onResponse(EnhancedMockHttpServletResponse response)
+ }.run();
+
+ reset();
+
+ new ResourceRequest(requestEnv, Method.GET, resourcePath + "/foo/bar/asdf")
{
- assert response.getStatus() == 200;
- assert response.getContentAsString().equals("bar: asdf");
- }
+ @Override
+ protected void onResponse(EnhancedMockHttpServletResponse response)
+ {
- }.run();
-
- reset();
+ assert response.getStatus() == 200;
+ assert response.getContentAsString().equals("bar: asdf");
+ }
- new ResourceRequest(requestEnv, Method.GET, resourcePath + "/echotwoparams/foo/bar")
- {
+ }.run();
- @Override
- protected void onResponse(EnhancedMockHttpServletResponse response)
+ reset();
+
+ new ResourceRequest(requestEnv, Method.GET, resourcePath + "/echotwoparams/foo/bar")
{
- assert response.getStatus() == 200;
- assert response.getContentAsString().equals("foobar");
- }
- }.run();
+ @Override
+ protected void onResponse(EnhancedMockHttpServletResponse response)
+ {
+ assert response.getStatus() == 200;
+ assert response.getContentAsString().equals("foobar");
+ }
+ }.run();
+ }
+
}
- @Test(dataProvider = "queryPaths")
- public void testEncoding(final String resourcePath) throws Exception
+ @Test
+ public void testEncoding() throws Exception
{
- new ResourceRequest(requestEnv, Method.GET, resourcePath + "/echoencoded/foo bar")
+ for (String resourcePath : getQueryPaths())
{
-
- @Override
- protected void onResponse(EnhancedMockHttpServletResponse response)
+ new ResourceRequest(requestEnv, Method.GET, resourcePath + "/echoencoded/foo bar")
{
- assert response.getStatus() == 200;
- assert response.getContentAsString().equals("foo%20bar");
- }
- }.run();
+ @Override
+ protected void onResponse(EnhancedMockHttpServletResponse response)
+ {
+ assert response.getStatus() == 200;
+ assert response.getContentAsString().equals("foo%20bar");
+ }
+
+ }.run();
+ }
}
- @Test(dataProvider = "queryPaths")
- public void testFormHandling(final String resourcePath) throws Exception
+ @Test
+ public void testFormHandling() throws Exception
{
- new ResourceRequest(requestEnv, Method.POST, resourcePath + "/echoformparams")
+ for (String resourcePath : getQueryPaths())
{
-
- @Override
- protected void prepareRequest(EnhancedMockHttpServletRequest request)
+ new ResourceRequest(requestEnv, Method.POST, resourcePath + "/echoformparams")
{
- 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");
- }
+ @Override
+ protected void prepareRequest(EnhancedMockHttpServletRequest request)
+ {
+ request.setContentType(MediaType.APPLICATION_FORM_URLENCODED);
+ request.addParameter("foo", new String[]
+ {"bar", "baz"});
+ }
- }.run();
-
- reset();
+ @Override
+ protected void onResponse(EnhancedMockHttpServletResponse response)
+ {
+ assert response.getStatus() == 200;
+ assert response.getContentAsString().equals("barbaz");
+ }
- new ResourceRequest(requestEnv, Method.POST, resourcePath + "/echoformparams2")
- {
+ }.run();
- @Override
- protected void prepareRequest(EnhancedMockHttpServletRequest request)
- {
- request.setContentType(MediaType.APPLICATION_FORM_URLENCODED);
- request.addParameter("foo", new String[]{"bar", "baz"});
- }
+ reset();
- @Override
- protected void onResponse(EnhancedMockHttpServletResponse response)
+ new ResourceRequest(requestEnv, Method.POST, resourcePath + "/echoformparams2")
{
- assert response.getStatus() == 200;
- assert response.getContentAsString().equals("barbaz");
- }
- }.run();
-
- reset();
+ @Override
+ protected void prepareRequest(EnhancedMockHttpServletRequest request)
+ {
+ request.setContentType(MediaType.APPLICATION_FORM_URLENCODED);
+ request.addParameter("foo", new String[]
+ {"bar", "baz"});
+ }
- new ResourceRequest(requestEnv, Method.POST, resourcePath + "/echoformparams3")
- {
+ @Override
+ protected void onResponse(EnhancedMockHttpServletResponse response)
+ {
+ assert response.getStatus() == 200;
+ assert response.getContentAsString().equals("barbaz");
+ }
- @Override
- protected void prepareRequest(EnhancedMockHttpServletRequest request)
- {
- request.setContentType(MediaType.APPLICATION_FORM_URLENCODED);
- request.addHeader("bar", "foo");
- request.addParameter("foo", new String[]{"bar", "baz"});
- }
+ }.run();
- @Override
- protected void onResponse(EnhancedMockHttpServletResponse response)
+ reset();
+
+ new ResourceRequest(requestEnv, Method.POST, resourcePath + "/echoformparams3")
{
- assert response.getStatus() == 200;
- assert response.getContentAsString().equals("foobarbaz");
- }
- }.run();
-
- reset();
+ @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(dataProvider = "queryPaths")
- public void testStringConverter(final String resourcePath) throws Exception
+ @Test()
+ public void testStringConverter() throws Exception
{
final String ISO_DATE = "2007-07-10T14:54:56-0500";
final String ISO_DATE_MILLIS = "1184097296000";
-
- new ResourceRequest(requestEnv, Method.GET, resourcePath + "/convertDate/" + ISO_DATE)
+
+ for (String resourcePath : getQueryPaths())
{
- @Override
- protected void onResponse(EnhancedMockHttpServletResponse response)
+ new ResourceRequest(requestEnv, Method.GET, resourcePath + "/convertDate/" + ISO_DATE)
{
- assert response.getStatus() == 200;
- assertEquals(response.getContentAsString(), ISO_DATE_MILLIS);
- }
- }.run();
+ @Override
+ protected void onResponse(EnhancedMockHttpServletResponse response)
+ {
+ assert response.getStatus() == 200;
+ assertEquals(ISO_DATE_MILLIS, response.getContentAsString());
+ }
+ }.run();
+ }
}
- @Test(dataProvider = "queryPaths")
- public void testProvider(final String resourcePath) throws Exception
+ @Test
+ public void testProvider() throws Exception
{
-
- new ResourceRequest(requestEnv, Method.GET, resourcePath + "/commaSeparated")
+ for (String resourcePath : getQueryPaths())
{
-
- @Override
- protected void prepareRequest(EnhancedMockHttpServletRequest request)
+ new ResourceRequest(requestEnv, Method.GET, resourcePath + "/commaSeparated")
{
- 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");
- }
+ @Override
+ protected void prepareRequest(EnhancedMockHttpServletRequest request)
+ {
+ request.addHeader("Accept", "text/csv");
+ }
- }.run();
-
- reset();
+ @Override
+ protected void onResponse(EnhancedMockHttpServletResponse response)
+ {
+ assert response.getStatus() == 200;
+ assert response.getContentAsString().equals("foo,bar\r\nasdf,123\r\n");
+ }
- new ResourceRequest(requestEnv, Method.GET, resourcePath + "/commaSeparatedStrings")
- {
+ }.run();
- @Override
- protected void prepareRequest(EnhancedMockHttpServletRequest request)
- {
- request.addHeader("Accept", "text/plain");
- }
+ reset();
- @Override
- protected void onResponse(EnhancedMockHttpServletResponse response)
+ new ResourceRequest(requestEnv, Method.GET, resourcePath + "/commaSeparatedStrings")
{
- assert response.getStatus() == 200;
- assert response.getContentAsString().equals("abc,foo,bar,baz");
- }
- }.run();
-
- reset();
+ @Override
+ protected void prepareRequest(EnhancedMockHttpServletRequest request)
+ {
+ request.addHeader("Accept", "text/plain");
+ }
- new ResourceRequest(requestEnv, Method.GET, resourcePath + "/commaSeparatedIntegers")
- {
+ @Override
+ protected void onResponse(EnhancedMockHttpServletResponse response)
+ {
+ assert response.getStatus() == 200;
+ assert response.getContentAsString().equals("abc,foo,bar,baz");
+ }
- @Override
- protected void prepareRequest(EnhancedMockHttpServletRequest request)
- {
- request.addHeader("Accept", "text/plain");
- }
+ }.run();
- @Override
- protected void onResponse(EnhancedMockHttpServletResponse response)
+ reset();
+
+ new ResourceRequest(requestEnv, Method.GET, resourcePath + "/commaSeparatedIntegers")
{
- 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
+ @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
@@ -438,14 +472,14 @@
{
super.prepareRequest(request);
}
-
+
@Override
protected void onResponse(EnhancedMockHttpServletResponse response)
{
- assertEquals(response.getStatus(), 200, "Unexpected response code.");
+ assertEquals("Unexpected response code.", 200, response.getStatus(), 200);
assert response.getContentAsString().equals("true");
}
-
+
}.run();
}
}
Modified: branches/community/Seam_2_3/examples-ee6/restbay/restbay-tests/src/test/java/org/jboss/seam/example/restbay/test/ContextDataTest.java
===================================================================
--- branches/community/Seam_2_3/examples-ee6/restbay/restbay-tests/src/test/java/org/jboss/seam/example/restbay/test/ContextDataTest.java 2012-04-16 16:06:53 UTC (rev 14592)
+++ branches/community/Seam_2_3/examples-ee6/restbay/restbay-tests/src/test/java/org/jboss/seam/example/restbay/test/ContextDataTest.java 2012-04-16 17:15:14 UTC (rev 14593)
@@ -1,52 +1,70 @@
package org.jboss.seam.example.restbay.test;
-import static org.testng.Assert.assertEquals;
+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.SeamTest;
import org.jboss.seam.mock.ResourceRequestEnvironment.Method;
import org.jboss.seam.mock.ResourceRequestEnvironment.ResourceRequest;
-import org.testng.annotations.DataProvider;
-import org.testng.annotations.Test;
-import org.junit.Ignore;
+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
*/
-@Ignore
-public class ContextDataTest extends SeamTest
+(a)RunWith(Arquillian.class)
+public class ContextDataTest extends JUnitSeamTest
{
- @DataProvider(name = "contextDataTypes")
- public Object[][] getContextDataTypePaths()
+ @Deployment(name="ContextDataTest")
+ @OverProtocol("Servlet 3.0")
+ public static Archive<?> createDeployment()
{
- return new String[][]{ { "/providers" }, { "/registry" }, { "/dispatcher" } };
+ EnterpriseArchive er = Deployments.restbayDeployment();
+ WebArchive web = er.getAsType(WebArchive.class, "restbay-web.war");
+ web.addClasses(ContextDataTest.class);
+ return er;
}
- @Test(dataProvider = "contextDataTypes")
- public void testContextData(String pathSegment) throws Exception
+ public String[] getContextDataTypePaths()
{
- final String path = "/restv1/contextData" + pathSegment;
+ return new String[]{ "/providers", "/registry", "/dispatcher" };
+ }
+
+ @Test
+ public void testContextData() throws Exception
+ {
- new ResourceRequest(new ResourceRequestEnvironment(this), Method.GET, path)
+ for (String pathSegment : getContextDataTypePaths())
{
+ String path = "/restv1/contextData" + pathSegment;
- @Override
- protected void prepareRequest(EnhancedMockHttpServletRequest request)
+ new ResourceRequest(new ResourceRequestEnvironment(this), Method.GET, path)
{
- super.prepareRequest(request);
- request.addHeader("Accept", "text/plain");
- }
- @Override
- protected void onResponse(EnhancedMockHttpServletResponse response)
- {
- assertEquals(response.getStatus(), 200, "Unexpected response code.");
- assertEquals(response.getContentAsString(), "true", "Unexpected response.");
- }
+ @Override
+ protected void prepareRequest(EnhancedMockHttpServletRequest request)
+ {
+ super.prepareRequest(request);
+ request.addHeader("Accept", "text/plain");
+ }
- }.run();
+ @Override
+ protected void onResponse(EnhancedMockHttpServletResponse response)
+ {
+ assertEquals("Unexpected response code.", 200, response.getStatus());
+ assertEquals("Unexpected response.", "true", response.getContentAsString());
+ }
+
+ }.run();
+ }
}
}
Added: branches/community/Seam_2_3/examples-ee6/restbay/restbay-tests/src/test/java/org/jboss/seam/example/restbay/test/Deployments.java
===================================================================
--- branches/community/Seam_2_3/examples-ee6/restbay/restbay-tests/src/test/java/org/jboss/seam/example/restbay/test/Deployments.java (rev 0)
+++ branches/community/Seam_2_3/examples-ee6/restbay/restbay-tests/src/test/java/org/jboss/seam/example/restbay/test/Deployments.java 2012-04-16 17:15:14 UTC (rev 14593)
@@ -0,0 +1,22 @@
+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 java.io.File;
+
+public class Deployments {
+ public static EnterpriseArchive restbayDeployment() {
+ EnterpriseArchive ear = ShrinkWrap.create(ZipImporter.class, "seam-restbay.ear").importFrom(new File("../restbay-ear/target/seam-restbay.ear"))
+ .as(EnterpriseArchive.class);
+
+ // Install org.jboss.seam.mock.MockSeamListener
+ WebArchive web = ear.getAsType(WebArchive.class, "restbay-web.war");
+ web.delete("/WEB-INF/web.xml");
+ web.addAsWebInfResource("web.xml");
+
+ return ear;
+ }
+}
Modified: branches/community/Seam_2_3/examples-ee6/restbay/restbay-tests/src/test/java/org/jboss/seam/example/restbay/test/ResourceHomeTest.java
===================================================================
--- branches/community/Seam_2_3/examples-ee6/restbay/restbay-tests/src/test/java/org/jboss/seam/example/restbay/test/ResourceHomeTest.java 2012-04-16 16:06:53 UTC (rev 14592)
+++ branches/community/Seam_2_3/examples-ee6/restbay/restbay-tests/src/test/java/org/jboss/seam/example/restbay/test/ResourceHomeTest.java 2012-04-16 17:15:14 UTC (rev 14593)
@@ -1,135 +1,160 @@
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.SeamTest;
import org.jboss.seam.mock.ResourceRequestEnvironment;
-import org.testng.annotations.DataProvider;
-import org.testng.annotations.Test;
-import org.junit.Ignore;
+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;
-import static org.testng.Assert.assertEquals;
/**
*
* @author Jozef Hartinger
*
*/
-@Ignore
-public class ResourceHomeTest extends SeamTest
+(a)RunWith(Arquillian.class)
+public class ResourceHomeTest extends JUnitSeamTest
{
+ @Deployment(name="ResourceHomeTest")
+ @OverProtocol("Servlet 3.0")
+ public static Archive<?> createDeployment()
+ {
+ EnterpriseArchive er = Deployments.restbayDeployment();
+ WebArchive web = er.getAsType(WebArchive.class, "restbay-web.war");
+ web.addClasses(ResourceHomeTest.class);
+ return er;
+ }
- @DataProvider(name = "queryPaths")
- public Object[][] getData()
+ public String[] getQueryPaths()
{
- return new String[][]{ { "/configuredCategory" }, { "/extendedCategory" } };
+ return new String[]{ "/configuredCategory", "/extendedCategory" };
}
- @Test(dataProvider = "queryPaths")
- public void testResourceHomeRead(final String resourcePath) throws Exception
+ @Test
+ public void testResourceHomeRead() throws Exception
{
- 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)
+ 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";
- @Override
- protected void prepareRequest(EnhancedMockHttpServletRequest request)
+ new ResourceRequest(new ResourceRequestEnvironment(this), Method.GET, path)
{
- super.prepareRequest(request);
- request.addHeader("Accept", "application/xml");
- }
- @Override
- protected void onResponse(EnhancedMockHttpServletResponse response)
- {
- assertEquals(response.getContentAsString(), expectedResponse, "Unexpected response.");
- }
+ @Override
+ protected void prepareRequest(EnhancedMockHttpServletRequest request)
+ {
+ super.prepareRequest(request);
+ request.addHeader("Accept", "application/xml");
+ }
- }.run();
+ @Override
+ protected void onResponse(EnhancedMockHttpServletResponse response)
+ {
+ assertEquals("Unexpected response.", expectedResponse, response.getContentAsString());
+ }
+
+ }.run();
+ }
}
- @Test(dataProvider = "queryPaths")
- public void testResourceHomeCreate(final String resourcePath) throws Exception
+ @Test
+ public void testResourceHomeCreate() throws Exception
{
- 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)
+ for (String resourcePath : getQueryPaths())
{
- @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());
- }
+ 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;
- @Override
- protected void onResponse(EnhancedMockHttpServletResponse response)
+ new ResourceRequest(new ResourceRequestEnvironment(this), Method.POST, path)
{
- assertEquals(response.getStatus(), 201, "Unexpected response code.");
- }
+ @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());
+ }
- }.run();
+ @Override
+ protected void onResponse(EnhancedMockHttpServletResponse response)
+ {
+ assertEquals("Unexpected response code.", 201, response.getStatus(), 201);
+ }
+
+ }.run();
+ }
}
- @Test(dataProvider = "queryPaths")
- public void testResourceHomeUpdate(String resourcePath) throws Exception
+ @Test
+ public void testResourceHomeUpdate() throws Exception
{
- 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)
+ 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";
- @Override
- protected void prepareRequest(EnhancedMockHttpServletRequest request)
+ new ResourceRequest(new ResourceRequestEnvironment(this), Method.PUT, path)
{
- super.prepareRequest(request);
- request.setContentType(mediaType);
- request.addHeader("Content-Type", mediaType);
- request.setContent(body.getBytes());
- }
- @Override
- protected void onResponse(EnhancedMockHttpServletResponse response)
- {
- assertEquals(response.getStatus(), 204, "Unexpected response code.");
- }
+ @Override
+ protected void prepareRequest(EnhancedMockHttpServletRequest request)
+ {
+ super.prepareRequest(request);
+ request.setContentType(mediaType);
+ request.addHeader("Content-Type", mediaType);
+ request.setContent(body.getBytes());
+ }
- }.run();
-
- reset();
+ @Override
+ protected void onResponse(EnhancedMockHttpServletResponse response)
+ {
+ assertEquals("Unexpected response code.", 204, response.getStatus());
+ }
- new ResourceRequest(new ResourceRequestEnvironment(this), Method.GET, path)
- {
+ }.run();
- @Override
- protected void prepareRequest(EnhancedMockHttpServletRequest request)
- {
- super.prepareRequest(request);
- request.addHeader("Accept", mediaType);
- }
+ reset();
- @Override
- protected void onResponse(EnhancedMockHttpServletResponse response)
+ new ResourceRequest(new ResourceRequestEnvironment(this), Method.GET, path)
{
- assertEquals(response.getStatus(), 200, "Unexpected response code.");
- assertEquals(response.getContentAsString(), body, "Unexpected response.");
- }
- }.run();
+ @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
@@ -144,7 +169,7 @@
@Override
protected void onResponse(EnhancedMockHttpServletResponse response)
{
- assertEquals(response.getStatus(), 204, "Unexpected response code.");
+ assertEquals("Unexpected response code.", 204, response.getStatus());
}
}.run();
@@ -164,7 +189,7 @@
@Override
protected void onResponse(EnhancedMockHttpServletResponse response)
{
- assertEquals(response.getStatus(), 404, "Unexpected response code.");
+ assertEquals("Unexpected response code.", response.getStatus(), 404);
}
}.run();
Modified: branches/community/Seam_2_3/examples-ee6/restbay/restbay-tests/src/test/java/org/jboss/seam/example/restbay/test/ResourceQueryTest.java
===================================================================
--- branches/community/Seam_2_3/examples-ee6/restbay/restbay-tests/src/test/java/org/jboss/seam/example/restbay/test/ResourceQueryTest.java 2012-04-16 16:06:53 UTC (rev 14592)
+++ branches/community/Seam_2_3/examples-ee6/restbay/restbay-tests/src/test/java/org/jboss/seam/example/restbay/test/ResourceQueryTest.java 2012-04-16 17:15:14 UTC (rev 14593)
@@ -1,57 +1,74 @@
package org.jboss.seam.example.restbay.test;
-import static org.testng.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.SeamTest;
import org.jboss.seam.mock.ResourceRequestEnvironment;
-import org.testng.annotations.DataProvider;
-import org.testng.annotations.Test;
-import org.junit.Ignore;
+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;
+import static org.junit.Assert.assertEquals;
/**
*
* @author Jozef Hartinger
*
*/
-@Ignore
-public class ResourceQueryTest extends SeamTest
+(a)RunWith(Arquillian.class)
+public class ResourceQueryTest extends JUnitSeamTest
{
+ @Deployment(name="ResourceQueryTest")
+ @OverProtocol("Servlet 3.0")
+ public static Archive<?> createDeployment()
+ {
+ EnterpriseArchive er = Deployments.restbayDeployment();
+ WebArchive web = er.getAsType(WebArchive.class, "restbay-web.war");
+ web.addClasses(ResourceQueryTest.class);
+ return er;
+ }
- @DataProvider(name = "queryPaths")
- public Object[][] getData()
+ public String[] getQueryPaths()
{
- String[][] data = new String[2][1];
- data[0][0] = "/configuredCategory";
- data[1][0] = "/extendedCategory";
+ String[] data = new String[2];
+ data[0] = "/configuredCategory";
+ data[1] = "/extendedCategory";
return data;
}
- @Test(dataProvider = "queryPaths")
- public void testResourceQuery(String path) throws Exception
+ @Test
+ public void testResourceQuery() throws Exception
{
- new ResourceRequest(new ResourceRequestEnvironment(this), Method.GET, "/restv1" + path)
+ for (String path : getQueryPaths())
{
-
- @Override
- protected void prepareRequest(EnhancedMockHttpServletRequest request)
+ new ResourceRequest(new ResourceRequestEnvironment(this), Method.GET, "/restv1" + path)
{
- super.prepareRequest(request);
- request.addHeader("Accept", "application/xml");
- request.setQueryString("start=2&show=2");
- }
- @Override
- protected void onResponse(EnhancedMockHttpServletResponse response)
- {
- String expectedResponse = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?><collection><category><categoryId>3</categoryId><name>Books</name></category><category><categoryId>4</categoryId><name>Cameras and Photography</name></category></collection>";
- assertEquals(response.getContentAsString(), expectedResponse, "Unexpected response.");
- }
+ @Override
+ protected void prepareRequest(EnhancedMockHttpServletRequest request)
+ {
+ super.prepareRequest(request);
+ request.addHeader("Accept", "application/xml");
+ request.setQueryString("start=2&show=2");
+ }
- }.run();
+ @Override
+ protected void onResponse(EnhancedMockHttpServletResponse response)
+ {
+ String expectedResponse = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?><collection><category><categoryId>3</categoryId><name>Books</name></category><category><categoryId>4</categoryId><name>Cameras and Photography</name></category></collection>";
+ assertEquals("Unexpected response.", expectedResponse, response.getContentAsString());
+ }
+
+ }.run();
+ }
}
}
Modified: branches/community/Seam_2_3/examples-ee6/restbay/restbay-tests/src/test/java/org/jboss/seam/example/restbay/test/SecurityTest.java
===================================================================
--- branches/community/Seam_2_3/examples-ee6/restbay/restbay-tests/src/test/java/org/jboss/seam/example/restbay/test/SecurityTest.java 2012-04-16 16:06:53 UTC (rev 14592)
+++ branches/community/Seam_2_3/examples-ee6/restbay/restbay-tests/src/test/java/org/jboss/seam/example/restbay/test/SecurityTest.java 2012-04-16 17:15:14 UTC (rev 14593)
@@ -1,17 +1,24 @@
package org.jboss.seam.example.restbay.test;
-import static org.testng.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.SeamTest;
+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.testng.annotations.Test;
-import org.testng.annotations.BeforeClass;
-import org.junit.Ignore;
+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;
@@ -20,13 +27,22 @@
*
* @author Jozef Hartinger
*/
-@Ignore
-public class SecurityTest extends SeamTest
+(a)RunWith(Arquillian.class)
+public class SecurityTest extends JUnitSeamTest
{
+ @Deployment(name="SecurityTest")
+ @OverProtocol("Servlet 3.0")
+ public static Archive<?> createDeployment()
+ {
+ EnterpriseArchive er = Deployments.restbayDeployment();
+ WebArchive web = er.getAsType(WebArchive.class, "restbay-web.war");
+ web.addClasses(SecurityTest.class);
+ return er;
+ }
ResourceRequestEnvironment requestEnv;
- @BeforeClass
+ @Before
public void prepareEnv() throws Exception
{
requestEnv = new ResourceRequestEnvironment(this)
@@ -58,8 +74,8 @@
@Override
protected void onResponse(EnhancedMockHttpServletResponse response)
{
- assertEquals(response.getStatus(), 200, "Unexpected response code.");
- assertEquals(response.getContentAsString(), "false", "Unexpected response.");
+ assertEquals("Unexpected response code.", 200, response.getStatus(), 200);
+ assertEquals("Unexpected response.", "false", response.getContentAsString());
}
}.run();
@@ -82,11 +98,11 @@
protected void onResponse(EnhancedMockHttpServletResponse response)
{
assertEquals(
- response.getHeader("WWW-Authenticate"),
+ "Invalid authentication header value",
"Basic realm=\"Seam RestBay Application\"",
- "Invalid authentication header value"
+ response.getHeader("WWW-Authenticate")
);
- assertEquals(response.getStatus(), 401, "Unexpected response code.");
+ assertEquals("Unexpected response code.", 401, response.getStatus());
}
}.run();
@@ -108,8 +124,8 @@
@Override
protected void onResponse(EnhancedMockHttpServletResponse response)
{
- assertEquals(response.getStatus(), 200, "Unexpected response code.");
- assertEquals(response.getContentAsString(), "true");
+ assertEquals("Unexpected response code.", 200, response.getStatus());
+ assertEquals("true", response.getContentAsString());
}
}.run();
@@ -131,8 +147,8 @@
@Override
protected void onResponse(EnhancedMockHttpServletResponse response)
{
- assertEquals(response.getStatus(), 200, "Unexpected response code.");
- assertEquals(response.getContentAsString(), "true");
+ assertEquals("Unexpected response code.", 200, response.getStatus());
+ assertEquals("true", response.getContentAsString());
}
}.run();
@@ -155,7 +171,7 @@
protected void onResponse(EnhancedMockHttpServletResponse response)
{
// See AuthorizationException mapping to 403 in pages.xml!
- assertEquals(response.getStatus(), 403, "Unexpected response code.");
+ assertEquals("Unexpected response code.", 403, response.getStatus());
assert response.getStatusMessage().startsWith("Not authorized to access resource");
}
@@ -179,7 +195,7 @@
@Override
protected void onResponse(EnhancedMockHttpServletResponse response)
{
- assertEquals(response.getStatus(), 200, "Unexpected response code.");
+ assertEquals("Unexpected response code.", 200, response.getStatus(), 200);
assert response.getContentAsString().equals("true");
}
@@ -203,7 +219,7 @@
@Override
protected void onResponse(EnhancedMockHttpServletResponse response)
{
- assertEquals(response.getStatus(), 200, "Unexpected response code.");
+ assertEquals("Unexpected response code.", 200, response.getStatus());
assert response.getContentAsString().equals("true");
}
Modified: branches/community/Seam_2_3/examples-ee6/restbay/restbay-tests/src/test/java/org/jboss/seam/example/restbay/test/SubresourceTest.java
===================================================================
--- branches/community/Seam_2_3/examples-ee6/restbay/restbay-tests/src/test/java/org/jboss/seam/example/restbay/test/SubresourceTest.java 2012-04-16 16:06:53 UTC (rev 14592)
+++ branches/community/Seam_2_3/examples-ee6/restbay/restbay-tests/src/test/java/org/jboss/seam/example/restbay/test/SubresourceTest.java 2012-04-16 17:15:14 UTC (rev 14593)
@@ -1,19 +1,34 @@
package org.jboss.seam.example.restbay.test;
-import static org.testng.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.SeamTest;
import org.jboss.seam.mock.ResourceRequestEnvironment.Method;
import org.jboss.seam.mock.ResourceRequestEnvironment.ResourceRequest;
-import org.testng.annotations.Test;
-import org.junit.Ignore;
+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;
-@Ignore
-public class SubresourceTest extends SeamTest
+(a)RunWith(Arquillian.class)
+public class SubresourceTest extends JUnitSeamTest
{
+ @Deployment(name="SubresourceTest")
+ @OverProtocol("Servlet 3.0")
+ public static Archive<?> createDeployment()
+ {
+ EnterpriseArchive er = Deployments.restbayDeployment();
+ WebArchive web = er.getAsType(WebArchive.class, "restbay-web.war");
+ web.addClasses(SubresourceTest.class);
+ return er;
+ }
+
@Test
public void testSubresourceGET() throws Exception
{
@@ -32,8 +47,8 @@
@Override
protected void onResponse(EnhancedMockHttpServletResponse response)
{
- assertEquals(response.getStatus(), 200, "Unexpected response code.");
- assertEquals(response.getContentAsString(), "Honda", "Unexpected response.");
+ assertEquals("Unexpected response code.", 200, response.getStatus());
+ assertEquals("Unexpected response.", "Honda", response.getContentAsString());
}
}.run();
Added: branches/community/Seam_2_3/examples-ee6/restbay/restbay-tests/src/test/resources-integration/arquillian.xml
===================================================================
--- branches/community/Seam_2_3/examples-ee6/restbay/restbay-tests/src/test/resources-integration/arquillian.xml (rev 0)
+++ branches/community/Seam_2_3/examples-ee6/restbay/restbay-tests/src/test/resources-integration/arquillian.xml 2012-04-16 17:15:14 UTC (rev 14593)
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<arquillian xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns="http://jboss.org/schema/arquillian"
+ xsi:schemaLocation="http://jboss.org/schema/arquillian http://jboss.org/schema/arquillian/arquillian_1_0.xsd">
+
+ <engine>
+ <property name="deploymentExportPath">target/</property>
+ </engine>
+
+ <container qualifier="jboss" default="true">
+ <configuration>
+ <property name="javaVmArguments">-Xmx1024m -XX:MaxPermSize=512m</property>
+ <property name="jbossHome">target/jboss-as-${version.jbossas7}</property>
+ </configuration>
+ </container>
+
+</arquillian>
Added: branches/community/Seam_2_3/examples-ee6/restbay/restbay-tests/src/test/resources-integration/web.xml
===================================================================
--- branches/community/Seam_2_3/examples-ee6/restbay/restbay-tests/src/test/resources-integration/web.xml (rev 0)
+++ branches/community/Seam_2_3/examples-ee6/restbay/restbay-tests/src/test/resources-integration/web.xml 2012-04-16 17:15:14 UTC (rev 14593)
@@ -0,0 +1,12 @@
+<?xml version="1.0" ?>
+
+<web-app version="3.0"
+ xmlns="http://java.sun.com/xml/ns/javaee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd">
+
+ <listener>
+ <listener-class>org.jboss.seam.mock.MockSeamListener</listener-class>
+ </listener>
+
+</web-app>
10 years, 11 months