cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject svn commit: r1225895 - in /cxf/trunk/rt/frontend/jaxrs/src: main/java/org/apache/cxf/jaxrs/provider/RequestDispatcherProvider.java test/java/org/apache/cxf/jaxrs/provider/ProviderFactoryTest.java
Date Fri, 30 Dec 2011 18:52:23 GMT
Author: sergeyb
Date: Fri Dec 30 18:52:23 2011
New Revision: 1225895

URL: http://svn.apache.org/viewvc?rev=1225895&view=rev
Log:
Minor update to RequestDispatcherProvider

Modified:
    cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/RequestDispatcherProvider.java
    cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/provider/ProviderFactoryTest.java

Modified: cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/RequestDispatcherProvider.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/RequestDispatcherProvider.java?rev=1225895&r1=1225894&r2=1225895&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/RequestDispatcherProvider.java
(original)
+++ cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/RequestDispatcherProvider.java
Fri Dec 30 18:52:23 2011
@@ -61,6 +61,7 @@ public class RequestDispatcherProvider e
     
     private static final String ABSOLUTE_PATH_PARAMETER = "absolute.path";
     private static final String BASE_PATH_PARAMETER = "base.path";
+    private static final String WEBAPP_BASE_PATH_PARAMETER = "webapp.base.path";
     private static final String RELATIVE_PATH_PARAMETER = "relative.path";
     
     private static final String REQUEST_SCOPE = "request";
@@ -247,6 +248,7 @@ public class RequestDispatcherProvider e
             request.setParameter(ABSOLUTE_PATH_PARAMETER, ui.getAbsolutePath().toString());
             request.setParameter(RELATIVE_PATH_PARAMETER, ui.getPath());
             request.setParameter(BASE_PATH_PARAMETER, ui.getBaseUri().toString());
+            request.setParameter(WEBAPP_BASE_PATH_PARAMETER, (String)mc.get("http.base.path"));
         }
     }
     

Modified: cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/provider/ProviderFactoryTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/provider/ProviderFactoryTest.java?rev=1225895&r1=1225894&r2=1225895&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/provider/ProviderFactoryTest.java
(original)
+++ cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/provider/ProviderFactoryTest.java
Fri Dec 30 18:52:23 2011
@@ -388,6 +388,18 @@ public class ProviderFactoryTest extends
     }
     
     @Test
+    @Ignore
+    public void testExceptionMappersHierarchyWithGenerics() throws Exception {
+        ProviderFactory pf = ProviderFactory.getInstance();
+        RuntimeExceptionMapper1 exMapper1 = new RuntimeExceptionMapper1(); 
+        pf.registerUserProvider(exMapper1);
+        RuntimeExceptionMapper2 exMapper2 = new RuntimeExceptionMapper2(); 
+        pf.registerUserProvider(exMapper2);
+        assertSame(exMapper1, pf.createExceptionMapper(RuntimeException.class, new MessageImpl()));
+        assertSame(exMapper2, pf.createExceptionMapper(WebApplicationException.class, new
MessageImpl()));
+    }
+    
+    @Test
     public void testMessageBodyHandlerHierarchy() throws Exception {
         ProviderFactory pf = ProviderFactory.getInstance();
         List<Object> providers = new ArrayList<Object>();
@@ -871,4 +883,25 @@ public class ProviderFactoryTest extends
         }
         
     }
+    
+    private static class RuntimeExceptionMapper1 
+        extends AbstractTestExceptionMapper<RuntimeException> {
+        
+    }
+    
+    private static class RuntimeExceptionMapper2 
+        extends AbstractTestExceptionMapper<WebApplicationException> {
+        
+    }
+    
+    private static class AbstractTestExceptionMapper<T extends RuntimeException> 
+        implements ExceptionMapper<T> {
+
+        @Override
+        public Response toResponse(T arg0) {
+            // TODO Auto-generated method stub
+            return null;
+        }
+        
+    }
 }



Mime
View raw message