cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject svn commit: r724383 - in /cxf/branches/2.1.x-fixes: ./ rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/ rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/ rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/interceptor/ rt/frontend/jaxrs/...
Date Mon, 08 Dec 2008 15:46:21 GMT
Author: sergeyb
Date: Mon Dec  8 07:46:21 2008
New Revision: 724383

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

........
  r721501 | sergeyb | 2008-11-28 14:04:44 +0000 (Fri, 28 Nov 2008) | 1 line
  
  JAXRS : support for per-endpoint providers 
........

Modified:
    cxf/branches/2.1.x-fixes/   (props changed)
    cxf/branches/2.1.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/JAXRSInvoker.java
    cxf/branches/2.1.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/JAXRSServerFactoryBean.java
    cxf/branches/2.1.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/MessageBodyWorkersImpl.java
    cxf/branches/2.1.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/interceptor/JAXRSInInterceptor.java
    cxf/branches/2.1.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/interceptor/JAXRSOutInterceptor.java
    cxf/branches/2.1.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/ProviderFactory.java
    cxf/branches/2.1.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/JAXRSUtils.java
    cxf/branches/2.1.x-fixes/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/provider/ProviderFactoryTest.java
    cxf/branches/2.1.x-fixes/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/utils/JAXRSUtilsTest.java
    cxf/branches/2.1.x-fixes/systests/src/test/java/org/apache/cxf/systest/jaxrs/BookStoreSpring.java
    cxf/branches/2.1.x-fixes/systests/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerSpringBookTest.java
    cxf/branches/2.1.x-fixes/systests/src/test/resources/jaxrs/WEB-INF/beans.xml

Propchange: cxf/branches/2.1.x-fixes/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Mon Dec  8 07:46:21 2008
@@ -1 +1 @@
-/cxf/trunk:686333-686363,686764,686820,687096,687194,687363,687387,687463,687543,687722,687798,687814,687817,687891,687910,687914,688086,688102,688133,688596,688735,688870,689572,689596,689855,689924,690067,690289,691246,691271,691295,691338,691355,691488,691602,691646,691706,691728,692116,692157,692310,692466,692499,693653,693819,694179,694263,694417,694716,694744,694747,694795,694869,694981,694987,694993,695041,695096,695396,695484,695537,695552,695561,695619,695684,695835,695840,695868,695935,695977,696016,696094,696433,696720,697085,697868,698128,699289,700261,700507,700602,700981,701316,701783,701830,701862,702187,702205-702248,702267,702547,702561,702580,702602,702609,702616,702653,702656,702957,703191,703239,703309,703501,703513,703548,704584,704937,704997,705150,705235,705274,705340,705446,705548,705614,705692,705708,706482,706631,706675,706900,706909,707034,707089,707100,707902,708035,708044,708074,708410,708417,708550,708554,709353-709354,709425,710076,710150,71015
 4,711193,711388,711410,711490,711635,711975,712194,712198,712238,712272,712299,712312,712670,712893,713082,713095-713096,713099,713584,713597,713737,713804,713899,714167-714168,714245,714255,717937-717961,718281,718439,718448,718565,718620,718640,718665,718970,719017,719210,719215-719218,719222,719273,719305,719327,719354,719362,719368,719382,719649,719680,720053,720119,720238,720497,721221,721241,723024,723338
+/cxf/trunk:686333-686363,686764,686820,687096,687194,687363,687387,687463,687543,687722,687798,687814,687817,687891,687910,687914,688086,688102,688133,688596,688735,688870,689572,689596,689855,689924,690067,690289,691246,691271,691295,691338,691355,691488,691602,691646,691706,691728,692116,692157,692310,692466,692499,693653,693819,694179,694263,694417,694716,694744,694747,694795,694869,694981,694987,694993,695041,695096,695396,695484,695537,695552,695561,695619,695684,695835,695840,695868,695935,695977,696016,696094,696433,696720,697085,697868,698128,699289,700261,700507,700602,700981,701316,701783,701830,701862,702187,702205-702248,702267,702547,702561,702580,702602,702609,702616,702653,702656,702957,703191,703239,703309,703501,703513,703548,704584,704937,704997,705150,705235,705274,705340,705446,705548,705614,705692,705708,706482,706631,706675,706900,706909,707034,707089,707100,707902,708035,708044,708074,708410,708417,708550,708554,709353-709354,709425,710076,710150,71015
 4,711193,711388,711410,711490,711635,711975,712194,712198,712238,712272,712299,712312,712670,712893,713082,713095-713096,713099,713584,713597,713737,713804,713899,714167-714168,714245,714255,717937-717961,718281,718439,718448,718565,718620,718640,718665,718970,719017,719210,719215-719218,719222,719273,719305,719327,719354,719362,719368,719382,719649,719680,720053,720119,720238,720497,721221,721241,721501,723024,723338

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

