cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject svn commit: r1359298 - in /cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs: BookStore.java FaultyRequestHandler.java JAXRSClientServerBookTest.java
Date Mon, 09 Jul 2012 17:29:14 GMT
Author: sergeyb
Date: Mon Jul  9 17:29:14 2012
New Revision: 1359298

URL: http://svn.apache.org/viewvc?rev=1359298&view=rev
Log:
Updates to the test filter to validate that UriInfo.getPathParameters is working as expected

Modified:
    cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookStore.java
    cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/FaultyRequestHandler.java
    cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerBookTest.java

Modified: cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookStore.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookStore.java?rev=1359298&r1=1359297&r2=1359298&view=diff
==============================================================================
--- cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookStore.java (original)
+++ cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookStore.java Mon
Jul  9 17:29:14 2012
@@ -214,6 +214,12 @@ public class BookStore {
     }
     
     @GET
+    @Path("propogateExceptionVar/{i}")
+    public Book propogateExceptionWithVar() throws BookNotFoundFault {
+        return null;
+    }
+    
+    @GET
     @Path("name-in-query")
     @Produces("application/xml")
     @XMLInstruction("<!DOCTYPE Something SYSTEM 'my.dtd'><?xmlstylesheet href='common.css'?>")

Modified: cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/FaultyRequestHandler.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/FaultyRequestHandler.java?rev=1359298&r1=1359297&r2=1359298&view=diff
==============================================================================
--- cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/FaultyRequestHandler.java
(original)
+++ cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/FaultyRequestHandler.java
Mon Jul  9 17:29:14 2012
@@ -19,6 +19,7 @@
 package org.apache.cxf.systest.jaxrs;
 
 import javax.ws.rs.core.Context;
+import javax.ws.rs.core.MultivaluedMap;
 import javax.ws.rs.core.Response;
 import javax.ws.rs.core.UriInfo;
 
@@ -32,9 +33,16 @@ public class FaultyRequestHandler implem
     private UriInfo uriInfo;
     
     public Response handleRequest(Message m, ClassResourceInfo resourceClass) {
-        if (uriInfo.getPath().endsWith("/propogateexception4")) {
-            m.getExchange().put("org.apache.cxf.systest.for-out-fault-interceptor", Boolean.TRUE);
-            throw new RuntimeException();
+        if (uriInfo.getPath().endsWith("/propogateExceptionVar/1")) {
+            MultivaluedMap<String, String> vars = uriInfo.getPathParameters();
+            if (vars.size() == 1 
+                && vars.get("i") != null 
+                && vars.get("i").size() == 1 
+                && "1".equals(vars.getFirst("i"))) {
+                
+                m.getExchange().put("org.apache.cxf.systest.for-out-fault-interceptor", Boolean.TRUE);
+                throw new RuntimeException();
+            }
         }
         return null;
     }

Modified: cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerBookTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerBookTest.java?rev=1359298&r1=1359297&r2=1359298&view=diff
==============================================================================
--- cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerBookTest.java
(original)
+++ cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerBookTest.java
Mon Jul  9 17:29:14 2012
@@ -378,7 +378,7 @@ public class JAXRSClientServerBookTest e
     @Test
     public void testPropogateException4() throws Exception {
         String data = "<nobook/>";
-        getAndCompare("http://localhost:" + PORT + "/bookstore/propogateexception4",
+        getAndCompare("http://localhost:" + PORT + "/bookstore/propogateExceptionVar/1",
                       data, "application/xml", 500);
     }
     



Mime
View raw message