Repository: cxf
Updated Branches:
  refs/heads/3.0.x-fixes b6a8a6899 -> 4557822f1


[CXF-5348] Adding a test


Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/4557822f
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/4557822f
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/4557822f

Branch: refs/heads/3.0.x-fixes
Commit: 4557822f1029e25fa4a0469381909a9362370293
Parents: b6a8a68
Author: Sergey Beryozkin <[email protected]>
Authored: Thu Aug 6 11:15:04 2015 +0100
Committer: Sergey Beryozkin <[email protected]>
Committed: Thu Aug 6 11:15:50 2015 +0100

----------------------------------------------------------------------
 .../apache/cxf/jaxrs/provider/ProviderFactoryTest.java   | 11 +++++++++++
 1 file changed, 11 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/4557822f/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/provider/ProviderFactoryTest.java
----------------------------------------------------------------------
diff --git 
a/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/provider/ProviderFactoryTest.java
 
b/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/provider/ProviderFactoryTest.java
index 535b463..f33d49d 100644
--- 
a/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/provider/ProviderFactoryTest.java
+++ 
b/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/provider/ProviderFactoryTest.java
@@ -875,6 +875,9 @@ public class ProviderFactoryTest extends Assert {
     private static class SecurityExceptionMapper 
         extends AbstractBadRequestExceptionMapper<SecurityException> {
     }
+    private static class CustomWebApplicationExceptionMapper 
+        extends AbstractBadRequestExceptionMapper<WebApplicationException> {
+    }
     private abstract static class AbstractBadRequestExceptionMapper<T extends 
Throwable> 
         implements ExceptionMapper<T> {
         @Override
@@ -882,6 +885,14 @@ public class ProviderFactoryTest extends Assert {
             return 
Response.status(Status.BAD_REQUEST).entity(exception.getMessage()).build();
         }
     }
+    @Test
+    public void testWebApplicationMapperWithGenerics() throws Exception {
+        ServerProviderFactory pf = ServerProviderFactory.getInstance();
+        CustomWebApplicationExceptionMapper mapper = new 
CustomWebApplicationExceptionMapper();
+        pf.registerUserProvider(mapper);
+        Object mapperResponse = 
pf.createExceptionMapper(WebApplicationException.class, new MessageImpl());
+        assertSame(mapperResponse, mapper);
+    }
     
     @Test
     public void testBadCustomExceptionMappersHierarchyWithGenerics() throws 
Exception {

Reply via email to