cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject svn commit: r729051 - in /cxf/trunk: 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/test/java/org/apach...
Date Tue, 23 Dec 2008 18:16:08 GMT
Author: sergeyb
Date: Tue Dec 23 10:16:08 2008
New Revision: 729051

URL: http://svn.apache.org/viewvc?rev=729051&view=rev
Log:
JAXRS: making field/method/tlproxy resources static, updating system tests

Added:
    cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/resources/TestResourceTemplate3.java
  (with props)
    cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/resources/TestResourceTemplate4.java
  (with props)
    cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxrs/AtomBookStore2.java   (with
props)
Modified:
    cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/JAXRSInvoker.java
    cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/model/AbstractResourceInfo.java
    cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/model/ClassResourceInfoTest.java
    cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/utils/JAXRSUtilsTest.java
    cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxrs/AtomBookStore.java
    cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxrs/AtomClientBookTest.java
    cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerSpringBookTest.java
    cxf/trunk/systests/src/test/resources/jaxrs/WEB-INF/beans.xml
    cxf/trunk/systests/src/test/resources/jaxrs_atom/WEB-INF/beans.xml
    cxf/trunk/systests/src/test/resources/jaxrs_spring_providers/WEB-INF/beans.xml
    cxf/trunk/systests/src/test/resources/jaxrs_spring_providers/WEB-INF/web.xml

Modified: cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/JAXRSInvoker.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/JAXRSInvoker.java?rev=729051&r1=729050&r2=729051&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/JAXRSInvoker.java (original)
+++ cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/JAXRSInvoker.java Tue Dec
23 10:16:08 2008
@@ -204,6 +204,7 @@
             for (Object resourceObject : resources) {
                 if (c.isInstance(resourceObject)) {
                     serviceObject = resourceObject;
+                    break;
                 }
             }
         }

Modified: cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/model/AbstractResourceInfo.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/model/AbstractResourceInfo.java?rev=729051&r1=729050&r2=729051&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/model/AbstractResourceInfo.java
(original)
+++ cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/model/AbstractResourceInfo.java
Tue Dec 23 10:16:08 2008
@@ -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/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/model/ClassResourceInfoTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/model/ClassResourceInfoTest.java?rev=729051&r1=729050&r2=729051&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/model/ClassResourceInfoTest.java
(original)
+++ cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/model/ClassResourceInfoTest.java
Tue Dec 23 10:16:08 2008
@@ -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<?>>(); 

Added: cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/resources/TestResourceTemplate3.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/resources/TestResourceTemplate3.java?rev=729051&view=auto
==============================================================================
--- cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/resources/TestResourceTemplate3.java
(added)
+++ cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/resources/TestResourceTemplate3.java
Tue Dec 23 10:16:08 2008
@@ -0,0 +1,31 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.cxf.jaxrs.resources;
+
+import javax.ws.rs.GET;
+import javax.ws.rs.Path;
+
+@Path("/")
+public class TestResourceTemplate3 {
+    @GET
+    public String get() {
+        return null;
+    }
+}

Propchange: cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/resources/TestResourceTemplate3.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/resources/TestResourceTemplate3.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/resources/TestResourceTemplate4.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/resources/TestResourceTemplate4.java?rev=729051&view=auto
==============================================================================
--- cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/resources/TestResourceTemplate4.java
(added)
+++ cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/resources/TestResourceTemplate4.java
Tue Dec 23 10:16:08 2008
@@ -0,0 +1,31 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.cxf.jaxrs.resources;
+
+import javax.ws.rs.GET;
+import javax.ws.rs.Path;
+
+@Path("/test")
+public class TestResourceTemplate4 {
+    @GET
+    public String get() {
+        return null;
+    }
+}

Propchange: cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/resources/TestResourceTemplate4.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/resources/TestResourceTemplate4.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Modified: cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/utils/JAXRSUtilsTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/utils/JAXRSUtilsTest.java?rev=729051&r1=729050&r2=729051&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/utils/JAXRSUtilsTest.java
(original)
+++ cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/utils/JAXRSUtilsTest.java
Tue Dec 23 10:16:08 2008
@@ -122,6 +122,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/trunk/systests/src/test/java/org/apache/cxf/systest/jaxrs/AtomBookStore.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxrs/AtomBookStore.java?rev=729051&r1=729050&r2=729051&view=diff
==============================================================================
--- cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxrs/AtomBookStore.java (original)
+++ cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxrs/AtomBookStore.java Tue Dec
23 10:16:08 2008
@@ -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());

