Permalink
Browse files

upgrade to Arquillian 1.0.0.CR1; add as7 container

  • Loading branch information...
mojavelinux committed Jul 17, 2011
1 parent 2e60e88 commit 64ef854df3c820142c3a9f3432915eb2d2a77afd
Showing with 736 additions and 851 deletions.
  1. +20 −85 cdi-ejb/pom.xml
  2. +3 −4 cdi-ejb/src/test/java/com/acme/cdiejb/async/FireAndForgetTestCase.java
  3. +24 −7 cdi-ejb/src/test/java/com/acme/cdiejb/mixedinterface/MixedInterfaceEjbTestCase.java
  4. +1 −1 cdi-ejb/src/test/java/com/acme/cdiejb/nointerface/NoInterfaceNamedEjbTestCase.java
  5. +25 −12 cdi/build.gradle
  6. +10 −5 cdi/build.properties
  7. +75 −8 cdi/build.xml
  8. BIN cdi/gradle-wrapper/gradle-wrapper.jar
  9. +2 −2 cdi/gradle-wrapper/gradle-wrapper.properties
  10. +28 −5 cdi/gradlew
  11. +8 −52 cdi/gradlew.bat
  12. +24 −15 cdi/ivy.xml
  13. +1 −0 cdi/ivysettings.xml
  14. +45 −233 cdi/pom.xml
  15. +3 −3 cdi/src/test/java/com/acme/cdi/BeanManagerTestCase.java
  16. +1 −1 cdi/src/test/java/com/acme/cdi/GreeterManagedBeanTestCase.java
  17. +1 −1 cdi/src/test/java/com/acme/cdi/decorator/AnnouncerDecoratorTest.java
  18. +1 −1 cdi/src/test/java/com/acme/cdi/event/BeanManagerInitializedTestCase.java
  19. +1 −1 cdi/src/test/java/com/acme/cdi/event/DocumentEventTestCase.java
  20. +1 −1 cdi/src/test/java/com/acme/cdi/event/PacketSendReceiveTestCase.java
  21. +2 −2 cdi/src/test/java/com/acme/cdi/failure/AmbiguousDependencyTestCase.java
  22. +1 −1 cdi/src/test/java/com/acme/cdi/measurement/TemperatureConverterTestCase.java
  23. +15 −9 cdi/src/test/java/com/acme/cdi/payment/SynchronousPaymentProcessorTestCase.java
  24. +1 −1 cdi/src/test/java/com/acme/cdi/random/RandomTestCase.java
  25. +1 −1 cdi/src/test/java/com/acme/cdi/singleton/JavaxInjectSingletonTestCase.java
  26. +1 −1 cdi/src/test/java/com/acme/cdi/translate/TextTranslatorServiceTestCase.java
  27. +12 −0 cdi/src/test/resources/arquillian.xml
  28. +2 −2 cdi/src/test/resources/log4j.properties
  29. +20 −122 ejb/pom.xml
  30. +3 −2 ejb/src/test/java/com/acme/ejb/GreeterTestCase.java
  31. +2 −1 ejb/src/test/java/com/acme/ejb/TemperatureConverterTestCase.java
  32. +2 −1 ejb/src/test/java/com/acme/ejb/calc/MortgageCalculatorEnvEntryTestCase.java
  33. +3 −2 ejb/src/test/java/com/acme/ejb/calc/MortgageCalculatorTestCase.java
  34. +3 −2 ejb/src/test/java/com/acme/ejb/nointerface/NoInterfaceEJBTestCase.java
  35. +8 −2 ejb/src/test/resources/arquillian.xml
  36. +59 −62 jaxrs/pom.xml
  37. +6 −5 jaxrs/src/test/java/com/acme/jaxrs/CustomerResourceClientTest.java
  38. +4 −4 jaxrs/src/test/java/com/acme/jaxrs/CustomerResourceRESTEasyClientTest.java
  39. +67 −0 jaxrs/src/test/java/com/acme/jaxrs/EnterpriseCustomerResourceClientTest.java
  40. 0 jaxrs/src/test/{resources-jbossas → resources-jbossas-6}/test-persistence.xml
  41. +15 −0 jaxrs/src/test/resources-jbossas-7/test-persistence.xml
  42. +1 −0 jaxrs/src/test/resources/arquillian.launch
  43. +24 −4 jaxrs/src/test/resources/arquillian.xml
  44. +53 −9 jms/pom.xml
  45. +1 −1 jms/src/main/java/com/acme/jms/MessageEchoBean.java
  46. +4 −4 jms/src/test/java/com/acme/jms/MessageDrivenBeanEchoTestCase.java
  47. +2 −2 jpa-lite/src/test/resources/arquillian.xml
  48. +54 −96 jpa/pom.xml
  49. +2 −1 jpa/src/test/java/com/acme/jpa/GamePersistenceTestCase.java
  50. 0 jpa/src/test/{resources-jbossas → resources-jbossas-6}/test-persistence.xml
  51. +12 −0 jpa/src/test/resources-jbossas-7/test-persistence.xml
  52. +1 −0 jpa/src/test/resources/arquillian.launch
  53. +10 −7 jpa/src/test/resources/arquillian.xml
  54. +5 −28 multinode/pom.xml
  55. +13 −11 multinode/src/test/java/com/acme/multinode/grid/ClusteredCacheTestCase.java
  56. +4 −12 multinode/src/test/java/com/acme/multinode/grid/Deployments.java
  57. +21 −12 multinode/src/test/resources/arquillian.xml
  58. +1 −0 multinode/src/test/resources/grid/in-container-web.xml
  59. +1 −1 multinode/src/test/resources/grid/infinispan.xml
  60. +5 −4 multinode/src/test/resources/grid/jboss-repository.xml
  61. +21 −2 pom.xml
