cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject cxf git commit: [CXF-5348] Adding a test
Date Thu, 06 Aug 2015 10:15:22 GMT
Repository: cxf
Updated Branches:
  refs/heads/master 54ae15322 -> dbd709e6e


[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/dbd709e6
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/dbd709e6
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/dbd709e6

Branch: refs/heads/master
Commit: dbd709e6ef4b2cc054f61fd991fcacda2daa613c
Parents: 54ae153
Author: Sergey Beryozkin <sberyozkin@gmail.com>
Authored: Thu Aug 6 11:15:04 2015 +0100
Committer: Sergey Beryozkin <sberyozkin@gmail.com>
Committed: Thu Aug 6 11:15:04 2015 +0100

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


http://git-wip-us.apache.org/repos/asf/cxf/blob/dbd709e6/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 {


Mime
View raw message