cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject svn commit: r786512 - in /cxf/trunk: rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/ rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/client/ rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/model/ rt/frontend/jaxrs/src/main/java/org/apac...
Date Fri, 19 Jun 2009 14:04:04 GMT
Author: sergeyb
Date: Fri Jun 19 14:04:04 2009
New Revision: 786512

URL: http://svn.apache.org/viewvc?rev=786512&view=rev
Log:
JAXRS : support for user model specifying interfaces only

Added:
    cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxrs/BookStoreNoAnnotationsImpl.java
  (with props)
    cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxrs/BookStoreNoAnnotationsInterface.java
  (with props)
    cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxrs/resources/resources2.xml
  (with props)
Modified:
    cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/AbstractJAXRSFactoryBean.java
    cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/JAXRSServerFactoryBean.java
    cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/JAXRSServiceFactoryBean.java
    cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/client/JAXRSClientFactoryBean.java
    cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/model/AbstractResourceInfo.java
    cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/model/ClassResourceInfo.java
    cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/model/MethodDispatcher.java
    cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/model/OperationResourceInfo.java
    cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/InjectionUtils.java
    cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/ResourceUtils.java
    cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerProxySpringBookTest.java
    cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerSpringBookTest.java
    cxf/trunk/systests/src/test/resources/jaxrs_proxy/WEB-INF/beans.xml

Modified: cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/AbstractJAXRSFactoryBean.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/AbstractJAXRSFactoryBean.java?rev=786512&r1=786511&r2=786512&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/AbstractJAXRSFactoryBean.java
(original)
+++ cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/AbstractJAXRSFactoryBean.java
Fri Jun 19 14:04:04 2009
@@ -20,6 +20,7 @@
 
 import java.util.Arrays;
 import java.util.Collections;
+import java.util.Iterator;
 import java.util.List;
 import java.util.ResourceBundle;
 import java.util.logging.Logger;
@@ -37,8 +38,10 @@
 import org.apache.cxf.endpoint.Endpoint;
 import org.apache.cxf.endpoint.EndpointException;
 import org.apache.cxf.endpoint.EndpointImpl;
+import org.apache.cxf.jaxrs.model.ClassResourceInfo;
 import org.apache.cxf.jaxrs.model.UserResource;
 import org.apache.cxf.jaxrs.provider.ProviderFactory;
+import org.apache.cxf.jaxrs.utils.InjectionUtils;
 import org.apache.cxf.jaxrs.utils.ResourceUtils;
 import org.apache.cxf.service.Service;
 import org.apache.cxf.service.model.BindingInfo;
@@ -204,8 +207,18 @@
         setProviders(Collections.singletonList(provider));
     }
 