Modified: cxf/branches/2.1.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/JAXRSInvoker.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.1.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/JAXRSInvoker.java?rev=724383&r1=724382&r2=724383&view=diff
==============================================================================
--- cxf/branches/2.1.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/JAXRSInvoker.java
(original)
+++ cxf/branches/2.1.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/JAXRSInvoker.java
Mon Dec  8 07:46:21 2008
@@ -108,9 +108,10 @@
         try {
             result = invoke(exchange, resourceObject, methodToInvoke, params);
         } catch (Fault ex) {
-            Response excResponse = JAXRSUtils.convertFaultToResponse(ex.getCause());
+            String baseAddress = (String)exchange.getInMessage().get(Message.BASE_PATH);
+            Response excResponse = JAXRSUtils.convertFaultToResponse(ex.getCause(), baseAddress);
             if (excResponse == null) {
-                ProviderFactory.getInstance().cleatThreadLocalProxies();
+                ProviderFactory.getInstance(baseAddress).cleatThreadLocalProxies();
                 ClassResourceInfo criRoot =
                     (ClassResourceInfo)exchange.get(JAXRSInInterceptor.ROOT_RESOURCE_CLASS);
                 if (criRoot != null) {

Modified: cxf/branches/2.1.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/JAXRSServerFactoryBean.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.1.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/JAXRSServerFactoryBean.java?rev=724383&r1=724382&r2=724383&view=diff
==============================================================================
--- cxf/branches/2.1.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/JAXRSServerFactoryBean.java
(original)
+++ cxf/branches/2.1.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/JAXRSServerFactoryBean.java
Mon Dec  8 07:46:21 2008
@@ -97,12 +97,12 @@
                 ep.getService().setInvoker(invoker);
             }
             if (entityProviders != null) {
-                ProviderFactory.getInstance().setUserProviders(entityProviders); 
+                ProviderFactory.getInstance(getAddress()).setUserProviders(entityProviders);

             }
-            ProviderFactory.getInstance().setRequestPreporcessor(
+            ProviderFactory.getInstance(getAddress()).setRequestPreporcessor(
                 new RequestPreprocessor(languageMappings, extensionMappings));
             if (schemaLocations != null) {
-                ProviderFactory.getInstance().setSchemaLocations(schemaLocations);
+                ProviderFactory.getInstance(getAddress()).setSchemaLocations(schemaLocations);
             }
             
             if (start) {

Modified: cxf/branches/2.1.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/MessageBodyWorkersImpl.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.1.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/MessageBodyWorkersImpl.java?rev=724383&r1=724382&r2=724383&view=diff
==============================================================================
--- cxf/branches/2.1.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/MessageBodyWorkersImpl.java
(original)
+++ cxf/branches/2.1.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/MessageBodyWorkersImpl.java
Mon Dec  8 07:46:21 2008
@@ -39,13 +39,13 @@
     
     public <T> MessageBodyReader<T> getMessageBodyReader(
          Class<T> type, Type genericType, Annotation[] annotations, MediaType mediaType)
{
-        return ProviderFactory.getInstance().createMessageBodyReader(
+        return ProviderFactory.getInstance((String)m.get(Message.BASE_PATH)).createMessageBodyReader(
             type, genericType, annotations, mediaType, m);
     }
 
     public <T> MessageBodyWriter<T> getMessageBodyWriter(
         Class<T> type, Type genericType, Annotation[] annotations, MediaType mediaType)
{
-        return ProviderFactory.getInstance().createMessageBodyWriter(
+        return ProviderFactory.getInstance((String)m.get(Message.BASE_PATH)).createMessageBodyWriter(
                    type, genericType, annotations, mediaType, m);
     }
 

Modified: cxf/branches/2.1.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/interceptor/JAXRSInInterceptor.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.1.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/interceptor/JAXRSInInterceptor.java?rev=724383&r1=724382&r2=724383&view=diff
==============================================================================
--- cxf/branches/2.1.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/interceptor/JAXRSInInterceptor.java
(original)
+++ cxf/branches/2.1.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/interceptor/JAXRSInInterceptor.java
Mon Dec  8 07:46:21 2008
@@ -61,12 +61,13 @@
 
     public void handleMessage(Message message) {
         
+        String baseAddress = (String)message.get(Message.BASE_PATH);
         try {
-            processRequest(message);
+            processRequest(message, baseAddress);
         } catch (RuntimeException ex) {
-            Response excResponse = JAXRSUtils.convertFaultToResponse(ex);
+            Response excResponse = JAXRSUtils.convertFaultToResponse(ex, baseAddress);
             if (excResponse == null) {
-                ProviderFactory.getInstance().cleatThreadLocalProxies();
+                ProviderFactory.getInstance(baseAddress).cleatThreadLocalProxies();
                 throw ex;
             }
             message.getExchange().put(Response.class, excResponse);
@@ -86,34 +87,29 @@
         return path;
     }
     
-    private void processRequest(Message message) {
+    private void processRequest(Message message, String baseAddress) {
         
         if (message.getExchange().get(OperationResourceInfo.class) != null) {
             // it's a suspended invocation;
             return;
         }
         
+        String path = (String)message.get(Message.REQUEST_URI);
+        
         RequestPreprocessor rp = 
-            ProviderFactory.getInstance().getRequestPreprocessor();
+            ProviderFactory.getInstance(baseAddress).getRequestPreprocessor();
         if (rp != null) {
             rp.preprocess(message, new UriInfoImpl(message, null));
         }
         
-        String path = (String)message.get(Message.REQUEST_URI);
-        String address = (String)message.get(Message.BASE_PATH);
+
         String httpMethod = (String)message.get(Message.HTTP_REQUEST_METHOD);
         String requestContentType = (String)message.get(Message.CONTENT_TYPE);
         if (requestContentType == null) {
             requestContentType = "*/*";
         }
         
-        if (address.startsWith("http")) {
-            int idx = address.indexOf('/', 7);
-            if (idx != -1) {
-                address = address.substring(idx);
-            }
-        }
-        path = updatePath(path, address);
+        path = updatePath(path, baseAddress);
         
         //1. Matching target resource class
         Service service = message.getExchange().get(Service.class);
@@ -144,7 +140,7 @@
         OperationResourceInfo ori = null;     
         
         List<ProviderInfo<RequestHandler>> shs = 
-            ProviderFactory.getInstance().getRequestHandlers();
+            ProviderFactory.getInstance(baseAddress).getRequestHandlers();
         for (ProviderInfo<RequestHandler> sh : shs) {
             String newAcceptTypes = (String)message.get(Message.ACCEPT_CONTENT_TYPE);
             if (!acceptTypes.equals(newAcceptTypes) || ori == null) {

Modified: cxf/branches/2.1.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/interceptor/JAXRSOutInterceptor.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.1.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/interceptor/JAXRSOutInterceptor.java?rev=724383&r1=724382&r2=724383&view=diff
==============================================================================
--- cxf/branches/2.1.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/interceptor/JAXRSOutInterceptor.java
(original)
+++ cxf/branches/2.1.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/interceptor/JAXRSOutInterceptor.java
Mon Dec  8 07:46:21 2008
@@ -57,10 +57,11 @@
 
     public void handleMessage(Message message) {
         
+        String baseAddress = (String)message.getExchange().getInMessage().get(Message.BASE_PATH);
         try {
-            processResponse(message);
+            processResponse(message, baseAddress);
         } finally {
-            ProviderFactory.getInstance().cleatThreadLocalProxies();
+            ProviderFactory.getInstance(baseAddress).cleatThreadLocalProxies();
             ClassResourceInfo cri =
                 (ClassResourceInfo)message.getExchange().get(JAXRSInInterceptor.ROOT_RESOURCE_CLASS);
             if (cri != null) {
@@ -72,7 +73,7 @@
     }
     
     @SuppressWarnings("unchecked")
-    private void processResponse(Message message) {
+    private void processResponse(Message message, String baseAddress) {
         
         MessageContentsList objs = MessageContentsList.getContentsList(message);
         if (objs == null || objs.size() == 0) {
@@ -93,7 +94,7 @@
                 .getName());
 
             List<ProviderInfo<ResponseHandler>> handlers = 
-                ProviderFactory.getInstance().getResponseHandlers();
+                ProviderFactory.getInstance(baseAddress).getResponseHandlers();
             for (ProviderInfo<ResponseHandler> rh : handlers) {
                 Response r = rh.getProvider().handleResponse(message, operation, response);
                 if (r != null) {
@@ -118,7 +119,7 @@
             MessageBodyWriter writer = null;
             MediaType responseType = null;
             for (MediaType type : availableContentTypes) { 
-                writer = ProviderFactory.getInstance()
+                writer = ProviderFactory.getInstance(baseAddress)
                     .createMessageBodyWriter(targetType, 
                           invoked != null ? invoked.getGenericReturnType() : null, 
                           invoked != null ? invoked.getAnnotations() : new Annotation[]{},


Modified: cxf/branches/2.1.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/ProviderFactory.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.1.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/ProviderFactory.java?rev=724383&r1=724382&r2=724383&view=diff
==============================================================================
--- cxf/branches/2.1.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/ProviderFactory.java
(original)
+++ cxf/branches/2.1.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/ProviderFactory.java
Mon Dec  8 07:46:21 2008
@@ -26,7 +26,9 @@
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.Comparator;
+import java.util.HashMap;
 import java.util.List;
+import java.util.Map;
 
 import javax.ws.rs.ConsumeMime;
 import javax.ws.rs.ProduceMime;
@@ -48,26 +50,31 @@
 
 public final class ProviderFactory {
     
-    private static final ProviderFactory PF = new ProviderFactory();
+    private static final Map<String, ProviderFactory> FACTORIES = 
+        new HashMap<String, ProviderFactory>();
+    
+    static {
+        FACTORIES.put("/", new ProviderFactory());
+    }
     
     private List<ProviderInfo<MessageBodyReader>> defaultMessageReaders = 
         new ArrayList<ProviderInfo<MessageBodyReader>>();
     private List<ProviderInfo<MessageBodyWriter>> defaultMessageWriters = 
         new ArrayList<ProviderInfo<MessageBodyWriter>>();
     private List<ProviderInfo<MessageBodyReader>> userMessageReaders = 
-        new ArrayList<ProviderInfo<MessageBodyReader>>();
+        new ArrayList<ProviderInfo<MessageBodyReader>>(1);
     private List<ProviderInfo<MessageBodyWriter>> userMessageWriters = 
-        new ArrayList<ProviderInfo<MessageBodyWriter>>();
+        new ArrayList<ProviderInfo<MessageBodyWriter>>(1);
     private List<ProviderInfo<ContextResolver>> userContextResolvers = 
-        new ArrayList<ProviderInfo<ContextResolver>>();
+        new ArrayList<ProviderInfo<ContextResolver>>(1);
     private List<ProviderInfo<ExceptionMapper>> defaultExceptionMappers = 
-        new ArrayList<ProviderInfo<ExceptionMapper>>();
+        new ArrayList<ProviderInfo<ExceptionMapper>>(1);
     private List<ProviderInfo<ExceptionMapper>> userExceptionMappers = 
-        new ArrayList<ProviderInfo<ExceptionMapper>>();
+        new ArrayList<ProviderInfo<ExceptionMapper>>(1);
     private List<ProviderInfo<RequestHandler>> requestHandlers = 
-        new ArrayList<ProviderInfo<RequestHandler>>();
+        new ArrayList<ProviderInfo<RequestHandler>>(1);
     private List<ProviderInfo<ResponseHandler>> responseHandlers = 
-        new ArrayList<ProviderInfo<ResponseHandler>>();
+        new ArrayList<ProviderInfo<ResponseHandler>>(1);
     private RequestPreprocessor requestPreprocessor;
     
     private ProviderFactory() {
@@ -91,7 +98,19 @@
     }
     
     public static ProviderFactory getInstance() {
-        return PF;
+        return getInstance("/");
+    }
+    
+    public static ProviderFactory getInstance(String baseAddress) {
+        ProviderFactory pf = null;
+        synchronized (ProviderFactory.class) { 
+            pf = FACTORIES.get(baseAddress);
+            if (pf == null) {
+                pf = new ProviderFactory();
+                FACTORIES.put(baseAddress, pf);
+            }
+        }
+        return pf;
     }
 
     public <T> ContextResolver<T> createContextResolver(Type contextType, Message
m) {

Modified: cxf/branches/2.1.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/JAXRSUtils.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.1.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/JAXRSUtils.java?rev=724383&r1=724382&r2=724383&view=diff
==============================================================================
--- cxf/branches/2.1.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/JAXRSUtils.java
(original)
+++ cxf/branches/2.1.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/JAXRSUtils.java
Mon Dec  8 07:46:21 2008
@@ -531,7 +531,7 @@
     
     public static ContextResolver<?> createContextResolver(Type genericType, Message
m) {
         if (genericType instanceof ParameterizedType) {
-            return ProviderFactory.getInstance().createContextResolver(
+            return ProviderFactory.getInstance((String)m.get(Message.BASE_PATH)).createContextResolver(
                       ((ParameterizedType)genericType).getActualTypeArguments()[0], m);
         }
         return null;
@@ -658,7 +658,7 @@
         MessageBodyReader provider = null;
         
         for (MediaType type : types) { 
-            provider = ProviderFactory.getInstance()
+            provider = ProviderFactory.getInstance((String)m.get(Message.BASE_PATH))
                 .createMessageBodyReader(targetTypeClass,
                                          parameterType,
                                          parameterAnnotations,
@@ -798,10 +798,10 @@
     }
     
     @SuppressWarnings("unchecked")
-    public static Response convertFaultToResponse(Throwable ex) {
+    public static Response convertFaultToResponse(Throwable ex, String baseAddress) {
         
         ExceptionMapper mapper = 
-            ProviderFactory.getInstance().createExceptionMapper(ex.getClass(),
+            ProviderFactory.getInstance(baseAddress).createExceptionMapper(ex.getClass(),
                                                                 new MessageImpl());
         if (mapper != null) {
             Response excResponse = mapper.toResponse(ex);

Modified: cxf/branches/2.1.x-fixes/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/provider/ProviderFactoryTest.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.1.x-fixes/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/provider/ProviderFactoryTest.java?rev=724383&r1=724382&r2=724383&view=diff
==============================================================================
--- cxf/branches/2.1.x-fixes/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/provider/ProviderFactoryTest.java
(original)
+++ cxf/branches/2.1.x-fixes/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/provider/ProviderFactoryTest.java
Mon Dec  8 07:46:21 2008
@@ -63,6 +63,13 @@
     }
     
     @Test
+    public void testMultipleFactories() {
+        assertSame(ProviderFactory.getInstance(), ProviderFactory.getInstance());
+        assertSame(ProviderFactory.getInstance("/bar"), ProviderFactory.getInstance("/bar"));
+        assertNotSame(ProviderFactory.getInstance("/bar"), ProviderFactory.getInstance("/"));
+    }
+    
+    @Test
     public void testExceptionMappers() throws Exception {
         ProviderFactory pf = ProviderFactory.getInstance();
         ExceptionMapper<?> mapper = 

Modified: cxf/branches/2.1.x-fixes/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/utils/JAXRSUtilsTest.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.1.x-fixes/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/utils/JAXRSUtilsTest.java?rev=724383&r1=724382&r2=724383&view=diff
==============================================================================
--- cxf/branches/2.1.x-fixes/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/utils/JAXRSUtilsTest.java
(original)
+++ cxf/branches/2.1.x-fixes/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/utils/JAXRSUtilsTest.java
Mon Dec  8 07:46:21 2008
@@ -865,7 +865,7 @@
         ProviderFactory.getInstance().registerUserProvider(cr);
         
         Message m = new MessageImpl();
-            
+        m.put(Message.BASE_PATH, "/");    
         List<Object> params = 
             JAXRSUtils.processParameters(ori, new MetadataMap<String, String>(), m);
         assertEquals("1 parameters expected", 1, params.size());
@@ -884,7 +884,7 @@
         ProviderFactory.getInstance().registerUserProvider(cr);
         
         Message m = new MessageImpl();
-            
+        m.put(Message.BASE_PATH, "/");    
         InjectionUtils.injectContextFields(c, ori.getClassResourceInfo(), m);
         assertSame(cr.getClass(), c.getContextResolver().getClass());
     }

Modified: cxf/branches/2.1.x-fixes/systests/src/test/java/org/apache/cxf/systest/jaxrs/BookStoreSpring.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.1.x-fixes/systests/src/test/java/org/apache/cxf/systest/jaxrs/BookStoreSpring.java?rev=724383&r1=724382&r2=724383&view=diff
==============================================================================
--- cxf/branches/2.1.x-fixes/systests/src/test/java/org/apache/cxf/systest/jaxrs/BookStoreSpring.java
(original)
+++ cxf/branches/2.1.x-fixes/systests/src/test/java/org/apache/cxf/systest/jaxrs/BookStoreSpring.java
Mon Dec  8 07:46:21 2008
@@ -34,7 +34,7 @@
 import javax.ws.rs.core.MultivaluedMap;
 import javax.ws.rs.core.UriInfo;
 
-@Path("/bookstore")
+@Path("/")
 @ProduceMime("application/json")
 public class BookStoreSpring {
 

Modified: cxf/branches/2.1.x-fixes/systests/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerSpringBookTest.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.1.x-fixes/systests/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerSpringBookTest.java?rev=724383&r1=724382&r2=724383&view=diff
==============================================================================
--- cxf/branches/2.1.x-fixes/systests/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerSpringBookTest.java
(original)
+++ cxf/branches/2.1.x-fixes/systests/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerSpringBookTest.java
Mon Dec  8 07:46:21 2008
@@ -45,7 +45,7 @@
     @Test
     public void testGetBookByUriInfo() throws Exception {
         String endpointAddress =
-            "http://localhost:9080/bookstore/bookinfo?"
+            "http://localhost:9080/thebooks/bookstore/bookinfo?"
                                + "param1=12&param2=3"; 
         getBook(endpointAddress, "resources/expected_get_book123json.txt");
     }
@@ -108,6 +108,12 @@
                "application/xml",
                "resources/add_book.txt",
                null);
+        
+        doPost("http://localhost:9080/thebooks/bookstore/books/convert",
+               500,
+               "application/xml",
+               "resources/add_book.txt",
+               null);
                 
     }
     
@@ -119,6 +125,12 @@
                "application/json",
                "resources/add_book2json_invalid.txt",
                null);
+        
+        doPost("http://localhost:9080/thebooks/bookstore/books/convert",
+               500,
+               "application/json",
+               "resources/add_book2json_invalid.txt",
+               null);
                 
     }
     
@@ -130,6 +142,12 @@
                "application/xml",
                "resources/add_book2.txt",
                "resources/expected_get_book123.txt");
+        
+        doPost("http://localhost:9080/thebooks/bookstore/books/convert",
+               200,
+               "application/xml",
+               "resources/add_book2.txt",
+               "resources/expected_get_book123.txt");
                 
     }
     
@@ -140,6 +158,12 @@
                "application/json",
                "resources/add_book2json.txt",
                "resources/expected_get_book123.txt");
+        
+        doPost("http://localhost:9080/thebooks/bookstore/books/convert",
+               200,
+               "application/json",
+               "resources/add_book2json.txt",
+               "resources/expected_get_book123.txt");
     }
     
     private void doPost(String endpointAddress, int expectedStatus, String contentType,

Modified: cxf/branches/2.1.x-fixes/systests/src/test/resources/jaxrs/WEB-INF/beans.xml
URL: http://svn.apache.org/viewvc/cxf/branches/2.1.x-fixes/systests/src/test/resources/jaxrs/WEB-INF/beans.xml?rev=724383&r1=724382&r2=724383&view=diff
==============================================================================
--- cxf/branches/2.1.x-fixes/systests/src/test/resources/jaxrs/WEB-INF/beans.xml (original)
+++ cxf/branches/2.1.x-fixes/systests/src/test/resources/jaxrs/WEB-INF/beans.xml Mon Dec 
8 07:46:21 2008
@@ -40,10 +40,12 @@
   <import resource="classpath:META-INF/cxf/cxf-extension-jaxrs-binding.xml" />
   <import resource="classpath:META-INF/cxf/cxf-servlet.xml" />
   
+  <bean class="org.apache.cxf.systest.jaxrs.BookStoreSpring" id="serviceBean"/>
+  
   <jaxrs:server id="bookservice"
-		        address="/">
+		        address="/bookstore">
     <jaxrs:serviceBeans>
-      <bean class="org.apache.cxf.systest.jaxrs.BookStoreSpring" />
+      <ref bean="serviceBean" />
     </jaxrs:serviceBeans>		   
     <jaxrs:providers>
        <ref bean="jaxbProvider"/>
@@ -52,6 +54,18 @@
     
   </jaxrs:server>
 
+  <jaxrs:server id="bookservice2"
+		        address="/thebooks/bookstore">
+    <jaxrs:serviceBeans>
+      <ref bean="serviceBean" />
+    </jaxrs:serviceBeans>		  
+    <jaxrs:providers>
+       <ref bean="jaxbProvider"/>
+       <ref bean="jsonProvider"/>
+    </jaxrs:providers> 
+    
+  </jaxrs:server>
+
   <bean id="jaxbProvider" class="org.apache.cxf.jaxrs.provider.JAXBElementProvider">
       <property name="schemaHandler" ref="schemaHolder"/>
   </bean>



Mime
View raw message