cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject svn commit: r1492704 - in /cxf/branches/2.7.x-fixes: ./ rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/ rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/utils/ systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/
Date Thu, 13 Jun 2013 15:21:51 GMT
Author: sergeyb
Date: Thu Jun 13 15:21:50 2013
New Revision: 1492704

URL: http://svn.apache.org/r1492704
Log:
Merged revisions 1492182,1492277,1492281 via svnmerge from 
https://svn.apache.org/repos/asf/cxf/trunk

........
  r1492182 | sergeyb | 2013-06-12 14:15:53 +0100 (Wed, 12 Jun 2013) | 1 line
  
  Making sure multiple calls to JAXRSServerFactoryBean.setProvider does not lose the providers
registered earlier
........
  r1492277 | sergeyb | 2013-06-12 17:46:52 +0100 (Wed, 12 Jun 2013) | 1 line
  
  [CXF-5066] Adding a test with @Override
........
  r1492281 | sergeyb | 2013-06-12 17:49:47 +0100 (Wed, 12 Jun 2013) | 1 line
  
  [CXF-5066] Adding a test with @Override, one more update
........

Modified:
    cxf/branches/2.7.x-fixes/   (props changed)
    cxf/branches/2.7.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/AbstractJAXRSFactoryBean.java
    cxf/branches/2.7.x-fixes/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/utils/ResourceUtilsTest.java
    cxf/branches/2.7.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookSubresourceImpl.java

Propchange: cxf/branches/2.7.x-fixes/
------------------------------------------------------------------------------
  Merged /cxf/trunk:r1492182-1492281

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

Modified: cxf/branches/2.7.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/AbstractJAXRSFactoryBean.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.7.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/AbstractJAXRSFactoryBean.java?rev=1492704&r1=1492703&r2=1492704&view=diff
==============================================================================
--- cxf/branches/2.7.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/AbstractJAXRSFactoryBean.java
(original)
+++ cxf/branches/2.7.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/AbstractJAXRSFactoryBean.java
Thu Jun 13 15:21:50 2013
@@ -23,6 +23,7 @@ import java.util.Arrays;
 import java.util.Collections;
 import java.util.HashMap;
 import java.util.Iterator;
+import java.util.LinkedList;
 import java.util.List;
 import java.util.Map;
 import java.util.ResourceBundle;
@@ -76,7 +77,7 @@ public class AbstractJAXRSFactoryBean ex
     
     protected List<String> schemaLocations;
     protected JAXRSServiceFactoryBean serviceFactory;
-    protected List<?> entityProviders;
+    protected List<Object> entityProviders = new LinkedList<Object>();
     
     protected AbstractJAXRSFactoryBean(JAXRSServiceFactoryBean serviceFactory) {
         this.serviceFactory = serviceFactory;
@@ -283,21 +284,21 @@ public class AbstractJAXRSFactoryBean ex
     }
 
     /**
-     * Sets custom JAX-RS providers.
+     * Add custom JAX-RS providers to the list of providers
      * 
      * @param entityProviders the entityProviders
      */
     public void setProviders(List<? extends Object> providers) {
-        this.entityProviders = providers;
+        this.entityProviders.addAll(providers);
     }
     
     /**
-     * Sets a custom JAX-RS provider.
+     * Add custom JAX-RS provider to the list of providers
      * 
      * @param provider the custom provider.
      */
     public void setProvider(Object provider) {
-        setProviders(Collections.singletonList(provider));
+        entityProviders.add(provider);
     }
 
     protected void checkResources(boolean server) {

Modified: cxf/branches/2.7.x-fixes/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/utils/ResourceUtilsTest.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.7.x-fixes/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/utils/ResourceUtilsTest.java?rev=1492704&r1=1492703&r2=1492704&view=diff
==============================================================================
--- cxf/branches/2.7.x-fixes/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/utils/ResourceUtilsTest.java
(original)
+++ cxf/branches/2.7.x-fixes/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/utils/ResourceUtilsTest.java
Thu Jun 13 15:21:50 2013
@@ -132,6 +132,17 @@ public class ResourceUtilsTest extends A
         assertTrue(types.containsKey(Chapter.class));
     }
     
+    @Test
+    public void testClassResourceInfoWithOverride() throws Exception {
+        ClassResourceInfo cri = 
+            ResourceUtils.createClassResourceInfo(ExampleImpl.class, ExampleImpl.class, true,
true);
+        assertNotNull(cri);
+        Method m = ExampleImpl.class.getMethod("get");
+        OperationResourceInfo ori = cri.getMethodDispatcher().getOperationResourceInfo(m);
+        assertNotNull(ori);
+        assertEquals("GET", ori.getHttpMethod());
+    }
+    
     public interface IProductResource {
         @Path("/parts")
         IPartsResource getParts();
@@ -156,4 +167,19 @@ public class ResourceUtilsTest extends A
         @GET
         Book get();
     }
+    
+    @Path("example")
+    public interface Example {
+         
+        @GET
+        Book get();
+    }
+
+    public static class ExampleImpl implements Example {
+
+        @Override
+        public Book get() {
+            return null;
+        }
+    }
 }

Modified: cxf/branches/2.7.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookSubresourceImpl.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.7.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookSubresourceImpl.java?rev=1492704&r1=1492703&r2=1492704&view=diff
==============================================================================
--- cxf/branches/2.7.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookSubresourceImpl.java
(original)
+++ cxf/branches/2.7.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookSubresourceImpl.java
Thu Jun 13 15:21:50 2013
@@ -58,7 +58,7 @@ public class BookSubresourceImpl impleme
         b.setName(n1 + n2 + n3 + n33 + n4 + n5 + n6);
         return b;
     }
-    
+    @Override
     public Book getTheBook3(String sid, List<String> nameParts) throws BookNotFoundFault
{
         if (nameParts.size() != 2) {
             throw new RuntimeException("Wrong number of name parts");



Mime
View raw message