You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by ni...@apache.org on 2009/05/31 14:33:54 UTC

svn commit: r780421 - in /cxf/trunk/rt/frontend/jaxrs: ./ src/main/java/org/apache/cxf/jaxrs/client/ src/main/java/org/apache/cxf/jaxrs/spring/ src/main/resources/schemas/ src/test/java/org/apache/cxf/jaxrs/resources/ src/test/java/org/apache/cxf/jaxrs...

Author: ningjiang
Date: Sun May 31 12:33:53 2009
New Revision: 780421

URL: http://svn.apache.org/viewvc?rev=780421&view=rev
Log:
CXF-2248 Added the unit tests for the spring configuration of JAXRSServerFactoryBean and JAXRSClientFactoryBean

Added:
    cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/resources/BookStoreNoAnnotations.java   (with props)
    cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/spring/
    cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/spring/JAXRSClientFactoryBeanTest.java   (with props)
    cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/spring/JAXRSServerFactoryBeanTest.java   (with props)
    cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/spring/clients.xml   (with props)
    cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/spring/resources.xml   (with props)
    cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/spring/servers.xml   (with props)
Modified:
    cxf/trunk/rt/frontend/jaxrs/pom.xml
    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/spring/JAXRSClientFactoryBeanDefinitionParser.java
    cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/spring/JAXRSServerFactoryBeanDefinitionParser.java
    cxf/trunk/rt/frontend/jaxrs/src/main/resources/schemas/jaxrs.xsd

Modified: cxf/trunk/rt/frontend/jaxrs/pom.xml
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxrs/pom.xml?rev=780421&r1=780420&r2=780421&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxrs/pom.xml (original)
+++ cxf/trunk/rt/frontend/jaxrs/pom.xml Sun May 31 12:33:53 2009
@@ -146,6 +146,12 @@
         </dependency>
         <dependency>
             <groupId>org.apache.cxf</groupId>
+            <artifactId>cxf-rt-transports-local</artifactId>
+            <version>${project.version}</version>
+            <scope>test</scope>
+        </dependency> 
+        <dependency>
+            <groupId>org.apache.cxf</groupId>
             <artifactId>cxf-rt-transports-http-jetty</artifactId>
             <version>${project.version}</version>
             <scope>test</scope>

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=780421&r1=780420&r2=780421&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 Sun May 31 12:33:53 2009
@@ -57,7 +57,7 @@
         return username;
     }
 
-    public void setUsername(String username) {
+    public void setUsername(String username) {        
         this.username = username;
     }
     
@@ -93,6 +93,10 @@
         }
     }
     