-    protected void checkResources() {
-        if (!serviceFactory.resourcesAvailable()) {
+    protected void checkResources(boolean server) {
+        List<ClassResourceInfo> list = serviceFactory.getRealClassResourceInfo();
+        if (server) {
+            for (Iterator<ClassResourceInfo> it = list.iterator(); it.hasNext();) {
+                ClassResourceInfo cri = it.next();
+                if (cri.isCreatedFromModel() && cri.getServiceClass() == cri.getResourceClass()

+                    && !InjectionUtils.isConcreteClass(cri.getServiceClass())) {
+                    it.remove();
+                }
+            }
+        }
+        if (list.size() == 0) {
             org.apache.cxf.common.i18n.Message msg = 
                 new org.apache.cxf.common.i18n.Message("NO_RESOURCES_AVAILABLE", 
                                                        BUNDLE);

Modified: cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/JAXRSServerFactoryBean.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/JAXRSServerFactoryBean.java?rev=786512&r1=786511&r2=786512&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/JAXRSServerFactoryBean.java
(original)
+++ cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/JAXRSServerFactoryBean.java
Fri Jun 19 14:04:04 2009
@@ -74,7 +74,7 @@
     
     public Server create() {
         try {
-            checkResources();
+            checkResources(true);
             if (serviceFactory.getService() == null) {
                 serviceFactory.create();
                 updateClassResourceProviders();

Modified: cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/JAXRSServiceFactoryBean.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/JAXRSServiceFactoryBean.java?rev=786512&r1=786511&r2=786512&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/JAXRSServiceFactoryBean.java
(original)
+++ cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/JAXRSServiceFactoryBean.java
Fri Jun 19 14:04:04 2009
@@ -34,6 +34,7 @@
 import org.apache.cxf.jaxrs.model.ClassResourceInfo;
 import org.apache.cxf.jaxrs.model.UserResource;
 import org.apache.cxf.jaxrs.utils.AnnotationUtils;
+import org.apache.cxf.jaxrs.utils.InjectionUtils;
 import org.apache.cxf.jaxrs.utils.ResourceUtils;
 import org.apache.cxf.service.Service;
 import org.apache.cxf.service.factory.AbstractServiceFactoryBean;
@@ -61,10 +62,6 @@
         this.enableStatic = staticResolution;
     }
     
-    public boolean resourcesAvailable() {
-        return !classResourceInfos.isEmpty();
-    }
-    
     @Override
     public Service create() {
         initializeServiceModel();
@@ -115,6 +112,10 @@
         return Collections.unmodifiableList(classResourceInfos);
     }
     
+    List<ClassResourceInfo> getRealClassResourceInfo() {
+        return classResourceInfos;
+    }
+    
     public void setResourceClass(Class cls) {
         if (getCreatedFromModel(cls) == null) {
             classResourceInfos.clear();
@@ -164,7 +165,12 @@
             
             ClassResourceInfo cri = getCreatedFromModel(realClass);
             if (cri != null) {
+                if (!InjectionUtils.isConcreteClass(cri.getServiceClass())) {
+                    cri = new ClassResourceInfo(cri);
+                    classResourceInfos.add(cri);
+                }
                 cri.setResourceClass(bean.getClass());
+                cri.setResourceProvider(new SingletonResourceProvider(bean));
                 continue;
             }
             
@@ -179,7 +185,8 @@
     
     private ClassResourceInfo getCreatedFromModel(Class<?> realClass) {
         for (ClassResourceInfo cri : classResourceInfos) {
-            if (cri.isCreatedFromModel() && cri.getServiceClass() == realClass) {
+            if (cri.isCreatedFromModel() 
+                && cri.isRoot() && cri.getServiceClass().isAssignableFrom(realClass))
{
                 return cri;
             }
         }

Modified: cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/client/JAXRSClientFactoryBean.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/client/JAXRSClientFactoryBean.java?rev=786512&r1=786511&r2=786512&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/client/JAXRSClientFactoryBean.java
(original)
+++ cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/client/JAXRSClientFactoryBean.java
Fri Jun 19 14:04:04 2009
@@ -122,7 +122,7 @@
     }
     
     public Client createWithValues(Object... varValues) {
-        checkResources();
+        checkResources(false);
         
         try {
             Endpoint ep = createEndpoint();

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=786512&r1=786511&r2=786512&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
Fri Jun 19 14:04:04 2009
@@ -44,10 +44,13 @@
     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;
+    protected boolean root;
+    protected Class<?> resourceClass;
+    protected Class<?> serviceClass;
     
+    protected AbstractResourceInfo() {
+        
+    }
     
     protected AbstractResourceInfo(Class<?> resourceClass, Class<?> serviceClass,
boolean isRoot) {
         this.serviceClass = serviceClass;

Modified: cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/model/ClassResourceInfo.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/model/ClassResourceInfo.java?rev=786512&r1=786511&r2=786512&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/model/ClassResourceInfo.java
(original)
+++ cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/model/ClassResourceInfo.java
Fri Jun 19 14:04:04 2009
@@ -36,6 +36,7 @@
 
 import org.apache.cxf.jaxrs.lifecycle.ResourceProvider;
 import org.apache.cxf.jaxrs.utils.AnnotationUtils;
+import org.apache.cxf.jaxrs.utils.InjectionUtils;
 import org.apache.cxf.jaxrs.utils.ResourceUtils;
 
 public class ClassResourceInfo extends AbstractResourceInfo {
@@ -55,6 +56,23 @@
         this(theResourceClass, false);
     }
     
+    public ClassResourceInfo(ClassResourceInfo cri) {
+        
+        if (cri.isCreatedFromModel() && !InjectionUtils.isConcreteClass(cri.getServiceClass()))
{
+            this.root = cri.root;
+            this.serviceClass = cri.serviceClass;
+            this.uriTemplate = cri.uriTemplate;    
+            this.methodDispatcher = new MethodDispatcher(cri.methodDispatcher, this);
+            this.subResources = cri.subResources;
+            this.paramFields = cri.paramFields;
+            this.paramMethods = cri.paramMethods;
+            this.enableStatic = true;
+        } else {
+            throw new IllegalArgumentException();
+        }
+        
+    }
+    
     public ClassResourceInfo(Class<?> theResourceClass, boolean theRoot) {
         this(theResourceClass, theResourceClass, theRoot);
     }

Modified: cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/model/MethodDispatcher.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/model/MethodDispatcher.java?rev=786512&r1=786511&r2=786512&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/model/MethodDispatcher.java
(original)
+++ cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/model/MethodDispatcher.java
Fri Jun 19 14:04:04 2009
@@ -30,6 +30,18 @@
     private Map<Method, OperationResourceInfo> methodToOri = 
         new LinkedHashMap<Method, OperationResourceInfo>();
 
+    public MethodDispatcher() {
+        
+    }
+    
+    MethodDispatcher(MethodDispatcher md, ClassResourceInfo cri) {
+        for (OperationResourceInfo ori : md.getOperationResourceInfos()) {    
+            OperationResourceInfo clone = new OperationResourceInfo(ori, cri);
+            oriToMethod.put(clone, clone.getMethodToInvoke());
+            methodToOri.put(clone.getMethodToInvoke(), clone);
+        }
+    }
+    
     public void bind(OperationResourceInfo o, Method... methods) {
         Method primary = methods[0];
 

Modified: cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/model/OperationResourceInfo.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/model/OperationResourceInfo.java?rev=786512&r1=786511&r2=786512&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/model/OperationResourceInfo.java
(original)
+++ cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/model/OperationResourceInfo.java
Fri Jun 19 14:04:04 2009
@@ -48,6 +48,19 @@
         this(mInvoke, mInvoke, cri);
     }
     
+    OperationResourceInfo(OperationResourceInfo ori, ClassResourceInfo cri) {
+        this.uriTemplate = ori.uriTemplate;
+        this.methodToInvoke = ori.methodToInvoke;
+        this.annotatedMethod = ori.annotatedMethod;
+        this.httpMethod = ori.httpMethod;
+        this.produceMimes = ori.produceMimes;
+        this.consumeMimes = ori.consumeMimes;
+        this.encoded = ori.encoded;
+        this.defaultParamValue = ori.defaultParamValue;
+        this.parameters = ori.parameters;
+        this.classResourceInfo = cri;
+    }
+    
     public OperationResourceInfo(Method mInvoke, Method mAnnotated, ClassResourceInfo cri)
{
         methodToInvoke = mInvoke;
         annotatedMethod = mAnnotated;

Modified: cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/InjectionUtils.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/InjectionUtils.java?rev=786512&r1=786511&r2=786512&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/InjectionUtils.java
(original)
+++ cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/InjectionUtils.java
Fri Jun 19 14:04:04 2009
@@ -95,6 +95,10 @@
         
     }
 
+    public static boolean isConcreteClass(Class<?> cls) {
+        return !cls.isInterface() && !Modifier.isAbstract(cls.getModifiers());
+    }
+    
     public static Type getSuperType(Class<?> serviceClass, TypeVariable var) {
         
         int pos = 0;

Modified: cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/ResourceUtils.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/ResourceUtils.java?rev=786512&r1=786511&r2=786512&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/ResourceUtils.java
(original)
+++ cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/ResourceUtils.java
Fri Jun 19 14:04:04 2009
@@ -80,10 +80,12 @@
         }
         Class<?> sClass = loadClass(model.getName());
         ClassResourceInfo cri  = new ClassResourceInfo(sClass, sClass, isRoot, true, true);
-        try {
-            cri.setResourceProvider(new SingletonResourceProvider(sClass.newInstance()));
-        } catch (Exception ex) {
-            throw new RuntimeException("Resource class " + model.getName() + " can not be
created");
+        if (InjectionUtils.isConcreteClass(cri.getServiceClass())) {
+            try {
+                cri.setResourceProvider(new SingletonResourceProvider(sClass.newInstance()));
+            } catch (Exception ex) {
+                throw new RuntimeException("Resource class " + model.getName() + " can not
be created");
+            }
         }
         URITemplate t = URITemplate.createTemplate(model.getPath());
         cri.setURITemplate(t);

Added: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxrs/BookStoreNoAnnotationsImpl.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxrs/BookStoreNoAnnotationsImpl.java?rev=786512&view=auto
==============================================================================
--- cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxrs/BookStoreNoAnnotationsImpl.java
(added)
+++ cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxrs/BookStoreNoAnnotationsImpl.java
Fri Jun 19 14:04:04 2009
@@ -0,0 +1,50 @@
+/**
+ * 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 java.util.HashMap;
+import java.util.Map;
+
+public class BookStoreNoAnnotationsImpl implements BookStoreNoAnnotationsInterface {
+
+    private Map<Long, Book> books = new HashMap<Long, Book>();
+    
+    public BookStoreNoAnnotationsImpl() {
+        Book b = new Book();
+        b.setId(123L);
+        b.setName("CXF in Action");
+        books.put(b.getId(), b);
+    }
+    
+    public Book getBook(Long id) throws BookNotFoundFault {
+        return books.get(id);
+    }
+    
+    public ChapterNoAnnotations getBookChapter(Long id) throws BookNotFoundFault {
+        Book b = books.get(id);
+        Chapter ch = b.getChapter(1);
+        
+        ChapterNoAnnotations ch2 = new ChapterNoAnnotations();
+        ch2.setId(ch.getId());
+        ch2.setTitle(ch.getTitle());
+        return ch2;
+    }
+    
+}

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

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

Added: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxrs/BookStoreNoAnnotationsInterface.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxrs/BookStoreNoAnnotationsInterface.java?rev=786512&view=auto
==============================================================================
--- cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxrs/BookStoreNoAnnotationsInterface.java
(added)
+++ cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxrs/BookStoreNoAnnotationsInterface.java
Fri Jun 19 14:04:04 2009
@@ -0,0 +1,29 @@
+/**
+ * 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;
+
+
+public interface BookStoreNoAnnotationsInterface {
+
+    Book getBook(Long id) throws BookNotFoundFault;
+    
+    ChapterNoAnnotations getBookChapter(Long id) throws BookNotFoundFault;
+    
+}

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

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

Modified: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerProxySpringBookTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerProxySpringBookTest.java?rev=786512&r1=786511&r2=786512&view=diff
==============================================================================
--- cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerProxySpringBookTest.java
(original)
+++ cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerProxySpringBookTest.java
Fri Jun 19 14:04:04 2009
@@ -44,12 +44,18 @@
     
     @Test
     public void testGetThatBook123UserResource() throws Exception {
-        getBook("http://localhost:9080/test/bookstore/books/123");
+        getBook("http://localhost:9080/test/2/bookstore/books/123");
+    }
+    
+    @Test
+    public void testGetThatBook123UserResourceInterface() throws Exception {
+        getBook("http://localhost:9080/test/3/bookstore2/books/123");
     }
     
     private void getBook(String endpointAddress) throws Exception {
         URL url = new URL(endpointAddress);
         URLConnection connect = url.openConnection();
+        connect.addRequestProperty("Content-Type", "*/*");
         connect.addRequestProperty("Accept", "application/xml");
         InputStream in = connect.getInputStream();           
 

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=786512&r1=786511&r2=786512&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
Fri Jun 19 14:04:04 2009
@@ -49,7 +49,7 @@
     @BeforeClass
     public static void startServers() throws Exception {
         assertTrue("server did not launch correctly", 
-                   launchServer(BookServerSpring.class, true));
+                   launchServer(BookServerSpring.class));
     }
     
     @Test
@@ -124,6 +124,7 @@
     private void getBook(String endpointAddress, String resource, String type) throws Exception
{
         URL url = new URL(endpointAddress);
         URLConnection connect = url.openConnection();
+        connect.addRequestProperty("Content-Type", "*/*");
         connect.addRequestProperty("Accept", type);
         InputStream in = connect.getInputStream();           
 

Added: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxrs/resources/resources2.xml
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxrs/resources/resources2.xml?rev=786512&view=auto
==============================================================================
--- cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxrs/resources/resources2.xml
(added)
+++ cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxrs/resources/resources2.xml
Fri Jun 19 14:04:04 2009
@@ -0,0 +1,13 @@
+<model xmlns="http://cxf.apache.org/jaxrs">
+ <resource name="org.apache.cxf.systest.jaxrs.BookStoreNoAnnotationsInterface" path="bookstore2">
+    <operation name="getBook" verb="GET" path="/books/{id}">
+       <param name="id" type="PATH"/>
+    </operation>
+    <operation name="getBookChapter" path="/books/{id}/chapter">
+        <param name="id" type="PATH"/>
+    </operation> 
+ </resource>
+ <resource name="org.apache.cxf.systest.jaxrs.ChapterNoAnnotations">
+    <operation name="getItself" verb="GET"/>
+ </resource>
+</model>
\ No newline at end of file

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

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

Propchange: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxrs/resources/resources2.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Modified: cxf/trunk/systests/src/test/resources/jaxrs_proxy/WEB-INF/beans.xml
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/src/test/resources/jaxrs_proxy/WEB-INF/beans.xml?rev=786512&r1=786511&r2=786512&view=diff
==============================================================================
--- cxf/trunk/systests/src/test/resources/jaxrs_proxy/WEB-INF/beans.xml (original)
+++ cxf/trunk/systests/src/test/resources/jaxrs_proxy/WEB-INF/beans.xml Fri Jun 19 14:04:04
2009
@@ -58,6 +58,15 @@
   </jaxrs:server>
   <bean id="bookstore2" class="org.apache.cxf.systest.jaxrs.BookStoreNoAnnotations"/>
   
+  
+  <jaxrs:server id="bookservice3" address="/3"
+    modelRef="classpath:/org/apache/cxf/systest/jaxrs/resources/resources2.xml">
+    <jaxrs:serviceBeans>
+      <ref bean="bookstore3"/>
+    </jaxrs:serviceBeans>		   
+  </jaxrs:server>
+  <bean id="bookstore3" class="org.apache.cxf.systest.jaxrs.BookStoreNoAnnotationsImpl"/>
+  
   <aop:config>
 		<aop:aspect id="loggingAspect" ref="simpleLogger">
 			<aop:before



Mime
View raw message