cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject svn commit: r734128 - 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/model/ rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/model/ rt/frontend/jaxrs/src/t...
Date Tue, 13 Jan 2009 13:42:13 GMT
Author: sergeyb
Date: Tue Jan 13 05:40:57 2009
New Revision: 734128

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

........
  r729051 | sergeyb | 2008-12-23 18:16:08 +0000 (Tue, 23 Dec 2008) | 1 line
  
  JAXRS: making field/method/tlproxy resources static, updating system tests
........

Added:
    cxf/branches/2.1.x-fixes/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/resources/TestResourceTemplate3.java
      - copied unchanged from r729051, cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/resources/TestResourceTemplate3.java
    cxf/branches/2.1.x-fixes/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/resources/TestResourceTemplate4.java
      - copied unchanged from r729051, cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/resources/TestResourceTemplate4.java
    cxf/branches/2.1.x-fixes/systests/src/test/java/org/apache/cxf/systest/jaxrs/AtomBookStore2.java
      - copied, changed from r729051, cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxrs/AtomBookStore2.java
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/model/AbstractResourceInfo.java
    cxf/branches/2.1.x-fixes/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/model/ClassResourceInfoTest.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/AtomBookStore.java
    cxf/branches/2.1.x-fixes/systests/src/test/java/org/apache/cxf/systest/jaxrs/AtomClientBookTest.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
    cxf/branches/2.1.x-fixes/systests/src/test/resources/jaxrs_atom/WEB-INF/beans.xml
    cxf/branches/2.1.x-fixes/systests/src/test/resources/jaxrs_spring_providers/WEB-INF/beans.xml
    cxf/branches/2.1.x-fixes/systests/src/test/resources/jaxrs_spring_providers/WEB-INF/web.xml

Propchange: cxf/branches/2.1.x-fixes/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Jan 13 05:40:57 2009
@@ -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,711949,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-718448,718565,718620,718640,718665,718970,719017,719210,719215-719218,719222-719273,719305,719327-719680,720053,720119-720218,720238,720293-720316,720497,721221,721241,721501,722117,722129,722412,722988,723024,723338,723378,723716-723791,724333-724372,724433-724438,724449,724481,724485,724668,724780,724782,724785,724793,724795,724940,725071,725316,725332,725335,725348,725364,725418,725425-725426,725455,725506,725554,725562,725651,725671,725688,725754,725773,725799,725839,726342,726524,726631,726634,726637,726639,726692,726724,726769,726992,727096,727445,727521,727568,727692,727754,727781,727792,728070,728087,728696,728897,729430,729449,729460,729863,730082,730139,730889,730891,731598,731604,731615,731631,731635,732036,732050,732320,732363,732411,732450,732710,
 732827,733512,733582
+/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,711949,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-718448,718565,718620,718640,718665,718970,719017,719210,719215-719218,719222-719273,719305,719327-719680,720053,720119-720218,720238,720293-720316,720497,721221,721241,721501,722117,722129,722412,722988,723024,723338,723378,723716-723791,724333-724372,724433-724438,724449,724481,724485,724668,724780,724782,724785,724793,724795,724940,725071,725316,725332,725335,725348,725364,725418,725425-725426,725455,725506,725554,725562,725651,725671,725688,725754,725773,725799,725839,726342,726524,726631,726634,726637,726639,726692,726724,726769,726992,727096,727445,727521,727568,727692,727754,727781,727792,728070,728087,728696,728897,729051,729430,729449,729460,729863,730082,730139,730889,730891,731598,731604,731615,731631,731635,732036,732050,732320,732363,732411,732450,
 732710,732827,733512,733582

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=734128&r1=734127&r2=734128&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
Tue Jan 13 05:40:57 2009
@@ -204,6 +204,7 @@
             for (Object resourceObject : resources) {
                 if (c.isInstance(resourceObject)) {
                     serviceObject = resourceObject;
+                    break;
                 }
             }
         }

