cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject svn commit: r1225896 - in /cxf/branches/2.4.x-fixes: ./ rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/RequestDispatcherProvider.java rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/provider/ProviderFactoryTest.java
Date Fri, 30 Dec 2011 18:55:16 GMT
Author: sergeyb
Date: Fri Dec 30 18:55:15 2011
New Revision: 1225896

URL: http://svn.apache.org/viewvc?rev=1225896&view=rev
Log:
Merged revisions 1225895 via svnmerge from 
https://svn.apache.org/repos/asf/cxf/trunk

........
  r1225895 | sergeyb | 2011-12-30 18:52:23 +0000 (Fri, 30 Dec 2011) | 1 line
  
  Minor update to RequestDispatcherProvider
........

Modified:
    cxf/branches/2.4.x-fixes/   (props changed)
    cxf/branches/2.4.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/RequestDispatcherProvider.java
    cxf/branches/2.4.x-fixes/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/provider/ProviderFactoryTest.java

Propchange: cxf/branches/2.4.x-fixes/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Dec 30 18:55:15 2011
@@ -1 +1 @@
-/cxf/trunk:1225217,1225494,1225521,1225538,1225563,1225876,1225880
+/cxf/trunk:1225217,1225494,1225521,1225538,1225563,1225876,1225880,1225895

Propchange: cxf/branches/2.4.x-fixes/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.

Modified: cxf/branches/2.4.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/RequestDispatcherProvider.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.4.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/RequestDispatcherProvider.java?rev=1225896&r1=1225895&r2=1225896&view=diff
==============================================================================
--- cxf/branches/2.4.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/RequestDispatcherProvider.java
(original)
+++ cxf/branches/2.4.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/RequestDispatcherProvider.java
Fri Dec 30 18:55:15 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/branches/2.4.x-fixes/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/provider/ProviderFactoryTest.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.4.x-fixes/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/provider/ProviderFactoryTest.java?rev=1225896&r1=1225895&r2=1225896&view=diff
==============================================================================
--- cxf/branches/2.4.x-fixes/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/provider/ProviderFactoryTest.java
(original)
+++ cxf/branches/2.4.x-fixes/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/provider/ProviderFactoryTest.java
Fri Dec 30 18:55:15 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