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 @@ ejb3.1-test jpa2.0-test - + restful-test jndi-infer-test @@ -93,4 +93,4 @@ - \ 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/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 orders = new ConcurrentHashMap(); private static AtomicInteger ids = new AtomicInteger(); + static String html_content = + "" + "Restful Services via Wink" + + "Restful Services via Wink!"; + + @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 @@ Restful Web Service - javaee6 Servlet Sample + + WinkServletEntry + org.apache.geronimo.wink.GeronimoRestServlet + + javax.ws.rs.Application + org.apache.geronimo.testsuite.restful.app.ApplicationConfig + + 1 + + + WinkServletEntry + /* + 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 + "1" + "shop" + ""; - 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 + "2" + "shop" + ""; - 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);