[jboss-cvs] JBossAS SVN: r110504 - in trunk/resteasy-int/test/cdi-test-2: src/main/java/org/jboss/resteasy/cdi/test/ejb and 1 other directories.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Tue Feb 1 06:23:31 EST 2011
Author: jharting
Date: 2011-02-01 06:23:30 -0500 (Tue, 01 Feb 2011)
New Revision: 110504
Added:
trunk/resteasy-int/test/cdi-test-2/src/main/java/org/jboss/resteasy/cdi/test/ejb/SingletonProvider.java
trunk/resteasy-int/test/cdi-test-2/src/main/java/org/jboss/resteasy/cdi/test/ejb/SingletonResource.java
trunk/resteasy-int/test/cdi-test-2/src/test/java/org/jboss/resteasy/cdi/test/SingletonProviderTest.java
trunk/resteasy-int/test/cdi-test-2/src/test/java/org/jboss/resteasy/cdi/test/SingletonResourceTest.java
Modified:
trunk/resteasy-int/test/cdi-test-2/pom.xml
trunk/resteasy-int/test/cdi-test-2/src/test/java/org/jboss/resteasy/cdi/test/StatefulSessionBeanWithAnnotationsOnLocalInterfaceTest.java
trunk/resteasy-int/test/cdi-test-2/src/test/java/org/jboss/resteasy/cdi/test/StatelessSessionBeanResourceTest.java
Log:
RESTEASY-504
Modified: trunk/resteasy-int/test/cdi-test-2/pom.xml
===================================================================
--- trunk/resteasy-int/test/cdi-test-2/pom.xml 2011-02-01 10:35:58 UTC (rev 110503)
+++ trunk/resteasy-int/test/cdi-test-2/pom.xml 2011-02-01 11:23:30 UTC (rev 110504)
@@ -15,34 +15,27 @@
<dependencies>
<dependency>
- <groupId>javax.enterprise</groupId>
- <artifactId>cdi-api</artifactId>
- <version>1.0-SP1</version>
+ <groupId>org.jboss.spec</groupId>
+ <artifactId>jboss-javaee-6.0</artifactId>
+ <version>1.0.0.Final</version>
+ <type>pom</type>
<scope>provided</scope>
</dependency>
<dependency>
- <groupId>org.jboss.spec.javax.ejb</groupId>
- <artifactId>jboss-ejb-api_3.1_spec</artifactId>
+ <groupId>org.jboss.resteasy</groupId>
+ <artifactId>jaxrs-api</artifactId>
+ <version>${version.org.jboss.resteasy}</version>
<scope>provided</scope>
- <version>1.0.0.CR2</version>
</dependency>
-
+ <!-- @Form -->
<dependency>
<groupId>org.jboss.resteasy</groupId>
- <artifactId>jaxrs-api</artifactId>
+ <artifactId>resteasy-jaxrs</artifactId>
<version>${version.org.jboss.resteasy}</version>
<scope>provided</scope>
</dependency>
-
- <!-- @Form -->
- <dependency>
- <groupId>org.jboss.resteasy</groupId>
- <artifactId>resteasy-jaxrs</artifactId>
- <version>${version.org.jboss.resteasy}</version>
- <scope>provided</scope>
- </dependency>
<dependency>
<groupId>org.slf4j</groupId>
@@ -50,19 +43,6 @@
<scope>provided</scope>
</dependency>
- <dependency>
- <groupId>javax.annotation</groupId>
- <artifactId>jsr250-api</artifactId>
- <version>1.0</version>
- <scope>provided</scope>
- </dependency>
-
- <dependency>
- <groupId>org.jboss.spec.javax.interceptor</groupId>
- <artifactId>jboss-interceptors-api_1.1_spec</artifactId>
- <scope>provided</scope>
- </dependency>
-
<!-- Test libraries -->
<dependency>
<groupId>commons-httpclient</groupId>
@@ -90,6 +70,23 @@
</dependencies>
+ <repositories>
+ <repository>
+ <id>jboss-public-repository-new</id>
+ <name>JBoss Public Maven Repository Group</name>
+ <url>https://repository.jboss.org/nexus/content/groups/public/</url>
+ <layout>default</layout>
+ <releases>
+ <enabled>true</enabled>
+ <updatePolicy>never</updatePolicy>
+ </releases>
+ <snapshots>
+ <enabled>true</enabled>
+ <updatePolicy>never</updatePolicy>
+ </snapshots>
+ </repository>
+ </repositories>
+
<build>
<finalName>resteasy-cdi</finalName>
<plugins>
Added: trunk/resteasy-int/test/cdi-test-2/src/main/java/org/jboss/resteasy/cdi/test/ejb/SingletonProvider.java
===================================================================
--- trunk/resteasy-int/test/cdi-test-2/src/main/java/org/jboss/resteasy/cdi/test/ejb/SingletonProvider.java (rev 0)
+++ trunk/resteasy-int/test/cdi-test-2/src/main/java/org/jboss/resteasy/cdi/test/ejb/SingletonProvider.java 2011-02-01 11:23:30 UTC (rev 110504)
@@ -0,0 +1,66 @@
+package org.jboss.resteasy.cdi.test.ejb;
+
+import javax.ejb.EJB;
+import javax.ejb.LocalBean;
+import javax.ejb.Singleton;
+import javax.inject.Inject;
+import javax.ws.rs.Produces;
+import javax.ws.rs.core.Context;
+import javax.ws.rs.core.Response;
+import javax.ws.rs.core.Response.Status;
+import javax.ws.rs.ext.ExceptionMapper;
+import javax.ws.rs.ext.Provider;
+import javax.ws.rs.ext.Providers;
+
+import org.jboss.resteasy.cdi.test.Cat;
+
+ at Singleton
+ at LocalBean
+ at Produces("text/plain")
+ at Provider
+public class SingletonProvider implements ExceptionMapper<InstantiationException>
+{
+ @Inject
+ private Cat cat;
+ @EJB
+ private InjectedStatelessEjbLocal statelessEjb;
+ private Cat constructorCat;
+ private Cat initializerCat;
+ @Context
+ private Providers providers;
+
+ public SingletonProvider()
+ {
+ }
+
+ @Inject
+ public SingletonProvider(Cat cat)
+ {
+ constructorCat = cat;
+ }
+
+ @Inject
+ public void init(Cat cat)
+ {
+ initializerCat = cat;
+ }
+
+ public Response toResponse(InstantiationException exception)
+ {
+ StringBuilder builder = new StringBuilder();
+ builder.append("CDI field injection: ");
+ builder.append(cat != null);
+ builder.append("\nCDI constructor injection: ");
+ builder.append(constructorCat != null);
+ builder.append("\nCDI initializer injection: ");
+ builder.append(initializerCat != null);
+ builder.append("\nEJB injection: ");
+ builder.append(statelessEjb != null);
+ builder.append("\nJAX-RS field injection: ");
+ builder.append(providers != null);
+ builder.append("\nProvider toString(): ");
+ builder.append(toString());
+
+ return Response.status(Status.OK).entity(builder.toString()).build();
+ }
+}
Added: trunk/resteasy-int/test/cdi-test-2/src/main/java/org/jboss/resteasy/cdi/test/ejb/SingletonResource.java
===================================================================
--- trunk/resteasy-int/test/cdi-test-2/src/main/java/org/jboss/resteasy/cdi/test/ejb/SingletonResource.java (rev 0)
+++ trunk/resteasy-int/test/cdi-test-2/src/main/java/org/jboss/resteasy/cdi/test/ejb/SingletonResource.java 2011-02-01 11:23:30 UTC (rev 110504)
@@ -0,0 +1,110 @@
+package org.jboss.resteasy.cdi.test.ejb;
+
+import javax.ejb.EJB;
+import javax.ejb.Singleton;
+import javax.ejb.Startup;
+import javax.inject.Inject;
+import javax.ws.rs.GET;
+import javax.ws.rs.Path;
+import javax.ws.rs.Produces;
+import javax.ws.rs.QueryParam;
+import javax.ws.rs.core.Context;
+import javax.ws.rs.core.UriInfo;
+
+import org.jboss.resteasy.cdi.test.Cat;
+import org.jboss.resteasy.cdi.test.Subresource;
+
+ at Singleton
+ at Path("/singleton")
+ at Produces("text/plain")
+ at Startup
+public class SingletonResource
+{
+ @Inject
+ private Cat cat;
+ @EJB
+ private InjectedStatelessEjbLocal statelessEjb;
+ private Cat constructorCat;
+ private Cat initializerCat;
+ @Context
+ private UriInfo uriInfo;
+ private UriInfo setterUriInfo;
+ @Inject
+ private Subresource subresource;
+
+ public SingletonResource()
+ {
+ }
+
+ @Inject
+ public SingletonResource(Cat cat)
+ {
+ constructorCat = cat;
+ }
+
+ @Inject
+ public void init(Cat cat)
+ {
+ initializerCat = cat;
+ }
+
+ @GET
+ @Path("/fieldInjection")
+ public boolean fieldInjection()
+ {
+ return cat != null;
+ }
+ @GET
+ @Path("/ejbFieldInjection")
+ public boolean testEjbFieldInjection()
+ {
+ return statelessEjb.foo();
+ }
+ @GET
+ @Path("/jaxrsFieldInjection")
+ public boolean jaxrsFieldInjection()
+ {
+ return uriInfo != null;
+ }
+ @GET
+ @Path("/jaxrsSetterInjection")
+ public boolean jaxrsSetterInjection()
+ {
+ return setterUriInfo != null;
+ }
+ @GET
+ @Path("/constructorInjection")
+ public boolean constructorInjection()
+ {
+ return constructorCat != null;
+ }
+ @GET
+ @Path("/initializerInjection")
+ public boolean initializerInjection()
+ {
+ return initializerCat != null;
+ }
+ @GET
+ @Path("/jaxrsMethodInjection")
+ public String jaxrsMethodInjection(@QueryParam("foo") String query)
+ {
+ return query;
+ }
+ @GET
+ @Path("/providers")
+ public void testProviders() throws Exception
+ {
+ throw new InstantiationException();
+ }
+
+ @Context
+ public void setSetterUriInfo(UriInfo setterUriInfo)
+ {
+ this.setterUriInfo = setterUriInfo;
+ }
+ @Path("/subresource")
+ public Subresource subresource()
+ {
+ return subresource;
+ }
+}
Added: trunk/resteasy-int/test/cdi-test-2/src/test/java/org/jboss/resteasy/cdi/test/SingletonProviderTest.java
===================================================================
--- trunk/resteasy-int/test/cdi-test-2/src/test/java/org/jboss/resteasy/cdi/test/SingletonProviderTest.java (rev 0)
+++ trunk/resteasy-int/test/cdi-test-2/src/test/java/org/jboss/resteasy/cdi/test/SingletonProviderTest.java 2011-02-01 11:23:30 UTC (rev 110504)
@@ -0,0 +1,10 @@
+package org.jboss.resteasy.cdi.test;
+
+public class SingletonProviderTest extends BeanClassLocalViewEjbProviderTest
+{
+ @Override
+ protected String getTestPrefix()
+ {
+ return "singleton/";
+ }
+}
Added: trunk/resteasy-int/test/cdi-test-2/src/test/java/org/jboss/resteasy/cdi/test/SingletonResourceTest.java
===================================================================
--- trunk/resteasy-int/test/cdi-test-2/src/test/java/org/jboss/resteasy/cdi/test/SingletonResourceTest.java (rev 0)
+++ trunk/resteasy-int/test/cdi-test-2/src/test/java/org/jboss/resteasy/cdi/test/SingletonResourceTest.java 2011-02-01 11:23:30 UTC (rev 110504)
@@ -0,0 +1,10 @@
+package org.jboss.resteasy.cdi.test;
+
+public class SingletonResourceTest extends StatelessSessionBeanResourceTest
+{
+ @Override
+ protected String getTestPrefix()
+ {
+ return "singleton/";
+ }
+}
Modified: trunk/resteasy-int/test/cdi-test-2/src/test/java/org/jboss/resteasy/cdi/test/StatefulSessionBeanWithAnnotationsOnLocalInterfaceTest.java
===================================================================
--- trunk/resteasy-int/test/cdi-test-2/src/test/java/org/jboss/resteasy/cdi/test/StatefulSessionBeanWithAnnotationsOnLocalInterfaceTest.java 2011-02-01 10:35:58 UTC (rev 110503)
+++ trunk/resteasy-int/test/cdi-test-2/src/test/java/org/jboss/resteasy/cdi/test/StatefulSessionBeanWithAnnotationsOnLocalInterfaceTest.java 2011-02-01 11:23:30 UTC (rev 110504)
@@ -18,12 +18,6 @@
}
@Override
- // WELDINT-31 This test is disabled temporarily
- public void testCdiConstructorInjection()
- {
- }
-
- @Override
// This test is disabled temporarily
public void testSubresource()
{
Modified: trunk/resteasy-int/test/cdi-test-2/src/test/java/org/jboss/resteasy/cdi/test/StatelessSessionBeanResourceTest.java
===================================================================
--- trunk/resteasy-int/test/cdi-test-2/src/test/java/org/jboss/resteasy/cdi/test/StatelessSessionBeanResourceTest.java 2011-02-01 10:35:58 UTC (rev 110503)
+++ trunk/resteasy-int/test/cdi-test-2/src/test/java/org/jboss/resteasy/cdi/test/StatelessSessionBeanResourceTest.java 2011-02-01 11:23:30 UTC (rev 110504)
@@ -17,12 +17,4 @@
{
testPlainTextReadonlyResource(BASE_URI + getTestPrefix() + "ejbFieldInjection", true);
}
-
- @Override
- // WELDINT-31 This test is disabled temporarily
- public void testCdiConstructorInjection()
- {
- }
-
-
}
More information about the jboss-cvs-commits
mailing list