[jboss-cvs] JBossAS SVN: r110276 - in trunk/resteasy-int/test/cdi-test-2: src/main/java/org/jboss/resteasy/cdi/test and 3 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Wed Jan 5 16:52:30 EST 2011


Author: jharting
Date: 2011-01-05 16:52:29 -0500 (Wed, 05 Jan 2011)
New Revision: 110276

Added:
   trunk/resteasy-int/test/cdi-test-2/src/main/java/org/jboss/resteasy/cdi/test/FormCarrier.java
Modified:
   trunk/resteasy-int/test/cdi-test-2/pom.xml
   trunk/resteasy-int/test/cdi-test-2/src/main/java/org/jboss/resteasy/cdi/test/Subresource.java
   trunk/resteasy-int/test/cdi-test-2/src/main/java/org/jboss/resteasy/cdi/test/basic/TestResource.java
   trunk/resteasy-int/test/cdi-test-2/src/main/java/org/jboss/resteasy/cdi/test/ejb/StatefulSessionBeanResource.java
   trunk/resteasy-int/test/cdi-test-2/src/main/java/org/jboss/resteasy/cdi/test/ejb/StatefulSessionBeanResourceLocal.java
   trunk/resteasy-int/test/cdi-test-2/src/test/java/org/jboss/resteasy/cdi/test/ResourceTest.java
Log:
RESTEASY-491

Modified: trunk/resteasy-int/test/cdi-test-2/pom.xml
===================================================================
--- trunk/resteasy-int/test/cdi-test-2/pom.xml	2011-01-05 17:16:12 UTC (rev 110275)
+++ trunk/resteasy-int/test/cdi-test-2/pom.xml	2011-01-05 21:52:29 UTC (rev 110276)
@@ -35,6 +35,14 @@
 			<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>

Added: trunk/resteasy-int/test/cdi-test-2/src/main/java/org/jboss/resteasy/cdi/test/FormCarrier.java
===================================================================
--- trunk/resteasy-int/test/cdi-test-2/src/main/java/org/jboss/resteasy/cdi/test/FormCarrier.java	                        (rev 0)
+++ trunk/resteasy-int/test/cdi-test-2/src/main/java/org/jboss/resteasy/cdi/test/FormCarrier.java	2011-01-05 21:52:29 UTC (rev 110276)
@@ -0,0 +1,44 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc., and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.resteasy.cdi.test;
+
+import javax.ws.rs.PathParam;
+import javax.ws.rs.QueryParam;
+
+public class FormCarrier
+{
+   @PathParam("foo")
+   private String foo;
+   
+   @QueryParam("bar")
+   private String bar;
+
+   public String getFoo()
+   {
+      return foo;
+   }
+
+   public String getBar()
+   {
+      return bar;
+   }
+}

Modified: trunk/resteasy-int/test/cdi-test-2/src/main/java/org/jboss/resteasy/cdi/test/Subresource.java
===================================================================
--- trunk/resteasy-int/test/cdi-test-2/src/main/java/org/jboss/resteasy/cdi/test/Subresource.java	2011-01-05 17:16:12 UTC (rev 110275)
+++ trunk/resteasy-int/test/cdi-test-2/src/main/java/org/jboss/resteasy/cdi/test/Subresource.java	2011-01-05 21:52:29 UTC (rev 110276)
@@ -11,6 +11,8 @@
 import javax.ws.rs.core.Context;
 import javax.ws.rs.core.UriInfo;
 
+import org.jboss.resteasy.annotations.Form;
+
 @Produces("text/plain")
 @RequestScoped
 public class Subresource implements Serializable
@@ -103,6 +105,13 @@
    }
    
    @GET
+   @Path("/form/{foo}")
+   public boolean form(@Form FormCarrier form)
+   {
+      return "foo".equals(form.getFoo()) && "bar".equals(form.getBar());
+   }
+   
+   @GET
    @Path("/providers")
    public Dog testProviders()
    {

Modified: trunk/resteasy-int/test/cdi-test-2/src/main/java/org/jboss/resteasy/cdi/test/basic/TestResource.java
===================================================================
--- trunk/resteasy-int/test/cdi-test-2/src/main/java/org/jboss/resteasy/cdi/test/basic/TestResource.java	2011-01-05 17:16:12 UTC (rev 110275)
+++ trunk/resteasy-int/test/cdi-test-2/src/main/java/org/jboss/resteasy/cdi/test/basic/TestResource.java	2011-01-05 21:52:29 UTC (rev 110276)
@@ -8,8 +8,10 @@
 import javax.ws.rs.core.Context;
 import javax.ws.rs.core.UriInfo;
 
+import org.jboss.resteasy.annotations.Form;
 import org.jboss.resteasy.cdi.test.Cat;
 import org.jboss.resteasy.cdi.test.Dog;
+import org.jboss.resteasy.cdi.test.FormCarrier;
 import org.jboss.resteasy.cdi.test.Subresource;
 
 
@@ -103,6 +105,13 @@
    }
    
    @GET