Modified: cxf/branches/2.1.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/model/AbstractResourceInfo.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.1.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/model/AbstractResourceInfo.java?rev=734128&r1=734127&r2=734128&view=diff
==============================================================================
--- cxf/branches/2.1.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/model/AbstractResourceInfo.java
(original)
+++ cxf/branches/2.1.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/model/AbstractResourceInfo.java
Tue Jan 13 05:40:57 2009
@@ -37,16 +37,17 @@
 
 public abstract class AbstractResourceInfo {
     
+    private static Map<Class<?>, List<Field>> contextFields;
+    private static Map<Class<?>, List<Field>> resourceFields;
+    private static Map<Class<?>, Map<Class<?>, Method>> contextMethods;
+    private static Map<Class<?>, Map<Field, ThreadLocalProxy>> fieldProxyMap;
+    private static Map<Class<?>, Map<Field, ThreadLocalProxy>> resourceProxyMap;
+    private static Map<Class<?>, Map<Method, ThreadLocalProxy>> setterProxyMap;
+    
     private boolean root;
     private Class<?> resourceClass;
     private Class<?> serviceClass;
     
-    private List<Field> contextFields;
-    private List<Field> resourceFields;
-    private Map<Class<?>, Method> contextMethods;
-    private Map<Field, ThreadLocalProxy> fieldProxyMap;
-    private Map<Field, ThreadLocalProxy> resourceProxyMap;
-    private Map<Method, ThreadLocalProxy> setterProxyMap;
     
     protected AbstractResourceInfo(Class<?> resourceClass, Class<?> serviceClass,
boolean isRoot) {
         this.serviceClass = serviceClass;
@@ -72,23 +73,23 @@
             for (Annotation a : f.getAnnotations()) {
                 if (a.annotationType() == Context.class) {
                     if (contextFields == null) {
-                        contextFields = new ArrayList<Field>();
+                        contextFields = new HashMap<Class<?>, List<Field>>();
                     }
-                    contextFields.add(f);
+                    addContextField(contextFields, f);
                     if (fieldProxyMap == null) {
-                        fieldProxyMap = new HashMap<Field, ThreadLocalProxy>();
+                        fieldProxyMap = new HashMap<Class<?>, Map<Field, ThreadLocalProxy>>();
                     }
-                    fieldProxyMap.put(f, InjectionUtils.createThreadLocalProxy(f.getType()));
+                    addToMap(fieldProxyMap, f, InjectionUtils.createThreadLocalProxy(f.getType()));
                 } else if (a.annotationType() == Resource.class 
                            && AnnotationUtils.isContextClass(f.getType())) {
                     if (resourceFields == null) {
-                        resourceFields = new ArrayList<Field>();
+                        resourceFields = new HashMap<Class<?>, List<Field>>();
                     }
-                    resourceFields.add(f);
+                    addContextField(resourceFields, f);
                     if (resourceProxyMap == null) {
-                        resourceProxyMap = new HashMap<Field, ThreadLocalProxy>();
+                        resourceProxyMap = new HashMap<Class<?>, Map<Field, ThreadLocalProxy>>();
                     }
-                    resourceProxyMap.put(f, InjectionUtils.createThreadLocalProxy(f.getType()));
+                    addToMap(resourceProxyMap, f, InjectionUtils.createThreadLocalProxy(f.getType()));
                 }
             }
         }
@@ -120,20 +121,21 @@
     
     @SuppressWarnings("unchecked")
     public Map<Class<?>, Method> getContextMethods() {
-        return contextMethods == null ? Collections.EMPTY_MAP 
-                                      : Collections.unmodifiableMap(contextMethods);
+        Map<Class<?>, Method> methods = contextMethods == null ? null : contextMethods.get(getServiceClass());
+        return methods == null ? Collections.EMPTY_MAP 
+                                      : Collections.unmodifiableMap(methods);
     }
     
     private void addContextMethod(Class<?> contextClass, Method m) {
         if (contextMethods == null) {
-            contextMethods = new HashMap<Class<?>, Method>();
+            contextMethods = new HashMap<Class<?>, Map<Class<?>, Method>>();
         }
-        contextMethods.put(contextClass, m);
+        addToMap(contextMethods, contextClass, m);
         if (setterProxyMap == null) {
-            setterProxyMap = new HashMap<Method, ThreadLocalProxy>();
+            setterProxyMap = new HashMap<Class<?>, Map<Method, ThreadLocalProxy>>();
         }
-        setterProxyMap.put(m, 
-             InjectionUtils.createThreadLocalProxy(m.getParameterTypes()[0]));
+        addToMap(setterProxyMap, m, 
+                 InjectionUtils.createThreadLocalProxy(m.getParameterTypes()[0]));
     }
     
     public boolean isRoot() {
@@ -152,28 +154,16 @@
         return getList(resourceFields);
     }
     
-    private static List<Field> getList(List<Field> fields) {
-        List<Field> ret;
-        if (fields != null) {
-            ret = Collections.unmodifiableList(fields);
-        } else {
-            ret = Collections.emptyList();
-        }
-        return ret;
-    }
-    
     public ThreadLocalProxy getContextFieldProxy(Field f) {
-        return fieldProxyMap == null ? null
-               : fieldProxyMap.get(f);
+        return getProxy(fieldProxyMap, f);
     }
     
     public ThreadLocalProxy getResourceFieldProxy(Field f) {
-        return resourceProxyMap == null ? null
-               : resourceProxyMap.get(f);
+        return getProxy(resourceProxyMap, f);
     }
     
     public ThreadLocalProxy getContextSetterProxy(Method m) {
-        return setterProxyMap == null ? null : setterProxyMap.get(m);
+        return getProxy(setterProxyMap, m);
     }
     
     public abstract boolean isSingleton();
@@ -184,14 +174,55 @@
         clearProxies(setterProxyMap);
     }
     