View
@@ -13,13 +13,13 @@
<artifactId>arquillian-showcase-cdi-ejb</artifactId>
<packaging>jar</packaging>
- <name>Arquillian Showcase: CDI + EJB</name>
+ <name>Arquillian Showcase: CDI-EJB Integration</name>
<description>Examples that use Arquillian to demonstrate the synergy between CDI and EJB 3.1</description>
<dependencies>
<dependency>
- <groupId>org.jboss.arquillian</groupId>
- <artifactId>arquillian-junit</artifactId>
+ <groupId>org.jboss.arquillian.junit</groupId>
+ <artifactId>arquillian-junit-container</artifactId>
</dependency>
<dependency>
<groupId>junit</groupId>
@@ -33,95 +33,48 @@
<profiles>
<profile>
- <id>arq-jbossas-remote-6</id>
+ <!-- all tests are failing -->
+ <id>arq-jbossas-managed-7</id>
<dependencies>
<dependency>
- <groupId>org.jboss.arquillian.container</groupId>
- <artifactId>arquillian-jbossas-remote-6</artifactId>
+ <groupId>org.jboss.as</groupId>
+ <artifactId>jboss-as-arquillian-container-managed</artifactId>
</dependency>
<dependency>
<groupId>org.jboss.spec</groupId>
- <artifactId>jboss-javaee-6.0</artifactId>
- <type>pom</type>
- </dependency>
- <dependency>
- <groupId>org.jboss.jbossas</groupId>
- <artifactId>jboss-as-profileservice-client</artifactId>
+ <artifactId>jboss-javaee-web-6.0</artifactId>
<type>pom</type>
</dependency>
</dependencies>
</profile>
<profile>
- <id>arq-jbossas-managed-6</id>
+ <!-- all tests are failing -->
+ <id>arq-jbossas-remote-7</id>
<dependencies>
<dependency>
- <groupId>org.jboss.arquillian.container</groupId>
- <artifactId>arquillian-jbossas-managed-6</artifactId>
+ <groupId>org.jboss.as</groupId>
+ <artifactId>jboss-as-arquillian-container-remote</artifactId>
</dependency>
<dependency>
<groupId>org.jboss.spec</groupId>
- <artifactId>jboss-javaee-6.0</artifactId>
+ <artifactId>jboss-javaee-web-6.0</artifactId>
<type>pom</type>
</dependency>
- <dependency>
- <groupId>org.jboss.jbossas</groupId>
- <artifactId>jboss-as-profileservice-client</artifactId>
- <type>pom</type>
- </dependency>
- <dependency>
- <groupId>org.jboss.jbossas</groupId>
- <artifactId>jboss-server-manager</artifactId>
- </dependency>
</dependencies>
</profile>
- <profile>
- <id>arq-jbossas-remote-7</id>
- <dependencies>
- <dependency>
- <groupId>org.jboss.arquillian.container</groupId>
- <artifactId>arquillian-jbossas-remote-7</artifactId>
- </dependency>
- <dependency>
- <groupId>org.jboss.as</groupId>
- <artifactId>jboss-as-controller-client</artifactId>
- </dependency>
- <dependency>
- <groupId>org.jboss.spec</groupId>
- <artifactId>jboss-javaee-6.0</artifactId>
- <type>pom</type>
- </dependency>
- </dependencies>
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-surefire-plugin</artifactId>
- <configuration>
- <forkMode>never</forkMode>
- <excludes>
- <exclude>com/acme/cdiejb/mixedinterface/*</exclude>
- </excludes>
- </configuration>
- </plugin>
- </plugins>
- </build>
- </profile>
-
<profile>
<id>arq-glassfish-embedded</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<dependencies>
<dependency>
- <groupId>org.jboss.arquillian.container</groupId>
- <artifactId>arquillian-glassfish-embedded-3.1</artifactId>
- </dependency>
- <dependency>
- <groupId>org.glassfish.extras</groupId>
- <artifactId>glassfish-embedded-all</artifactId>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>container-bom-glassfish-embedded-3.1</artifactId>
+ <type>pom</type>
+ <scope>test</scope>
</dependency>
</dependencies>
</profile>
@@ -130,32 +83,14 @@
<id>arq-glassfish-remote</id>
<dependencies>
<dependency>
- <groupId>org.jboss.arquillian.container</groupId>
- <artifactId>arquillian-glassfish-remote-3.1</artifactId>
- </dependency>
- <dependency>
- <groupId>org.jboss.spec</groupId>
- <artifactId>jboss-javaee-6.0</artifactId>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>container-bom-glassfish-remote-3.1</artifactId>
<type>pom</type>
- </dependency>
- <dependency>
- <groupId>org.jboss.weld</groupId>
- <artifactId>weld-api</artifactId>
- <version>1.1.Final</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>com.sun.jersey</groupId>
- <artifactId>jersey-bundle</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>com.sun.jersey.contribs</groupId>
- <artifactId>jersey-multipart</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
</profile>
+
</profiles>
<!--
vi:ts=4:sw=4:expandtab:
@@ -7,7 +7,7 @@
import javax.inject.Inject;
-import org.jboss.arquillian.api.Deployment;
+import org.jboss.arquillian.container.test.api.Deployment;
import org.jboss.arquillian.junit.Arquillian;
import org.jboss.shrinkwrap.api.ShrinkWrap;
import org.jboss.shrinkwrap.api.asset.StringAsset;
@@ -34,7 +34,7 @@ public static JavaArchive createDeployment() {
// use on GlassFish because of a visibility bug
@Deployment
- public static WebArchive createDeploymentCompat() {
+ public static WebArchive createDeploymentForGlassFish() {
BeansDescriptor beansXml = Descriptors.create(BeansDescriptor.class);
return ShrinkWrap.create(WebArchive.class)
@@ -50,8 +50,7 @@ public static WebArchive createDeploymentCompat() {
@Test
public void shouldInvokeAsynchronously() throws Exception {
// use latch barrier or something to verify code is executing asynchronously
- System.out.println("Current thread [id=" + Thread.currentThread().getId() +
- "; name=" + Thread.currentThread().getName() + "]");
+ System.out.println("Current thread [id=" + Thread.currentThread().getId() + "; name=" + Thread.currentThread().getName() + "]");
asyncBean.fire(1000);
System.out.println("Async operation fired");
assertTrue(BlockingFireAndForgetBean.LATCH.await(30, TimeUnit.SECONDS));
@@ -16,9 +16,10 @@
*/
package com.acme.cdiejb.mixedinterface;
+import javax.ejb.EJB;
import javax.naming.InitialContext;
-import org.jboss.arquillian.api.Deployment;
+import org.jboss.arquillian.container.test.api.Deployment;
import org.jboss.arquillian.junit.Arquillian;
import org.jboss.shrinkwrap.api.ShrinkWrap;
import org.jboss.shrinkwrap.api.asset.EmptyAsset;
@@ -55,16 +56,32 @@ public static EnterpriseArchive createDeployment() {
return ShrinkWrap.create(EnterpriseArchive.class, "test.ear").addAsModule(ejbClientJar).addAsModule(ejbServiceJar);
}
- // @EJB
- // @Inject
- // GreeterBean greeter;
- // GreeterRemote greeter;
- // @EJB GreeterDelegate greeter;
+// @Inject
+// GreeterRemote greeter;
+// GreeterDelegate greeter;
+// GreeterBean greeter;
+
+ @EJB
+ GreeterRemote greeter;
+// GreeterDelegate greeter;
+// GreeterBean greeter;
@Test
- public void shouldBeAbleToInjectEJBAndInvoke() throws Exception {
+ public void should_be_able_to_lookup_and_invoke_ejb() throws Exception {
String name = "Earthlings";
GreeterDelegate greeter = (GreeterDelegate) new InitialContext().lookup("java:global/test/service/GreeterDelegate");
Assert.assertEquals("Hello, " + name, greeter.greet(name));
}
+
+ @Test
+ public void should_be_able_to_at_inject_and_invoke_ejb(GreeterRemote greeter) {
+ String name = "Earthlings";
+ Assert.assertEquals("Hello, " + name, greeter.greet(name));
+ }
+
+ @Test
+ public void should_be_able_to_ejb_inject_and_invoke_ejb() {
+ String name = "Earthlings";
+ Assert.assertEquals("Hello, " + name, greeter.greet(name));
+ }
}
@@ -6,7 +6,7 @@
import javax.enterprise.inject.spi.Bean;
import javax.enterprise.inject.spi.BeanManager;
-import org.jboss.arquillian.api.Deployment;
+import org.jboss.arquillian.container.test.api.Deployment;
import org.jboss.arquillian.junit.Arquillian;
import org.jboss.shrinkwrap.api.ShrinkWrap;
import org.jboss.shrinkwrap.api.asset.EmptyAsset;
View
@@ -3,8 +3,9 @@ apply plugin: JavaPlugin
buildDir = 'target/gradle-build'
libraryVersions = [
- junit: '4.8.1', arquillian: '1.0.0.Alpha5', jbossJavaeeSpec: '1.0.0.Final', weld: '1.1.0.Final',
- slf4j: '1.5.10', log4j: '1.2.14', jbossas: '6.0.0.Final', glassfish: '3.1', cdi: '1.0-SP4'
+ junit: '4.8.1', arquillian: '1.0.0.CR1', jbossJavaeeSpec: '1.0.0.Final', weld: '1.1.1.Final',
+ slf4j: '1.5.10', log4j: '1.2.14', jbossas: '6.0.0.Final', glassfish: '3.1', cdi: '1.0-SP4',
+ hamcrest: '1.2', jbossAS7: '7.0.0.CR1'
]
repositories {
@@ -18,7 +19,9 @@ repositories {
configurations {
compileOnly
weldEmbeddedTestRuntime { extendsFrom testRuntime }
- jbossasRemoteTestRuntime { extendsFrom testRuntime, compileOnly }
+ jbossAS6RemoteTestRuntime { extendsFrom testRuntime, compileOnly }
+ jbossAS7ManagedTestRuntime { extendsFrom testRuntime, compileOnly }
+ jbossAS7RemoteTestRuntime { extendsFrom testRuntime, compileOnly }
glassfishEmbeddedTestRuntime { extendsFrom testRuntime }
}
@@ -27,20 +30,26 @@ dependencies {
compileOnly group: 'javax.enterprise', name: 'cdi-api', version: libraryVersions.cdi
testCompile group: 'junit', name: 'junit', version: libraryVersions.junit
- testCompile group: 'org.hamcrest', name: 'hamcrest-core', version: '1.2'
- testCompile group: 'org.jboss.arquillian', name: 'arquillian-junit', version: libraryVersions.arquillian
+ testCompile group: 'org.hamcrest', name: 'hamcrest-core', version: libraryVersions.hamcrest
+ testCompile group: 'org.jboss.arquillian.junit', name: 'arquillian-junit-container', version: libraryVersions.arquillian
weldEmbeddedTestRuntime group: 'org.jboss.arquillian.container', name: 'arquillian-weld-ee-embedded-1.1', version: libraryVersions.arquillian
weldEmbeddedTestRuntime group: 'org.jboss.spec', name: 'jboss-javaee-6.0', version: libraryVersions.jbossJavaeeSpec
weldEmbeddedTestRuntime group: 'org.jboss.weld', name: 'weld-core', version: libraryVersions.weld
weldEmbeddedTestRuntime group: 'org.slf4j', name: 'slf4j-log4j12', version: libraryVersions.slf4j
weldEmbeddedTestRuntime group: 'log4j', name: 'log4j', version: libraryVersions.log4j
- jbossasRemoteTestRuntime group: 'org.jboss.arquillian.container', name: 'arquillian-jbossas-remote-6', version: libraryVersions.arquillian
- jbossasRemoteTestRuntime group: 'org.jboss.spec', name: 'jboss-javaee-6.0', version: libraryVersions.jbossJavaeeSpec
- jbossasRemoteTestRuntime group: 'org.jboss.jbossas', name: 'jboss-as-profileservice-client', version: libraryVersions.jbossas
+ jbossAS6RemoteTestRuntime group: 'org.jboss.arquillian.container', name: 'arquillian-jbossas-remote-6', version: libraryVersions.arquillian
+ jbossAS6RemoteTestRuntime group: 'org.jboss.spec', name: 'jboss-javaee-6.0', version: libraryVersions.jbossJavaeeSpec
+ jbossAS6RemoteTestRuntime group: 'org.jboss.jbossas', name: 'jboss-as-profileservice-client', version: libraryVersions.jbossas
- glassfishEmbeddedTestRuntime group: 'org.jboss.arquillian.container', name: 'arquillian-glassfish-embedded-3.1', version: libraryVersions.arquillian
+ jbossAS7ManagedTestRuntime group: 'org.jboss.as', name: 'jboss-as-arquillian-container-managed', version: libraryVersions.jbossAS7
+ jbossAS7ManagedTestRuntime group: 'org.jboss.spec', name: 'jboss-javaee-6.0', version: libraryVersions.jbossJavaeeSpec
+
+ jbossAS7RemoteTestRuntime group: 'org.jboss.as', name: 'jboss-as-arquillian-container-remote', version: libraryVersions.jbossAS7
+ jbossAS7RemoteTestRuntime group: 'org.jboss.spec', name: 'jboss-javaee-6.0', version: libraryVersions.jbossJavaeeSpec
+
+ glassfishEmbeddedTestRuntime group: 'org.jboss.arquillian.container', name: 'arquillian-glassfish-embedded-3.1', version: '1.0.0.CR1-SNAPSHOT'
glassfishEmbeddedTestRuntime group: 'org.glassfish.extras', name: 'glassfish-embedded-all', version: libraryVersions.glassfish
}
@@ -55,7 +64,11 @@ sourceSets {
task weldEmbeddedTest(type: Test)
-task jbossasRemoteTest(type: Test)
+task jbossAS6RemoteTest(type: Test)
+
+task jbossAS7ManagedTest(type: Test)
+
+task jbossAS7RemoteTest(type: Test)
task glassfishEmbeddedTest(type: Test)
@@ -69,10 +82,10 @@ tasks.withType(Test).matching({ t-> t.name.endsWith('Test') } as Spec).each { t
test {
dependsOn { weldEmbeddedTest }
- setEnabled(false)
+ setEnabled(false) // FIXME: why is this disabled?
}
task generateWrapper(type: Wrapper) {
- gradleVersion = '0.9.2'
+ gradleVersion = '1.0-milestone-3'
jarFile = 'gradle-wrapper/gradle-wrapper.jar'
}
View
@@ -2,9 +2,14 @@ maven.settings.offline=true
#maven.repo.local=${user.home}/.m2/repository
project.build.finalName=arquillian-showcase-cdi-1.0.0-SNAPSHOT
jboss.home=/home/dallen/opt/jboss-as
-version.arquillian=1.0.0.Alpha3
-version.jboss_ee6_spec=1.0.0.Beta7
-version.jbossas_60=6.0.0.20100721-M4
+version.arquillian=1.0.0.CR1
+version.cdi_spec=1.0.0.Final
+version.glassfish=3.1
+version.hamcrest=1.2
+version.jboss_javaee6_spec=1.0.0.Final
+version.jbossas_6=6.0.0.Final
+version.jbossas_7=7.0.0.CR1
version.junit=4.8.1
-version.org.apache.openejb_openejb.core=3.1.2
-version.weld_core=1.0.1-Final
+version.log4j=1.2.14
+version.slf4j=1.5.10
+version.weld_core=1.1.1.Final
Oops, something went wrong.

0 comments on commit 64ef854

Please sign in to comment.