You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tomee.apache.org by an...@apache.org on 2014/07/17 23:45:08 UTC
svn commit: r1611487 -
/tomee/tomee/branches/tomee-1.7.x/examples/rest-cdi/src/test/java/org/superbiz/rest/GreetingServiceTest.java
Author: andygumbrecht
Date: Thu Jul 17 21:45:08 2014
New Revision: 1611487
URL: http://svn.apache.org/r1611487
Log:
Not for 1.7.x
Modified:
tomee/tomee/branches/tomee-1.7.x/examples/rest-cdi/src/test/java/org/superbiz/rest/GreetingServiceTest.java
Modified: tomee/tomee/branches/tomee-1.7.x/examples/rest-cdi/src/test/java/org/superbiz/rest/GreetingServiceTest.java
URL: http://svn.apache.org/viewvc/tomee/tomee/branches/tomee-1.7.x/examples/rest-cdi/src/test/java/org/superbiz/rest/GreetingServiceTest.java?rev=1611487&r1=1611486&r2=1611487&view=diff
==============================================================================
--- tomee/tomee/branches/tomee-1.7.x/examples/rest-cdi/src/test/java/org/superbiz/rest/GreetingServiceTest.java (original)
+++ tomee/tomee/branches/tomee-1.7.x/examples/rest-cdi/src/test/java/org/superbiz/rest/GreetingServiceTest.java Thu Jul 17 21:45:08 2014
@@ -17,7 +17,6 @@
package org.superbiz.rest;
import org.apache.cxf.jaxrs.client.WebClient;
-import org.apache.fleece.jaxrs.FleeceProvider;
import org.apache.openejb.jee.WebApp;
import org.apache.openejb.junit.ApplicationComposer;
import org.apache.openejb.testing.Classes;
@@ -29,7 +28,6 @@ import org.junit.runner.RunWith;
import javax.ws.rs.core.MediaType;
import java.io.IOException;
-import static java.util.Arrays.asList;
import static org.junit.Assert.assertEquals;
@EnableServices(value = "jaxrs", httpDebug = true)
@@ -37,7 +35,7 @@ import static org.junit.Assert.assertEqu
public class GreetingServiceTest {
@Module
- @Classes(value = {GreetingService.class, Greeting.class}, cdi = true) // This enables the CDI magic
+ @Classes(value = {GreetingService.class, Greeting.class}, cdi = true) //This enables the CDI magic
public WebApp app() {
return new WebApp().contextRoot("test");
}
@@ -46,7 +44,7 @@ public class GreetingServiceTest {
public void getXml() throws IOException {
final String message = WebClient.create("http://localhost:4204").path("/test/greeting/")
.accept(MediaType.APPLICATION_XML_TYPE)
- .get(GreetingService.Greet.class).getMessage();
+ .get(Response.class).getValue();
assertEquals("Hi REST!", message);
}
@@ -54,23 +52,23 @@ public class GreetingServiceTest {
public void postXml() throws IOException {
final String message = WebClient.create("http://localhost:4204").path("/test/greeting/")
.accept(MediaType.APPLICATION_XML_TYPE)
- .post(new Request("Hi REST!"), GreetingService.Greet.class).getMessage();
+ .post(new Request("Hi REST!"), Response.class).getValue();
assertEquals("hi rest!", message);
}
@Test
public void getJson() throws IOException {
- final String message = WebClient.create("http://localhost:4204", asList(new FleeceProvider<GreetingService.Greet>())).path("/test/greeting/")
+ final String message = WebClient.create("http://localhost:4204").path("/test/greeting/")
.accept(MediaType.APPLICATION_JSON_TYPE)
- .get(GreetingService.Greet.class).getMessage();
+ .get(Response.class).getValue();
assertEquals("Hi REST!", message);
}
@Test
public void postJson() throws IOException {
- final String message = WebClient.create("http://localhost:4204", asList(new FleeceProvider<GreetingService.Greet>())).path("/test/greeting/")
+ final String message = WebClient.create("http://localhost:4204").path("/test/greeting/")
.accept(MediaType.APPLICATION_JSON_TYPE)
- .post(new Request("Hi REST!"), GreetingService.Greet.class).getMessage();
+ .post(new Request("Hi REST!"), Response.class).getValue();
assertEquals("hi rest!", message);
}
}