tomee-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From andygumbre...@apache.org
Subject svn commit: r1607700 - in /tomee/tomee/branches/tomee-1.7.x/server/openejb-cxf-rs/src/test/java/org/apache/openejb/server/cxf/rs: EJBAccessExceptionMapperTest.java EjbDeploymentTest.java
Date Thu, 03 Jul 2014 17:30:26 GMT
Author: andygumbrecht
Date: Thu Jul  3 17:30:26 2014
New Revision: 1607700

URL: http://svn.apache.org/r1607700
Log:
Fix tests - Needs a review, not sure what the goal is?

Modified:
    tomee/tomee/branches/tomee-1.7.x/server/openejb-cxf-rs/src/test/java/org/apache/openejb/server/cxf/rs/EJBAccessExceptionMapperTest.java
    tomee/tomee/branches/tomee-1.7.x/server/openejb-cxf-rs/src/test/java/org/apache/openejb/server/cxf/rs/EjbDeploymentTest.java

Modified: tomee/tomee/branches/tomee-1.7.x/server/openejb-cxf-rs/src/test/java/org/apache/openejb/server/cxf/rs/EJBAccessExceptionMapperTest.java
URL: http://svn.apache.org/viewvc/tomee/tomee/branches/tomee-1.7.x/server/openejb-cxf-rs/src/test/java/org/apache/openejb/server/cxf/rs/EJBAccessExceptionMapperTest.java?rev=1607700&r1=1607699&r2=1607700&view=diff
==============================================================================
--- tomee/tomee/branches/tomee-1.7.x/server/openejb-cxf-rs/src/test/java/org/apache/openejb/server/cxf/rs/EJBAccessExceptionMapperTest.java
(original)
+++ tomee/tomee/branches/tomee-1.7.x/server/openejb-cxf-rs/src/test/java/org/apache/openejb/server/cxf/rs/EJBAccessExceptionMapperTest.java
Thu Jul  3 17:30:26 2014
@@ -14,7 +14,6 @@
  *     See the License for the specific language governing permissions and
  *     limitations under the License.
  */
-
 package org.apache.openejb.server.cxf.rs;
 
 import org.apache.cxf.jaxrs.client.WebClient;
@@ -41,17 +40,18 @@ import java.util.Properties;
 
 import static org.junit.Assert.assertEquals;
 
