geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From xiam...@apache.org
Subject svn commit: r1411999 - in /geronimo/server/branches/3.0/testsuite/javaee6-testsuite: ./ restful-test/src/main/java/org/apache/geronimo/testsuite/restful/app/ restful-test/src/main/webapp/WEB-INF/ restful-test/src/test/java/org/apache/geronimo/testsuite...
Date Wed, 21 Nov 2012 07:39:27 GMT
Author: xiaming
Date: Wed Nov 21 07:39:26 2012
New Revision: 1411999

URL: http://svn.apache.org/viewvc?rev=1411999&view=rev
Log:
GERONIMO-6407 Reenable jaxrs test case restful-test

Modified:
    geronimo/server/branches/3.0/testsuite/javaee6-testsuite/pom.xml
    geronimo/server/branches/3.0/testsuite/javaee6-testsuite/restful-test/src/main/java/org/apache/geronimo/testsuite/restful/app/ApplicationConfig.java
    geronimo/server/branches/3.0/testsuite/javaee6-testsuite/restful-test/src/main/java/org/apache/geronimo/testsuite/restful/app/OrderResource.java
    geronimo/server/branches/3.0/testsuite/javaee6-testsuite/restful-test/src/main/webapp/WEB-INF/web.xml
    geronimo/server/branches/3.0/testsuite/javaee6-testsuite/restful-test/src/test/java/org/apache/geronimo/testsuite/restful/TestRestful.java

Modified: geronimo/server/branches/3.0/testsuite/javaee6-testsuite/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/server/branches/3.0/testsuite/javaee6-testsuite/pom.xml?rev=1411999&r1=1411998&r2=1411999&view=diff
==============================================================================
--- geronimo/server/branches/3.0/testsuite/javaee6-testsuite/pom.xml (original)
+++ geronimo/server/branches/3.0/testsuite/javaee6-testsuite/pom.xml Wed Nov 21 07:39:26 2012
@@ -63,7 +63,7 @@
         <!--<module>webbean1.0-test</module>-->
         <module>ejb3.1-test</module>
         <module>jpa2.0-test</module>
-        <!--<module>restful-test</module>-->
+        <module>restful-test</module>
         <module>jndi-infer-test</module>
   </modules>
         
@@ -93,4 +93,4 @@
         </profile>
     </profiles>
 
-</project>
\ No newline at end of file
+</project>

Modified: geronimo/server/branches/3.0/testsuite/javaee6-testsuite/restful-test/src/main/java/org/apache/geronimo/testsuite/restful/app/ApplicationConfig.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/3.0/testsuite/javaee6-testsuite/restful-test/src/main/java/org/apache/geronimo/testsuite/restful/app/ApplicationConfig.java?rev=1411999&r1=1411998&r2=1411999&view=diff
==============================================================================
--- geronimo/server/branches/3.0/testsuite/javaee6-testsuite/restful-test/src/main/java/org/apache/geronimo/testsuite/restful/app/ApplicationConfig.java
(original)
+++ geronimo/server/branches/3.0/testsuite/javaee6-testsuite/restful-test/src/main/java/org/apache/geronimo/testsuite/restful/app/ApplicationConfig.java
Wed Nov 21 07:39:26 2012
@@ -19,7 +19,7 @@ package org.apache.geronimo.testsuite.re
 import java.util.HashSet;
 import java.util.Set;
 
-@javax.ws.rs.ApplicationPath("resources")
+//@javax.ws.rs.ApplicationPath("resources")
 public class ApplicationConfig extends javax.ws.rs.core.Application {
     
     @Override
@@ -28,4 +28,4 @@ public class ApplicationConfig extends j
         classes.add(OrderResource.class);
         return classes;
     }
-}
\ No newline at end of file
+}

Modified: geronimo/server/branches/3.0/testsuite/javaee6-testsuite/restful-test/src/main/java/org/apache/geronimo/testsuite/restful/app/OrderResource.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/3.0/testsuite/javaee6-testsuite/restful-test/src/main/java/org/apache/geronimo/testsuite/restful/app/OrderResource.java?rev=1411999&r1=1411998&r2=1411999&view=diff
==============================================================================
--- geronimo/server/branches/3.0/testsuite/javaee6-testsuite/restful-test/src/main/java/org/apache/geronimo/testsuite/restful/app/OrderResource.java
(original)
+++ geronimo/server/branches/3.0/testsuite/javaee6-testsuite/restful-test/src/main/java/org/apache/geronimo/testsuite/restful/app/OrderResource.java
Wed Nov 21 07:39:26 2012
@@ -32,10 +32,19 @@ import javax.ws.rs.Produces;
 import javax.ws.rs.WebApplicationException;
 import javax.ws.rs.core.Response;
 