Added: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxrs/AtomBookStore2.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxrs/AtomBookStore2.java?rev=729051&view=auto
==============================================================================
--- cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxrs/AtomBookStore2.java (added)
+++ cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxrs/AtomBookStore2.java Tue
Dec 23 10:16:08 2008
@@ -0,0 +1,45 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+
+package org.apache.cxf.systest.jaxrs;
+
+
+import javax.ws.rs.GET;
+import javax.ws.rs.Path;
+import javax.ws.rs.Produces;
+import javax.ws.rs.core.Context;
+import javax.ws.rs.core.UriInfo;
+
+import org.apache.abdera.model.Feed;
+
+@Path("/")
+public class AtomBookStore2 extends AtomBookStore {
+    
+    @GET
+    @Path("/")
+    @Produces({"application/json", "application/atom+xml" })
+    public Feed getBooksAsFeed(@Context UriInfo uParam) {
+        
+        return super.getBooksAsFeed(uParam);
+        
+    }
+}
+
+

Propchange: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxrs/AtomBookStore2.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxrs/AtomBookStore2.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Modified: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxrs/AtomClientBookTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxrs/AtomClientBookTest.java?rev=729051&r1=729050&r2=729051&view=diff
==============================================================================
--- cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxrs/AtomClientBookTest.java
(original)
+++ cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxrs/AtomClientBookTest.java
Tue Dec 23 10:16:08 2008
@@ -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/trunk/systests/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerSpringBookTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerSpringBookTest.java?rev=729051&r1=729050&r2=729051&view=diff
==============================================================================
--- cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerSpringBookTest.java
(original)
+++ cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerSpringBookTest.java
Tue Dec 23 10:16:08 2008
@@ -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/trunk/systests/src/test/resources/jaxrs/WEB-INF/beans.xml
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/src/test/resources/jaxrs/WEB-INF/beans.xml?rev=729051&r1=729050&r2=729051&view=diff
==============================================================================
--- cxf/trunk/systests/src/test/resources/jaxrs/WEB-INF/beans.xml (original)
+++ cxf/trunk/systests/src/test/resources/jaxrs/WEB-INF/beans.xml Tue Dec 23 10:16:08 2008
@@ -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/trunk/systests/src/test/resources/jaxrs_atom/WEB-INF/beans.xml
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/src/test/resources/jaxrs_atom/WEB-INF/beans.xml?rev=729051&r1=729050&r2=729051&view=diff
==============================================================================
--- cxf/trunk/systests/src/test/resources/jaxrs_atom/WEB-INF/beans.xml (original)
+++ cxf/trunk/systests/src/test/resources/jaxrs_atom/WEB-INF/beans.xml Tue Dec 23 10:16:08
2008
@@ -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/trunk/systests/src/test/resources/jaxrs_spring_providers/WEB-INF/beans.xml
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/src/test/resources/jaxrs_spring_providers/WEB-INF/beans.xml?rev=729051&r1=729050&r2=729051&view=diff
==============================================================================
--- cxf/trunk/systests/src/test/resources/jaxrs_spring_providers/WEB-INF/beans.xml (original)
+++ cxf/trunk/systests/src/test/resources/jaxrs_spring_providers/WEB-INF/beans.xml Tue Dec
23 10:16:08 2008
@@ -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/trunk/systests/src/test/resources/jaxrs_spring_providers/WEB-INF/web.xml
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/src/test/resources/jaxrs_spring_providers/WEB-INF/web.xml?rev=729051&r1=729050&r2=729051&view=diff
==============================================================================
--- cxf/trunk/systests/src/test/resources/jaxrs_spring_providers/WEB-INF/web.xml (original)
+++ cxf/trunk/systests/src/test/resources/jaxrs_spring_providers/WEB-INF/web.xml Tue Dec 23
10:16:08 2008
@@ -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