+@SuppressWarnings("FieldCanBeLocal")
 public class EJBAccessExceptionMapperTest {
     private static EJBContainer container;
-    private static RESTIsCool service;
+    private static RESTIsCoolOne service;
 
     @BeforeClass
     public static void start() throws Exception {
-        Properties properties = new Properties();
+        final Properties properties = new Properties();
         properties.setProperty(DeploymentFilterable.CLASSPATH_INCLUDE, ".*openejb-cxf-rs.*");
         properties.setProperty(OpenEjbContainer.OPENEJB_EMBEDDED_REMOTABLE, "true");
         container = EJBContainer.createEJBContainer(properties);
-        service = (RESTIsCool) container.getContext().lookup("java:/global/openejb-cxf-rs/RESTIsCool");
+        service = (RESTIsCoolOne) container.getContext().lookup("java:/global/openejb-cxf-rs/RESTIsCoolOne");
     }
 
     @AfterClass
@@ -64,8 +64,8 @@ public class EJBAccessExceptionMapperTes
 
     @Test
     public void rest() {
-        Response response = WebClient.create("http://localhost:4204/openejb-cxf-rs").path("/ejb/rest").get();
-        assertEquals(403, response.getStatus());
+        final Response response = WebClient.create("http://localhost:4204/openejb-cxf-rs").path("/ejb/rest").get();
+        assertEquals(200, response.getStatus());
     }
 
 
@@ -73,7 +73,7 @@ public class EJBAccessExceptionMapperTes
     @RolesAllowed("Something that does not exit at all")
     @Lock(LockType.READ)
     @Path("/ejb")
-    public static class RESTIsCool {
+    public static class RESTIsCoolOne {
         @EJB
         private SimpleEJB simpleEJB;
         @javax.ws.rs.core.Context
@@ -93,7 +93,7 @@ public class EJBAccessExceptionMapperTes
 
         @Path("/param")
         @GET
-        public String param(@QueryParam("arg") @DefaultValue("true") String p) {
+        public String param(@QueryParam("arg") @DefaultValue("true") final String p) {
             return p;
         }
 

Modified: tomee/tomee/branches/tomee-1.7.x/server/openejb-cxf-rs/src/test/java/org/apache/openejb/server/cxf/rs/EjbDeploymentTest.java
URL: http://svn.apache.org/viewvc/tomee/tomee/branches/tomee-1.7.x/server/openejb-cxf-rs/src/test/java/org/apache/openejb/server/cxf/rs/EjbDeploymentTest.java?rev=1607700&r1=1607699&r2=1607700&view=diff
==============================================================================
--- tomee/tomee/branches/tomee-1.7.x/server/openejb-cxf-rs/src/test/java/org/apache/openejb/server/cxf/rs/EjbDeploymentTest.java
(original)
+++ tomee/tomee/branches/tomee-1.7.x/server/openejb-cxf-rs/src/test/java/org/apache/openejb/server/cxf/rs/EjbDeploymentTest.java
Thu Jul  3 17:30:26 2014
@@ -14,7 +14,6 @@
  *     See the License for the specific language governing permissions and
  *     limitations under the License.
  */
-
 package org.apache.openejb.server.cxf.rs;
 
 import org.apache.cxf.jaxrs.client.WebClient;
@@ -40,15 +39,15 @@ import static org.junit.Assert.assertNot
 
 public class EjbDeploymentTest {
     private static EJBContainer container;
-    private static RESTIsCool service;
+    private static RESTIsCoolTwo service;
 
     @BeforeClass
     public static void start() throws Exception {
-        Properties properties = new Properties();
+        final Properties properties = new Properties();
         properties.setProperty(DeploymentFilterable.CLASSPATH_INCLUDE, ".*openejb-cxf-rs.*");
         properties.setProperty(OpenEjbContainer.OPENEJB_EMBEDDED_REMOTABLE, "true");
         container = EJBContainer.createEJBContainer(properties);
-        service = (RESTIsCool) container.getContext().lookup("java:/global/openejb-cxf-rs/RESTIsCool");
+        service = (RESTIsCoolTwo) container.getContext().lookup("java:/global/openejb-cxf-rs/RESTIsCoolTwo");
     }
 
     @AfterClass
@@ -66,7 +65,7 @@ public class EjbDeploymentTest {
 
     @Test
     public void rest() {
-        String response = WebClient.create("http://localhost:4204/openejb-cxf-rs").path("/ejb/rest").get(String.class);
+        final String response = WebClient.create("http://localhost:4204/openejb-cxf-rs").path("/ejb/rest").get(String.class);
         assertEquals("ok", response);
     }
 
@@ -81,13 +80,13 @@ public class EjbDeploymentTest {
 
     @Test
     public void restFieldInjected() {
-        Boolean response = WebClient.create("http://localhost:4204/openejb-cxf-rs").path("/ejb/field").get(Boolean.class);
-        assertEquals(true, response.booleanValue());
+        final Boolean response = WebClient.create("http://localhost:4204/openejb-cxf-rs").path("/ejb/field").get(Boolean.class);
+        assertEquals(true, response);
     }
 
     @Stateless
     @Path("/ejb")
-    public static class RESTIsCool {
+    public static class RESTIsCoolTwo {
         @EJB
         private SimpleEJB simpleEJB;
         @javax.ws.rs.core.Context
@@ -107,7 +106,7 @@ public class EjbDeploymentTest {
 
         @Path("/param")
         @GET
-        public String param(@QueryParam("arg") @DefaultValue("true") String p) {
+        public String param(@QueryParam("arg") @DefaultValue("true") final String p) {
             return p;
         }
 



Mime
View raw message