Author: andygumbrecht Date: Fri Jul 18 08:42:18 2014 New Revision: 1611558 URL: http://svn.apache.org/r1611558 Log: ReflectionInvocationContext - Inline variable GreetingServiceTest - Not for 1.7.x
Modified: tomee/tomee/branches/tomee-1.7.x/container/openejb-core/src/main/java/org/apache/openejb/core/interceptor/ReflectionInvocationContext.java tomee/tomee/branches/tomee-1.7.x/examples/rest-xml-json/ (props changed) tomee/tomee/branches/tomee-1.7.x/examples/rest-xml-json/src/test/java/org/superbiz/rest/GreetingServiceTest.java Modified: tomee/tomee/branches/tomee-1.7.x/container/openejb-core/src/main/java/org/apache/openejb/core/interceptor/ReflectionInvocationContext.java URL: http://svn.apache.org/viewvc/tomee/tomee/branches/tomee-1.7.x/container/openejb-core/src/main/java/org/apache/openejb/core/interceptor/ReflectionInvocationContext.java?rev=1611558&r1=1611557&r2=1611558&view=diff ============================================================================== --- tomee/tomee/branches/tomee-1.7.x/container/openejb-core/src/main/java/org/apache/openejb/core/interceptor/ReflectionInvocationContext.java (original) +++ tomee/tomee/branches/tomee-1.7.x/container/openejb-core/src/main/java/org/apache/openejb/core/interceptor/ReflectionInvocationContext.java Fri Jul 18 08:42:18 2014 @@ -189,8 +189,7 @@ public class ReflectionInvocationContext public Object invoke() throws Exception { - final Object value = method.invoke(target, args); - return value; + return method.invoke(target, args); } @@ -224,8 +223,7 @@ public class ReflectionInvocationContext super.invoke(); // we need to call proceed so callbacks in subclasses get invoked - final Object value = invocationContext.proceed(); - return value; + return invocationContext.proceed(); } } Propchange: tomee/tomee/branches/tomee-1.7.x/examples/rest-xml-json/ ------------------------------------------------------------------------------ --- svn:ignore (original) +++ svn:ignore Fri Jul 18 08:42:18 2014 @@ -1,2 +1,3 @@ target *.iml +.idea Modified: tomee/tomee/branches/tomee-1.7.x/examples/rest-xml-json/src/test/java/org/superbiz/rest/GreetingServiceTest.java URL: http://svn.apache.org/viewvc/tomee/tomee/branches/tomee-1.7.x/examples/rest-xml-json/src/test/java/org/superbiz/rest/GreetingServiceTest.java?rev=1611558&r1=1611557&r2=1611558&view=diff ============================================================================== --- tomee/tomee/branches/tomee-1.7.x/examples/rest-xml-json/src/test/java/org/superbiz/rest/GreetingServiceTest.java (original) +++ tomee/tomee/branches/tomee-1.7.x/examples/rest-xml-json/src/test/java/org/superbiz/rest/GreetingServiceTest.java Fri Jul 18 08:42:18 2014 @@ -43,35 +43,32 @@ public class GreetingServiceTest { @Test public void getXml() throws IOException { final String message = WebClient.create("http://localhost:4204").path("/test/greeting/") - .accept(MediaType.APPLICATION_XML_TYPE) - .get(String.class); - assertEquals("<response><value>Hi REST!</value></response>", message); + .accept(MediaType.APPLICATION_XML_TYPE) + .get(Response.class).getValue(); + assertEquals("Hi REST!", message); } @Test public void postXml() throws IOException { - final String message = WebClient.create("http://localhost:4204") - .path("/test/greeting/") - .accept(MediaType.APPLICATION_XML_TYPE) - .post("<request><value>Hi REST!</value></request>", String.class); - assertEquals("<response><value>hi rest!</value></response>", message); + final String message = WebClient.create("http://localhost:4204").path("/test/greeting/") + .accept(MediaType.APPLICATION_XML_TYPE) + .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") - .path("/test/greeting/") - .accept(MediaType.APPLICATION_JSON_TYPE) - .get(String.class); - assertEquals("{\"value\":\"Hi REST!\"}", message); + final String message = WebClient.create("http://localhost:4204").path("/test/greeting/") + .accept(MediaType.APPLICATION_JSON_TYPE) + .get(Response.class).getValue(); + assertEquals("Hi REST!", message); } @Test public void postJson() throws IOException { - final String message = WebClient.create("http://localhost:4204") - .path("/test/greeting/") - .accept(MediaType.APPLICATION_JSON_TYPE) - .post(new Request("Hi REST!"), String.class); - assertEquals("{\"value\":\"hi rest!\"}", message); + final String message = WebClient.create("http://localhost:4204").path("/test/greeting/") + .accept(MediaType.APPLICATION_JSON_TYPE) + .post(new Request("Hi REST!"), Response.class).getValue(); + assertEquals("hi rest!", message); } }