-    private static void clearProxies(Map<?, ThreadLocalProxy> tlps) {
-        if (tlps == null) {
+    private <T> void clearProxies(Map<Class<?>, Map<T, ThreadLocalProxy>>
tlps) {
+        Map<T, ThreadLocalProxy> proxies = tlps == null ? null : tlps.get(getServiceClass());
+        if (proxies == null) {
             return;
         }
-        for (ThreadLocalProxy tlp : tlps.values()) {
+        for (ThreadLocalProxy tlp : proxies.values()) {
             if (tlp != null) {
                 tlp.remove();
             }
         }
     }
+    
+    private void addContextField(Map<Class<?>, List<Field>> theFields,
Field f) {
+        List<Field> fields = theFields.get(serviceClass);
+        if (fields == null) {
+            fields = new ArrayList<Field>();
+            theFields.put(serviceClass, fields);
+        }
+        if (!fields.contains(f)) {
+            fields.add(f);
+        }
+    }
+    
+    private <T, V> void addToMap(Map<Class<?>, Map<T, V>> theFields,

+                               T f, V proxy) {
+        Map<T, V> proxies = theFields.get(serviceClass);
+        if (proxies == null) {
+            proxies = new HashMap<T, V>();
+            theFields.put(serviceClass, proxies);
+        }
+        if (!proxies.containsKey(f)) {
+            proxies.put(f, proxy);
+        }
+    }
+
+    private List<Field> getList(Map<Class<?>, List<Field>> fields)
{
+        List<Field> ret = fields == null ? null : fields.get(getServiceClass());
+        if (ret != null) {
+            ret = Collections.unmodifiableList(ret);
+        } else {
+            ret = Collections.emptyList();
+        }
+        return ret;
+    }
+    
+    private <T> ThreadLocalProxy getProxy(Map<Class<?>, Map<T, ThreadLocalProxy>>
proxies, T key) {
+        
+        Map<T, ThreadLocalProxy> theMap = proxies == null ? null : proxies.get(getServiceClass());
+        
+        return theMap != null ? theMap.get(key) : null;
+    }
 }

Modified: cxf/branches/2.1.x-fixes/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/model/ClassResourceInfoTest.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.1.x-fixes/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/model/ClassResourceInfoTest.java?rev=734128&r1=734127&r2=734128&view=diff
==============================================================================
--- cxf/branches/2.1.x-fixes/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/model/ClassResourceInfoTest.java
(original)
+++ cxf/branches/2.1.x-fixes/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/model/ClassResourceInfoTest.java
Tue Jan 13 05:40:57 2009
@@ -58,6 +58,11 @@
     private static class TestClass2 extends TestClass1 {
     }
     
+    private static class TestClass3 {
+        @Resource HttpServletRequest req;
+        @Resource HttpServletResponse res;
+        @Resource ServletContext c;
+    }
     
     @Test
     public void testGetHttpContexts() {
@@ -77,10 +82,10 @@
 
     @Test
     public void testGetResources() {
-        ClassResourceInfo c = new ClassResourceInfo(TestClass.class);
+        ClassResourceInfo c = new ClassResourceInfo(TestClass3.class);
         List<Field> fields = c.getResourceFields();
         assertEquals("Only root classes should check these fields", 0, fields.size());
-        c = new ClassResourceInfo(TestClass.class, true);
+        c = new ClassResourceInfo(TestClass3.class, true);
         fields = c.getResourceFields();
         
         Set<Class<?>> clses = new HashSet<Class<?>>(); 

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=734128&r1=734127&r2=734128&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
Tue Jan 13 05:40:57 2009
@@ -120,6 +120,23 @@
     }
     
     @Test
+    public void testSelectBetweenMultipleResourceClasses3() throws Exception {
+        JAXRSServiceFactoryBean sf = new JAXRSServiceFactoryBean();
+        sf.setResourceClasses(org.apache.cxf.jaxrs.resources.TestResourceTemplate4.class,
+                              org.apache.cxf.jaxrs.resources.TestResourceTemplate3.class);
+        sf.create();        
+        List<ClassResourceInfo> resources = ((JAXRSServiceImpl)sf.getService()).getClassResourceInfos();
+        MultivaluedMap<String, String> map = new MetadataMap<String, String>();
+        ClassResourceInfo bStore = JAXRSUtils.selectResourceClass(resources, "/", map);
+        assertEquals(bStore.getResourceClass(), org.apache.cxf.jaxrs.resources.TestResourceTemplate3.class);
+        
+        bStore = JAXRSUtils.selectResourceClass(resources, "/test", map);
+        assertEquals(bStore.getResourceClass(), 
+                     org.apache.cxf.jaxrs.resources.TestResourceTemplate4.class);
+        
+    }
+    
+    @Test
     public void testFindTargetResourceClass() throws Exception {
         JAXRSServiceFactoryBean sf = new JAXRSServiceFactoryBean();
         sf.setResourceClasses(org.apache.cxf.jaxrs.resources.BookStoreNoSubResource.class);

Modified: cxf/branches/2.1.x-fixes/systests/src/test/java/org/apache/cxf/systest/jaxrs/AtomBookStore.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.1.x-fixes/systests/src/test/java/org/apache/cxf/systest/jaxrs/AtomBookStore.java?rev=734128&r1=734127&r2=734128&view=diff
==============================================================================
--- cxf/branches/2.1.x-fixes/systests/src/test/java/org/apache/cxf/systest/jaxrs/AtomBookStore.java
(original)
+++ cxf/branches/2.1.x-fixes/systests/src/test/java/org/apache/cxf/systest/jaxrs/AtomBookStore.java
Tue Jan 13 05:40:57 2009
@@ -87,6 +87,10 @@
             throw new WebApplicationException();
         }
         
+        return doGetBookAsFeed(uParam);
+    }
+    
+    private Feed doGetBookAsFeed(@Context UriInfo uParam) {
         Factory factory = Abdera.getNewFactory();
         Feed f = factory.newFeed();
         f.setBaseUri(uParam.getAbsolutePath().toString());

Copied: cxf/branches/2.1.x-fixes/systests/src/test/java/org/apache/cxf/systest/jaxrs/AtomBookStore2.java
(from r729051, cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxrs/AtomBookStore2.java)
URL: http://svn.apache.org/viewvc/cxf/branches/2.1.x-fixes/systests/src/test/java/org/apache/cxf/systest/jaxrs/AtomBookStore2.java?p2=cxf/branches/2.1.x-fixes/systests/src/test/java/org/apache/cxf/systest/jaxrs/AtomBookStore2.java&p1=cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxrs/AtomBookStore2.java&r1=729051&r2=734128&rev=734128&view=diff
==============================================================================
--- cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxrs/AtomBookStore2.java (original)
+++ cxf/branches/2.1.x-fixes/systests/src/test/java/org/apache/cxf/systest/jaxrs/AtomBookStore2.java
Tue Jan 13 05:40:57 2009
@@ -23,7 +23,7 @@
 
 import javax.ws.rs.GET;
 import javax.ws.rs.Path;
-import javax.ws.rs.Produces;
+import javax.ws.rs.ProduceMime;
 import javax.ws.rs.core.Context;
 import javax.ws.rs.core.UriInfo;
 
@@ -34,7 +34,7 @@
     
     @GET
     @Path("/")
-    @Produces({"application/json", "application/atom+xml" })
+    @ProduceMime({"application/json", "application/atom+xml" })
     public Feed getBooksAsFeed(@Context UriInfo uParam) {
         
         return super.getBooksAsFeed(uParam);

Modified: cxf/branches/2.1.x-fixes/systests/src/test/java/org/apache/cxf/systest/jaxrs/AtomClientBookTest.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.1.x-fixes/systests/src/test/java/org/apache/cxf/systest/jaxrs/AtomClientBookTest.java?rev=734128&r1=734127&r2=734128&view=diff
==============================================================================
--- cxf/branches/2.1.x-fixes/systests/src/test/java/org/apache/cxf/systest/jaxrs/AtomClientBookTest.java
(original)
+++ cxf/branches/2.1.x-fixes/systests/src/test/java/org/apache/cxf/systest/jaxrs/AtomClientBookTest.java
Tue Jan 13 05:40:57 2009
@@ -122,6 +122,16 @@
         
     }
     
+    @Test
+    public void testGetBooks2() throws Exception {
+        String endpointAddress =
+            "http://localhost:9080"; 
+        Feed feed = getFeed(endpointAddress, null);
+        assertEquals("http://localhost:9080/", 
+                     feed.getBaseUri().toString());
+        assertEquals("Collection of Books", feed.getTitle());
+    }
+    
     private void getAndCompareJson(String address, 
                                    String resourcePath,
                                    String type) throws Exception {

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=734128&r1=734127&r2=734128&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
Tue Jan 13 05:40:57 2009
@@ -51,6 +51,14 @@
     }
     
     @Test
+    public void testGetBookByUriInfo2() throws Exception {
+        String endpointAddress =
+            "http://localhost:9080/the/thebooks3/bookstore/bookinfo?"
+                               + "param1=12&param2=3"; 
+        getBook(endpointAddress, "resources/expected_get_book123json.txt");
+    }
+    
+    @Test
     public void testGetBook123() throws Exception {
         String endpointAddress =
             "http://localhost:9080/the/bookstore/books/123"; 

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=734128&r1=734127&r2=734128&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 Tue Jan 13
05:40:57 2009
@@ -66,6 +66,18 @@
     
   </jaxrs:server>
 
+  <jaxrs:server id="bookservice3"
+		        address="/thebooks3/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>

Modified: cxf/branches/2.1.x-fixes/systests/src/test/resources/jaxrs_atom/WEB-INF/beans.xml
URL: http://svn.apache.org/viewvc/cxf/branches/2.1.x-fixes/systests/src/test/resources/jaxrs_atom/WEB-INF/beans.xml?rev=734128&r1=734127&r2=734128&view=diff
==============================================================================
--- cxf/branches/2.1.x-fixes/systests/src/test/resources/jaxrs_atom/WEB-INF/beans.xml (original)
+++ cxf/branches/2.1.x-fixes/systests/src/test/resources/jaxrs_atom/WEB-INF/beans.xml Tue
Jan 13 05:40:57 2009
@@ -42,6 +42,7 @@
 		        address="/">
     <jaxrs:serviceBeans>
       <ref bean="atomstore"/>
+      <ref bean="atomstore2"/>
     </jaxrs:serviceBeans>
     <jaxrs:providers>
         <bean class="org.apache.cxf.jaxrs.provider.AtomFeedProvider"/>
@@ -52,7 +53,7 @@
     </jaxrs:extensionMappings>		   
   </jaxrs:server>
   <bean id="atomstore" class="org.apache.cxf.systest.jaxrs.AtomBookStore"/>
-  
+  <bean id="atomstore2" class="org.apache.cxf.systest.jaxrs.AtomBookStore2"/>
 </beans>
 <!-- END SNIPPET: beans -->
 

Modified: cxf/branches/2.1.x-fixes/systests/src/test/resources/jaxrs_spring_providers/WEB-INF/beans.xml
URL: http://svn.apache.org/viewvc/cxf/branches/2.1.x-fixes/systests/src/test/resources/jaxrs_spring_providers/WEB-INF/beans.xml?rev=734128&r1=734127&r2=734128&view=diff
==============================================================================
--- cxf/branches/2.1.x-fixes/systests/src/test/resources/jaxrs_spring_providers/WEB-INF/beans.xml
(original)
+++ cxf/branches/2.1.x-fixes/systests/src/test/resources/jaxrs_spring_providers/WEB-INF/beans.xml
Tue Jan 13 05:40:57 2009
@@ -26,10 +26,6 @@
 http://cxf.apache.org/jaxrs
 http://cxf.apache.org/schemas/jaxrs.xsd">
 
-    <import resource="classpath:META-INF/cxf/cxf.xml" />
-    <import resource="classpath:META-INF/cxf/cxf-extension-jaxrs-binding.xml" />
-    <import resource="classpath:META-INF/cxf/cxf-servlet.xml" />
-
     <jaxrs:server id="bookservice"
                   address="/">
         <jaxrs:serviceBeans>

Modified: cxf/branches/2.1.x-fixes/systests/src/test/resources/jaxrs_spring_providers/WEB-INF/web.xml
URL: http://svn.apache.org/viewvc/cxf/branches/2.1.x-fixes/systests/src/test/resources/jaxrs_spring_providers/WEB-INF/web.xml?rev=734128&r1=734127&r2=734128&view=diff
==============================================================================
--- cxf/branches/2.1.x-fixes/systests/src/test/resources/jaxrs_spring_providers/WEB-INF/web.xml
(original)
+++ cxf/branches/2.1.x-fixes/systests/src/test/resources/jaxrs_spring_providers/WEB-INF/web.xml
Tue Jan 13 05:40:57 2009
@@ -24,16 +24,6 @@
 -->
 <!-- START SNIPPET: webxml -->
 <web-app>
-	<context-param>
-		<param-name>contextConfigLocation</param-name>
-		<param-value>WEB-INF/beans.xml</param-value>
-	</context-param>
-
-	<listener>
-		<listener-class>
-			org.springframework.web.context.ContextLoaderListener
-		</listener-class>
-	</listener>
 
 	<servlet>
 		<servlet-name>CXFServlet</servlet-name>
@@ -41,6 +31,10 @@
 		<servlet-class>
 			org.apache.cxf.transport.servlet.CXFServlet
 		</servlet-class>
+		<init-param>
+		      <param-name>config-location</param-name>
+		      <param-value>/WEB-INF/beans.xml</param-value>    
+		</init-param>
 		<load-on-startup>1</load-on-startup>
 	</servlet>
 



Mime
View raw message