-@Path("/orders")
+@Path(value = "/orders")
 public class OrderResource {
 	private static Map<Integer, Order> orders = new ConcurrentHashMap<Integer, Order>();
 	private static AtomicInteger ids = new AtomicInteger();
+	static String html_content =
+            "<html>" + "<head><title>Restful Services via Wink</title></head>"
+
+            "<body>Restful Services via Wink!</body></html>";
+	
+	@GET
+	@Produces(value = "text/html")
+	public Response welcome() {
+		return Response.ok(html_content).header("WINK-HEAD", "text-html").build();
+	}
 	
 	@POST
 	@Consumes("application/xml")

Modified: geronimo/server/branches/3.0/testsuite/javaee6-testsuite/restful-test/src/main/webapp/WEB-INF/web.xml
URL: http://svn.apache.org/viewvc/geronimo/server/branches/3.0/testsuite/javaee6-testsuite/restful-test/src/main/webapp/WEB-INF/web.xml?rev=1411999&r1=1411998&r2=1411999&view=diff
==============================================================================
--- geronimo/server/branches/3.0/testsuite/javaee6-testsuite/restful-test/src/main/webapp/WEB-INF/web.xml
(original)
+++ geronimo/server/branches/3.0/testsuite/javaee6-testsuite/restful-test/src/main/webapp/WEB-INF/web.xml
Wed Nov 21 07:39:26 2012
@@ -23,6 +23,19 @@
 <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"
id="el2.2-javaee6">
 
     <description>Restful Web Service - javaee6 Servlet Sample</description>
+    <servlet>
+        <servlet-name>WinkServletEntry</servlet-name>
+        <servlet-class>org.apache.geronimo.wink.GeronimoRestServlet</servlet-class>
+        <init-param>
+            <param-name>javax.ws.rs.Application</param-name>
+            <param-value>org.apache.geronimo.testsuite.restful.app.ApplicationConfig</param-value>
+        </init-param>
+        <load-on-startup>1</load-on-startup>
+    </servlet>
+    <servlet-mapping>
+        <servlet-name>WinkServletEntry</servlet-name>
+        <url-pattern>/*</url-pattern>
+    </servlet-mapping>
     <session-config>
         <session-timeout>
             30

Modified: geronimo/server/branches/3.0/testsuite/javaee6-testsuite/restful-test/src/test/java/org/apache/geronimo/testsuite/restful/TestRestful.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/3.0/testsuite/javaee6-testsuite/restful-test/src/test/java/org/apache/geronimo/testsuite/restful/TestRestful.java?rev=1411999&r1=1411998&r2=1411999&view=diff
==============================================================================
--- geronimo/server/branches/3.0/testsuite/javaee6-testsuite/restful-test/src/test/java/org/apache/geronimo/testsuite/restful/TestRestful.java
(original)
+++ geronimo/server/branches/3.0/testsuite/javaee6-testsuite/restful-test/src/test/java/org/apache/geronimo/testsuite/restful/TestRestful.java
Wed Nov 21 07:39:26 2012
@@ -42,7 +42,7 @@ public class TestRestful extends TestSup
 			+ "<quantity>1</quantity>"
 			+ "<seller>shop</seller>"
 		    + "</order>";
-		URL url = new URL(root + "/resources/orders");
+		URL url = new URL(root + "/orders");
 		HttpURLConnection connection = (HttpURLConnection)url.openConnection();
 		connection.setDoOutput(true);
 		connection.setInstanceFollowRedirects(false);
@@ -58,7 +58,7 @@ public class TestRestful extends TestSup
 	@Test(dependsOnMethods={"testPost"})
 	public void testGet() throws IOException {
 	    String contextroot = System.getProperty("appContext");
-		URL url = new URL(root + "/resources/orders/1");
+		URL url = new URL(root + "/orders/1");
 		HttpURLConnection connection = (HttpURLConnection)url.openConnection();
 		connection.setRequestMethod("GET");
 		connection.setRequestProperty("Accept", "application/xml");
@@ -90,7 +90,7 @@ public class TestRestful extends TestSup
 			+ "<quantity>2</quantity>"
 			+ "<seller>shop</seller>"
 		    + "</order>";
-		URL url = new URL(root + "/resources/orders/1");
+		URL url = new URL(root + "/orders/1");
 		HttpURLConnection connection = (HttpURLConnection)url.openConnection();
 		connection.setDoOutput(true);
 		connection.setRequestMethod("PUT");
@@ -124,7 +124,7 @@ public class TestRestful extends TestSup
 	
 	@Test(dependsOnMethods={"testPut"})
 	public void testDelete() throws IOException {
-		URL url = new URL(root + "/resources/orders/1");
+		URL url = new URL(root + "/orders/1");
 		HttpURLConnection connection = (HttpURLConnection)url.openConnection();
 		connection.setRequestMethod("DELETE");
 		Assert.assertEquals(connection.getResponseCode(), 204);



Mime
View raw message