+    public Map getHeaders() {
+        return headers;
+    }
+    
     public WebClient createWebClient() {
         
         Service service = new JAXRSServiceImpl(getAddress());

Modified: cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/spring/JAXRSClientFactoryBeanDefinitionParser.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/spring/JAXRSClientFactoryBeanDefinitionParser.java?rev=780421&r1=780420&r2=780421&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/spring/JAXRSClientFactoryBeanDefinitionParser.java (original)
+++ cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/spring/JAXRSClientFactoryBeanDefinitionParser.java Sun May 31 12:33:53 2009
@@ -72,9 +72,7 @@
             Map map = ctx.getDelegate().parseMapElement(el, bean.getBeanDefinition());
             bean.addPropertyValue(name, map);
         } else if ("executor".equals(name)) {
-            setFirstChildAsProperty(el, ctx, bean, "serviceFactory.executor");
-        } else if ("invoker".equals(name)) {
-            setFirstChildAsProperty(el, ctx, bean, "serviceFactory.invoker");
+            setFirstChildAsProperty(el, ctx, bean, "serviceFactory.executor");         
         } else if ("binding".equals(name)) {
             setFirstChildAsProperty(el, ctx, bean, "bindingConfig");
         } else if ("inInterceptors".equals(name) || "inFaultInterceptors".equals(name)

Modified: cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/spring/JAXRSServerFactoryBeanDefinitionParser.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/spring/JAXRSServerFactoryBeanDefinitionParser.java?rev=780421&r1=780420&r2=780421&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/spring/JAXRSServerFactoryBeanDefinitionParser.java (original)
+++ cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/spring/JAXRSServerFactoryBeanDefinitionParser.java Sun May 31 12:33:53 2009
@@ -21,8 +21,6 @@
 import java.util.List;
 import java.util.Map;
 
-import javax.xml.namespace.QName;
-
 import org.w3c.dom.Element;
 
 import org.apache.cxf.Bus;
@@ -44,7 +42,6 @@
 
 
 
-
 public class JAXRSServerFactoryBeanDefinitionParser extends AbstractBeanDefinitionParser {
     
 
@@ -55,12 +52,7 @@
     
     @Override
     protected void mapAttribute(BeanDefinitionBuilder bean, Element e, String name, String val) {
-        if ("endpointName".equals(name) || "serviceName".equals(name)) {
-            QName q = parseQName(e, val);
-            bean.addPropertyValue(name, q);
-        } else {
-            mapToProperty(bean, name, val);
-        }
+        mapToProperty(bean, name, val);        
     }
 
     @Override

Modified: cxf/trunk/rt/frontend/jaxrs/src/main/resources/schemas/jaxrs.xsd
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxrs/src/main/resources/schemas/jaxrs.xsd?rev=780421&r1=780420&r2=780421&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxrs/src/main/resources/schemas/jaxrs.xsd (original)
+++ cxf/trunk/rt/frontend/jaxrs/src/main/resources/schemas/jaxrs.xsd Sun May 31 12:33:53 2009
@@ -36,6 +36,7 @@
           <xsd:all>
             <xsd:element name="executor" type="xsd:anyType" minOccurs="0"/>
             <xsd:element name="features" type="xsd:anyType" minOccurs="0"/>
+            <xsd:element name="binding" type="xsd:anyType" minOccurs="0" />  
             <xsd:element name="inInterceptors" type="xsd:anyType" minOccurs="0"/>
             <xsd:element name="inFaultInterceptors" type="xsd:anyType" minOccurs="0"/>
             <xsd:element name="invoker" type="xsd:anyType" minOccurs="0"/>
@@ -54,8 +55,10 @@
           <xsd:attribute name="address" type="xsd:string" />
           <xsd:attribute name="bus" type="xsd:string" />
           <xsd:attribute name="serviceClass" type="xsd:string"/>                    
+          <xsd:attribute name="transportId" type="xsd:string"/>
           <xsd:attribute name="modelRef" type="xsd:string" />
-          <xsd:attribute name="staticSubresourceResolution" type="xsd:boolean" />
+          <xsd:attribute name="bindingId" type="xsd:string" />          
+          <xsd:attribute name="staticSubresourceResolution" type="xsd:boolean" />          
         </xsd:extension>
       </xsd:complexContent>
     </xsd:complexType>
@@ -68,6 +71,7 @@
           <xsd:all>
             <xsd:element name="executor" type="xsd:anyType" minOccurs="0"/>
             <xsd:element name="features" type="xsd:anyType" minOccurs="0"/>
+            <xsd:element name="binding" type="xsd:anyType" minOccurs="0" />
             <xsd:element name="inInterceptors" type="xsd:anyType" minOccurs="0"/>
             <xsd:element name="inFaultInterceptors" type="xsd:anyType" minOccurs="0"/>
             <xsd:element name="outInterceptors" type="xsd:anyType" minOccurs="0"/>
@@ -84,6 +88,8 @@
           <xsd:attribute name="serviceClass" type="xsd:string"/>
           <xsd:attribute name="inheritHeaders" type="xsd:boolean"/>
           <xsd:attribute name="bus" type="xsd:string" />
+          <xsd:attribute name="transportId" type="xsd:string"/>
+          <xsd:attribute name="bindingId" type="xsd:string" />
           <xsd:attribute name="modelRef" type="xsd:string" />
           <xsd:attribute name="username" type="xsd:string"/>
           <xsd:attribute name="password" type="xsd:string"/>

Added: cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/resources/BookStoreNoAnnotations.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/resources/BookStoreNoAnnotations.java?rev=780421&view=auto
==============================================================================
--- cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/resources/BookStoreNoAnnotations.java (added)
+++ cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/resources/BookStoreNoAnnotations.java Sun May 31 12:33:53 2009
@@ -0,0 +1,41 @@
+/**
+ * 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 java.util.HashMap;
+import java.util.Map;
+
+
+public class BookStoreNoAnnotations {
+    
+    private Map<Long, Book> books = new HashMap<Long, Book>();
+    
+    public BookStoreNoAnnotations() {
+        Book b = new Book();
+        b.setId(123L);
+        b.setName("CXF in Action");
+        books.put(b.getId(), b);
+    }
+    
+    public Book getBook(Long id) {
+        return books.get(id);
+    }
+
+}

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

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

Added: cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/spring/JAXRSClientFactoryBeanTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/spring/JAXRSClientFactoryBeanTest.java?rev=780421&view=auto
==============================================================================
--- cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/spring/JAXRSClientFactoryBeanTest.java (added)
+++ cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/spring/JAXRSClientFactoryBeanTest.java Sun May 31 12:33:53 2009
@@ -0,0 +1,54 @@
+/**
+ * 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.spring;
+
+import junit.framework.Assert;
+import org.apache.cxf.BusFactory;
+import org.apache.cxf.jaxrs.client.JAXRSClientFactoryBean;
+import org.junit.After;
+import org.junit.Test;
+import org.springframework.context.support.ClassPathXmlApplicationContext;
+
+public class JAXRSClientFactoryBeanTest extends Assert {
+
+    @After
+    public void tearDown() throws Exception {
+        if (BusFactory.getDefaultBus(false) != null) {
+            BusFactory.getDefaultBus(false).shutdown(true);
+        }
+    }
+    
+    @Test
+    public void testClients() throws Exception {
+        ClassPathXmlApplicationContext ctx =
+            new ClassPathXmlApplicationContext(new String[] {"/org/apache/cxf/jaxrs/spring/clients.xml"});
+        
+        Object bean = ctx.getBean("client1.proxyFactory");
+        assertNotNull(bean);
+        
+        bean = ctx.getBean("setHeaderClient.proxyFactory");
+        assertNotNull(bean);
+        JAXRSClientFactoryBean cfb = (JAXRSClientFactoryBean) bean;
+        assertNotNull(cfb.getHeaders());
+        assertEquals("Get a wrong map size", cfb.getHeaders().size(), 1);
+        assertEquals("Get a wrong username", cfb.getUsername(), "username");
+        assertEquals("Get a wrong password", cfb.getPassword(), "password");
+    }
+
+}

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

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

Added: cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/spring/JAXRSServerFactoryBeanTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/spring/JAXRSServerFactoryBeanTest.java?rev=780421&view=auto
==============================================================================
--- cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/spring/JAXRSServerFactoryBeanTest.java (added)
+++ cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/spring/JAXRSServerFactoryBeanTest.java Sun May 31 12:33:53 2009
@@ -0,0 +1,66 @@
+/**
+ * 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.spring;
+import junit.framework.Assert;
+
+import org.apache.cxf.BusFactory;
+import org.apache.cxf.jaxrs.JAXRSServerFactoryBean;
+import org.apache.cxf.jaxrs.resources.BookStore;
+import org.apache.cxf.jaxrs.resources.BookStoreSubresourcesOnly;
+import org.junit.After;
+import org.junit.Test;
+import org.springframework.context.support.ClassPathXmlApplicationContext;
+
+
+public class JAXRSServerFactoryBeanTest extends Assert {
+
+    @After
+    public void tearDown() throws Exception {
+        if (BusFactory.getDefaultBus(false) != null) {
+            BusFactory.getDefaultBus(false).shutdown(true);
+        }
+    }
+    
+    @Test
+    public void testServers() throws Exception {
+        ClassPathXmlApplicationContext ctx =
+            new ClassPathXmlApplicationContext(new String[] {"/org/apache/cxf/jaxrs/spring/servers.xml"});
+        
+        JAXRSServerFactoryBean sfb = (JAXRSServerFactoryBean)ctx.getBean("simple");
+        assertEquals("Get a wrong address", "http://localhost:8080/rs", sfb.getAddress());
+        assertNotNull("The resource classes should not be null", sfb.getResourceClasses());
+        assertEquals("Get a wrong resource class", BookStore.class, sfb.getResourceClasses().get(0));
+        
+        sfb = (JAXRSServerFactoryBean)ctx.getBean("inlineServiceBeans");
+        assertNotNull("The resource classes should not be null", sfb.getResourceClasses());
+        assertEquals("Get a wrong resource class", BookStore.class, sfb.getResourceClasses().get(0));
+        assertEquals("Get a wrong resource class", 
+                     BookStoreSubresourcesOnly.class, sfb.getResourceClasses().get(1));
+        
+        sfb = (JAXRSServerFactoryBean)ctx.getBean("inlineProvider");
+        assertNotNull("The provider should not be null", sfb.getProviders());
+        assertEquals("Get a wrong provider size", sfb.getProviders().size(), 2);
+        
+        sfb = (JAXRSServerFactoryBean)ctx.getBean("moduleServer");
+        assertNotNull("The resource classes should not be null", sfb.getResourceClasses());
+        assertEquals("Get a wrong ResourceClasses size", 1, sfb.getResourceClasses().size());
+        
+        
+    }
+}

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

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

Added: cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/spring/clients.xml
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/spring/clients.xml?rev=780421&view=auto
==============================================================================
--- cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/spring/clients.xml (added)
+++ cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/spring/clients.xml Sun May 31 12:33:53 2009
@@ -0,0 +1,68 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  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.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+      xmlns:jaxrs="http://cxf.apache.org/jaxrs"
+      xmlns:soap="http://cxf.apache.org/bindings/soap"
+      xsi:schemaLocation="
+http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
+http://cxf.apache.org/bindings/soap http://cxf.apache.org/schemas/configuration/soap.xsd
+http://cxf.apache.org/jaxrs http://cxf.apache.org/schemas/jaxrs.xsd">
+     
+  <bean class="org.apache.cxf.transport.local.LocalTransportFactory" lazy-init="false">
+      <property name="transportIds">
+          <list>
+              <value>http://cxf.apache.org/transports/local</value>
+              <value>http://schemas.xmlsoap.org/soap/http</value>
+              <value>http://schemas.xmlsoap.org/wsdl/soap/http</value>
+          </list>
+      </property>
+  </bean>
+   
+  <jaxrs:client id="client1" 
+    serviceClass="org.apache.cxf.jaxrs.resources.BookStore"
+    address="http://localhost:9000/foo" >
+    <jaxrs:inInterceptors>
+	  <bean class="org.apache.cxf.interceptor.LoggingInInterceptor"/>	  
+	</jaxrs:inInterceptors>
+	<jaxrs:outInterceptors>
+	  <bean class="org.apache.cxf.interceptor.LoggingOutInterceptor"/>	  
+	</jaxrs:outInterceptors>
+    </jaxrs:client>
+   
+  <jaxrs:client id="setHeaderClient" 
+    serviceClass="org.apache.cxf.jaxrs.resources.BookStore"
+    address="http://localhost:8080/simpleWithAddress"
+    username="username"
+    password="password">
+    <jaxrs:headers>
+       <entry key="Accept" value="text/xml"/>
+    </jaxrs:headers>
+  </jaxrs:client>
+  
+  <!-- current JAXRSClient doesn't support the modelRef 
+  <jaxrs:client id="ModuleClient" 
+    serviceClass="org.apache.cxf.jaxrs.resources.BookStoreNoAnnotations"
+    modelRef="classpath:/org/apache/cxf/jaxrs/spring/resources.xml"
+    address="http://localhost:8080/simpleWithAddress">    
+  </jaxrs:client>
+  --> 
+   
+  </beans>

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

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

Propchange: cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/spring/clients.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/spring/resources.xml
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/spring/resources.xml?rev=780421&view=auto
==============================================================================
--- cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/spring/resources.xml (added)
+++ cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/spring/resources.xml Sun May 31 12:33:53 2009
@@ -0,0 +1,10 @@
+<model xmlns="http://cxf.apache.org/jaxrs">
+ <resource name="org.apache.cxf.jaxrs.resources.BookStore" path="bookstore">
+    <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>
+</model>
\ No newline at end of file

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

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

Propchange: cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/spring/resources.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/spring/servers.xml
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/spring/servers.xml?rev=780421&view=auto
==============================================================================
--- cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/spring/servers.xml (added)
+++ cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/spring/servers.xml Sun May 31 12:33:53 2009
@@ -0,0 +1,74 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  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.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+      xmlns:jaxrs="http://cxf.apache.org/jaxrs"     
+      xsi:schemaLocation="
+http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
+http://cxf.apache.org/bindings/soap http://cxf.apache.org/schemas/configuration/soap.xsd
+http://cxf.apache.org/jaxrs http://cxf.apache.org/schemas/jaxrs.xsd">
+
+
+  <bean class="org.apache.cxf.transport.local.LocalTransportFactory" lazy-init="false">
+      <property name="transportIds">
+          <list>
+              <value>http://cxf.apache.org/transports/local</value>
+              <value>http://schemas.xmlsoap.org/soap/http</value>
+              <value>http://schemas.xmlsoap.org/wsdl/soap/http</value>
+          </list>
+      </property>
+  </bean>
+  
+  <jaxrs:server id="simple" serviceClass="org.apache.cxf.jaxrs.resources.BookStore"         
+        address="http://localhost:8080/rs"/>
+  
+  <jaxrs:server id="inlineServiceBeans" address="http://localhost:8080/simpleWithAddress10">
+    <jaxrs:serviceBeans>
+      <bean class="org.apache.cxf.jaxrs.resources.BookStore"/>
+      <bean class="org.apache.cxf.jaxrs.resources.BookStoreSubresourcesOnly"/>      
+    </jaxrs:serviceBeans>
+  </jaxrs:server>
+  
+  <jaxrs:server id="inlineProvider"
+    serviceClass="org.apache.cxf.jaxrs.resources.BookStore"
+    address="http://localhost:8080/simpleWithAddress"
+    bus="cxf" staticSubresourceResolution="false">
+    <jaxrs:providers>
+        <ref bean="feed"/>
+        <ref bean="entry"/>
+    </jaxrs:providers>	
+    <jaxrs:extensionMappings>
+      <entry key="json" value="application/json"/>
+    </jaxrs:extensionMappings>    
+  </jaxrs:server>
+  
+  <bean id="feed" class="org.apache.cxf.jaxrs.provider.AtomFeedProvider"/>
+  <bean id="entry" class="org.apache.cxf.jaxrs.provider.AtomEntryProvider"/>
+  
+  <jaxrs:server id="moduleServer"
+    modelRef="classpath:/org/apache/cxf/jaxrs/spring/resources.xml"
+    address="http://localhost:8080/simpleWithAddress"
+    bus="cxf" >
+    <jaxrs:serviceBeans>
+       <bean class="org.apache.cxf.jaxrs.resources.BookStoreNoAnnotations"/>
+    </jaxrs:serviceBeans>        
+  </jaxrs:server>
+  
+</beans>

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

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

Propchange: cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/spring/servers.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml



Re: svn commit: r780421

Posted by Willem Jiang <wi...@gmail.com>.
Hi Sergey,

If you remove the comment and wrong the test of
JAXRSClientFactoryBeanTest, you will see the error :)
It looks like the resource checking can't find any resource info from
the setting.

Thanks,
Willem

Sergey Beryozkin wrote:
> Hi Willem
> 
> Thanks for this commit, just would like to clarify one thing about one
> of the comments in your test : 
> +  
> +  <!-- current JAXRSClient doesn't support the modelRef 
> +  <jaxrs:client id="ModuleClient" 
> +
> serviceClass="org.apache.cxf.jaxrs.resources.BookStoreNoAnnotations"
> +    modelRef="classpath:/org/apache/cxf/jaxrs/spring/resources.xml"
> +    address="http://localhost:8080/simpleWithAddress">    
> +  </jaxrs:client>
> +  --> 
> +   
> 
> I just checked the jaxrs.xsd, there's a @modelRef attribute in
> jaxrs:client.
> May be I just have misunderstood your comment ?
> 
> Thanks, Sergey 
> 
> 
> 


RE: svn commit: r780421

Posted by Sergey Beryozkin <sb...@progress.com>.
Hi Willem

Thanks for this commit, just would like to clarify one thing about one
of the comments in your test : 
+  
+  <!-- current JAXRSClient doesn't support the modelRef 
+  <jaxrs:client id="ModuleClient" 
+
serviceClass="org.apache.cxf.jaxrs.resources.BookStoreNoAnnotations"
+    modelRef="classpath:/org/apache/cxf/jaxrs/spring/resources.xml"
+    address="http://localhost:8080/simpleWithAddress">    
+  </jaxrs:client>
+  --> 
+   

I just checked the jaxrs.xsd, there's a @modelRef attribute in
jaxrs:client.
May be I just have misunderstood your comment ?

Thanks, Sergey