+   @Path("/form/{foo}")
+   public boolean form(@Form FormCarrier form)
+   {
+      return "foo".equals(form.getFoo()) && "bar".equals(form.getBar());
+   }
+   
+   @GET
    @Path("/providers")
    public Dog testProviders()
    {

Modified: trunk/resteasy-int/test/cdi-test-2/src/main/java/org/jboss/resteasy/cdi/test/ejb/StatefulSessionBeanResource.java
===================================================================
--- trunk/resteasy-int/test/cdi-test-2/src/main/java/org/jboss/resteasy/cdi/test/ejb/StatefulSessionBeanResource.java	2011-01-05 17:16:12 UTC (rev 110275)
+++ trunk/resteasy-int/test/cdi-test-2/src/main/java/org/jboss/resteasy/cdi/test/ejb/StatefulSessionBeanResource.java	2011-01-05 21:52:29 UTC (rev 110276)
@@ -10,6 +10,7 @@
 
 import org.jboss.resteasy.cdi.test.Cat;
 import org.jboss.resteasy.cdi.test.Dog;
+import org.jboss.resteasy.cdi.test.FormCarrier;
 import org.jboss.resteasy.cdi.test.Subresource;
 
 @Stateful
@@ -93,6 +94,11 @@
       return id;
    }
    
+   public boolean form(FormCarrier form)
+   {
+      return "foo".equals(form.getFoo()) && "bar".equals(form.getBar());
+   }
+   
    public Dog testProviders()
    {
       return new Dog();

Modified: trunk/resteasy-int/test/cdi-test-2/src/main/java/org/jboss/resteasy/cdi/test/ejb/StatefulSessionBeanResourceLocal.java
===================================================================
--- trunk/resteasy-int/test/cdi-test-2/src/main/java/org/jboss/resteasy/cdi/test/ejb/StatefulSessionBeanResourceLocal.java	2011-01-05 17:16:12 UTC (rev 110275)
+++ trunk/resteasy-int/test/cdi-test-2/src/main/java/org/jboss/resteasy/cdi/test/ejb/StatefulSessionBeanResourceLocal.java	2011-01-05 21:52:29 UTC (rev 110276)
@@ -7,7 +7,9 @@
 import javax.ws.rs.QueryParam;
 import javax.ws.rs.core.UriInfo;
 
+import org.jboss.resteasy.annotations.Form;
 import org.jboss.resteasy.cdi.test.Dog;
+import org.jboss.resteasy.cdi.test.FormCarrier;
 import org.jboss.resteasy.cdi.test.Subresource;
 
 @Local
@@ -52,6 +54,10 @@
    public int getId();
    
    @GET
+   @Path("/form/{foo}")
+   public boolean form(@Form FormCarrier form);
+   
+   @GET
    @Path("/providers")
    public Dog testProviders();
    

Modified: trunk/resteasy-int/test/cdi-test-2/src/test/java/org/jboss/resteasy/cdi/test/ResourceTest.java
===================================================================
--- trunk/resteasy-int/test/cdi-test-2/src/test/java/org/jboss/resteasy/cdi/test/ResourceTest.java	2011-01-05 17:16:12 UTC (rev 110275)
+++ trunk/resteasy-int/test/cdi-test-2/src/test/java/org/jboss/resteasy/cdi/test/ResourceTest.java	2011-01-05 21:52:29 UTC (rev 110276)
@@ -45,4 +45,10 @@
          throw new RuntimeException(e);
       }
    }
+   
+   @Test
+   public void testForm()
+   {
+      testPlainTextReadonlyResource(BASE_URI + getTestPrefix() + "form/foo?bar=bar", true);
+   }
 }



More information about the jboss-cvs-commits mailing list