From d683dc4b30c79348b5e73f0f11b1cfd8ce4b9812 Mon Sep 17 00:00:00 2001 From: rfeng Date: Wed, 19 May 2010 00:53:52 +0000 Subject: Merge branch 'jaxrs' into trunk git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@945980 13f79535-47bb-0310-9956-ffa450edef68 --- .../implementation-jaxrs-runtime/META-INF/MANIFEST.MF | 12 ++++++++---- .../trunk/modules/implementation-jaxrs-runtime/pom.xml | 14 +++++++++++--- .../jaxrs/provider/JAXRSImplementationProvider.java | 10 ++++------ .../java/helloworld/jaxrs/test/HelloWorldTestCase.java | 4 ++-- 4 files changed, 25 insertions(+), 15 deletions(-) (limited to 'sca-java-2.x/trunk/modules/implementation-jaxrs-runtime') diff --git a/sca-java-2.x/trunk/modules/implementation-jaxrs-runtime/META-INF/MANIFEST.MF b/sca-java-2.x/trunk/modules/implementation-jaxrs-runtime/META-INF/MANIFEST.MF index 783e874e36..d914db4ea2 100644 --- a/sca-java-2.x/trunk/modules/implementation-jaxrs-runtime/META-INF/MANIFEST.MF +++ b/sca-java-2.x/trunk/modules/implementation-jaxrs-runtime/META-INF/MANIFEST.MF @@ -9,12 +9,12 @@ Bundle-Description: Apache Tuscany SCA Implementation JAXRS Runtime Bundle-SymbolicName: org.apache.tuscany.sca.implementation.jaxrs.provider Bundle-DocURL: http://www.apache.org/ Import-Package: javax.servlet, + javax.servlet.http, javax.ws.rs, javax.ws.rs.core, - org.apache.wink.server.internal.servlet, - org.apache.wink.server.utils, org.apache.tuscany.sca.assembly;version="2.0.0", org.apache.tuscany.sca.core;version="2.0.0", + org.apache.tuscany.sca.core.invocation;version="2.0.0", org.apache.tuscany.sca.host.http;version="2.0.0", org.apache.tuscany.sca.implementation.jaxrs;version="2.0.0", org.apache.tuscany.sca.interfacedef;version="2.0.0", @@ -22,6 +22,10 @@ Import-Package: javax.servlet, org.apache.tuscany.sca.policy;version="2.0.0", org.apache.tuscany.sca.provider;version="2.0.0", org.apache.tuscany.sca.runtime;version="2.0.0", - org.oasisopen.sca.annotation;version="2.0.0", - org.oasisopen.sca;version="2.0.0" + org.apache.wink.server.internal, + org.apache.wink.server.internal.handlers, + org.apache.wink.server.internal.servlet, + org.apache.wink.server.utils, + org.oasisopen.sca;version="2.0.0", + org.oasisopen.sca.annotation;version="2.0.0" Bundle-RequiredExecutionEnvironment: J2SE-1.5,JavaSE-1.6 diff --git a/sca-java-2.x/trunk/modules/implementation-jaxrs-runtime/pom.xml b/sca-java-2.x/trunk/modules/implementation-jaxrs-runtime/pom.xml index 3d18f1983b..c9448116af 100644 --- a/sca-java-2.x/trunk/modules/implementation-jaxrs-runtime/pom.xml +++ b/sca-java-2.x/trunk/modules/implementation-jaxrs-runtime/pom.xml @@ -41,8 +41,16 @@ org.apache.tuscany.sca tuscany-implementation-java-runtime 2.0-SNAPSHOT + test + + org.apache.tuscany.sca + tuscany-binding-rest-runtime + 2.0-SNAPSHOT + runtime + + org.apache.tuscany.sca tuscany-host-http @@ -79,18 +87,18 @@ org.apache.wink wink-server - 1.0-incubating + 1.1-incubating javax.ws.rs jsr311-api - 1.0 + 1.1 org.apache.wink wink-client - 1.0-incubating + 1.1-incubating test diff --git a/sca-java-2.x/trunk/modules/implementation-jaxrs-runtime/src/main/java/org/apache/tuscany/sca/implementation/jaxrs/provider/JAXRSImplementationProvider.java b/sca-java-2.x/trunk/modules/implementation-jaxrs-runtime/src/main/java/org/apache/tuscany/sca/implementation/jaxrs/provider/JAXRSImplementationProvider.java index e2397b3bcc..91d4607831 100644 --- a/sca-java-2.x/trunk/modules/implementation-jaxrs-runtime/src/main/java/org/apache/tuscany/sca/implementation/jaxrs/provider/JAXRSImplementationProvider.java +++ b/sca-java-2.x/trunk/modules/implementation-jaxrs-runtime/src/main/java/org/apache/tuscany/sca/implementation/jaxrs/provider/JAXRSImplementationProvider.java @@ -19,18 +19,12 @@ package org.apache.tuscany.sca.implementation.jaxrs.provider; -import javax.servlet.Servlet; -import javax.ws.rs.core.Application; - import org.apache.tuscany.sca.host.http.ServletHost; import org.apache.tuscany.sca.implementation.jaxrs.JAXRSImplementation; import org.apache.tuscany.sca.interfacedef.Operation; import org.apache.tuscany.sca.invocation.Invoker; import org.apache.tuscany.sca.provider.ImplementationProvider; import org.apache.tuscany.sca.runtime.RuntimeComponentService; -import org.apache.wink.server.internal.servlet.RestServlet; -import org.apache.wink.server.utils.RegistrationUtils; -import org.oasisopen.sca.ServiceRuntimeException; /** * @@ -57,6 +51,7 @@ public class JAXRSImplementationProvider implements ImplementationProvider { } public void start() { + /* RestServlet restServlet = new RestServlet(); host.addServletMapping("/*", restServlet); Application application; @@ -66,13 +61,16 @@ public class JAXRSImplementationProvider implements ImplementationProvider { throw new ServiceRuntimeException(e); } RegistrationUtils.registerApplication(application, restServlet.getServletContext()); + */ } public void stop() { + /* Servlet servlet = host.removeServletMapping("/*"); if (servlet != null) { servlet.destroy(); } + */ } } diff --git a/sca-java-2.x/trunk/modules/implementation-jaxrs-runtime/src/test/java/helloworld/jaxrs/test/HelloWorldTestCase.java b/sca-java-2.x/trunk/modules/implementation-jaxrs-runtime/src/test/java/helloworld/jaxrs/test/HelloWorldTestCase.java index 20ddf88505..34edff56ca 100644 --- a/sca-java-2.x/trunk/modules/implementation-jaxrs-runtime/src/test/java/helloworld/jaxrs/test/HelloWorldTestCase.java +++ b/sca-java-2.x/trunk/modules/implementation-jaxrs-runtime/src/test/java/helloworld/jaxrs/test/HelloWorldTestCase.java @@ -30,13 +30,11 @@ import org.apache.wink.client.ClientResponse; import org.apache.wink.client.RestClient; import org.junit.AfterClass; import org.junit.BeforeClass; -import org.junit.Ignore; import org.junit.Test; /** * */ -@Ignore public class HelloWorldTestCase { private static Node node; @@ -55,6 +53,8 @@ public class HelloWorldTestCase { public void testDummy() { RestClient client = new RestClient(); ClientResponse response = client.resource("http://localhost:8080/world").get(); + String out = response.getEntity(String.class); + System.out.println(out); Assert.assertEquals(200, response.getStatusCode()); } -- cgit v1.2.3