cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject svn commit: r1039046 - in /cxf/branches/2.3.x-fixes: ./ rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/interceptor/ systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/ systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/jaxws/ systes...
Date Thu, 25 Nov 2010 13:59:49 GMT
Author: sergeyb
Date: Thu Nov 25 13:59:48 2010
New Revision: 1039046

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

........
  r1039039 | sergeyb | 2010-11-25 13:48:32 +0000 (Thu, 25 Nov 2010) | 1 line
  
  Adapting a java_first_jaxws demo to a jaxrs system test with moving soap related tests to
the subpackage
........

Added:
    cxf/branches/2.3.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/jaxws/
      - copied from r1039039, cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/jaxws/
    cxf/branches/2.3.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/jaxws/BookSoapService.java
      - copied unchanged from r1039039, cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/jaxws/BookSoapService.java
    cxf/branches/2.3.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/jaxws/BookStoreJaxrs.java
      - copied unchanged from r1039039, cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/jaxws/BookStoreJaxrs.java
    cxf/branches/2.3.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/jaxws/BookStoreJaxrsJaxws.java
      - copied unchanged from r1039039, cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/jaxws/BookStoreJaxrsJaxws.java
    cxf/branches/2.3.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/jaxws/BookStoreJaxws.java
      - copied unchanged from r1039039, cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/jaxws/BookStoreJaxws.java
    cxf/branches/2.3.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/jaxws/BookStoreSoapRestImpl.java
      - copied unchanged from r1039039, cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/jaxws/BookStoreSoapRestImpl.java
    cxf/branches/2.3.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/jaxws/BookStoreSoapRestImpl2.java
      - copied unchanged from r1039039, cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/jaxws/BookStoreSoapRestImpl2.java
    cxf/branches/2.3.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/jaxws/HelloWorld.java
      - copied unchanged from r1039039, cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/jaxws/HelloWorld.java
    cxf/branches/2.3.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/jaxws/HelloWorldImpl.java
      - copied unchanged from r1039039, cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/jaxws/HelloWorldImpl.java
    cxf/branches/2.3.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/jaxws/IntegerUserMap.java
      - copied unchanged from r1039039, cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/jaxws/IntegerUserMap.java
    cxf/branches/2.3.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/jaxws/IntegerUserMapAdapter.java
      - copied unchanged from r1039039, cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/jaxws/IntegerUserMapAdapter.java
    cxf/branches/2.3.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/jaxws/User.java
      - copied unchanged from r1039039, cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/jaxws/User.java
    cxf/branches/2.3.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/jaxws/UserAdapter.java
      - copied unchanged from r1039039, cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/jaxws/UserAdapter.java
    cxf/branches/2.3.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/jaxws/UserImpl.java
      - copied unchanged from r1039039, cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/jaxws/UserImpl.java
Removed:
    cxf/branches/2.3.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookSoapService.java
    cxf/branches/2.3.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookStoreJaxrs.java
    cxf/branches/2.3.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookStoreJaxrsJaxws.java
    cxf/branches/2.3.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookStoreJaxws.java
    cxf/branches/2.3.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookStoreSoapRestImpl.java
    cxf/branches/2.3.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookStoreSoapRestImpl2.java
Modified:
    cxf/branches/2.3.x-fixes/   (props changed)
    cxf/branches/2.3.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/interceptor/JAXRSOutInterceptor.java
    cxf/branches/2.3.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookApplication.java
    cxf/branches/2.3.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSSoapBookTest.java
    cxf/branches/2.3.x-fixes/systests/jaxrs/src/test/resources/jaxrs_soap_rest/WEB-INF/beans.xml

Propchange: cxf/branches/2.3.x-fixes/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Nov 25 13:59:48 2010
@@ -1 +1 @@
-/cxf/trunk:1038206,1038374,1038386,1038722,1038746
+/cxf/trunk:1038206,1038374,1038386,1038722,1038746,1039039

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

Modified: cxf/branches/2.3.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/interceptor/JAXRSOutInterceptor.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.3.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/interceptor/JAXRSOutInterceptor.java?rev=1039046&r1=1039045&r2=1039046&view=diff
==============================================================================
--- cxf/branches/2.3.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/interceptor/JAXRSOutInterceptor.java
(original)
+++ cxf/branches/2.3.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/interceptor/JAXRSOutInterceptor.java
Thu Nov 25 13:59:48 2010
@@ -195,7 +195,8 @@ public class JAXRSOutInterceptor extends
         
         Method invoked = null;
         if (firstTry) {
-            invoked = ori == null ? null : ori.getMethodToInvoke();
+            invoked = ori == null ? null : ori.getAnnotatedMethod() == null
+                ? ori.getMethodToInvoke() : ori.getAnnotatedMethod();
         }
         Class<?> targetType = getRawResponseClass(responseObj);
         Type genericType = 

Modified: cxf/branches/2.3.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookApplication.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.3.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookApplication.java?rev=1039046&r1=1039045&r2=1039046&view=diff
==============================================================================
--- cxf/branches/2.3.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookApplication.java
(original)
+++ cxf/branches/2.3.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookApplication.java
Thu Nov 25 13:59:48 2010
@@ -29,7 +29,7 @@ public class BookApplication extends App
     public Set<Class<?>> getClasses() {
         Set<Class<?>> classes = new HashSet<Class<?>>();
         classes.add(org.apache.cxf.systest.jaxrs.BookStorePerRequest.class);
-        classes.add(org.apache.cxf.systest.jaxrs.BookStoreJaxrsJaxws.class);
+        classes.add(org.apache.cxf.systest.jaxrs.jaxws.BookStoreJaxrsJaxws.class);
         return classes;
     }
 

Modified: cxf/branches/2.3.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSSoapBookTest.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.3.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSSoapBookTest.java?rev=1039046&r1=1039045&r2=1039046&view=diff
==============================================================================
--- cxf/branches/2.3.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSSoapBookTest.java
(original)
+++ cxf/branches/2.3.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSSoapBookTest.java
Thu Nov 25 13:59:48 2010
@@ -37,6 +37,8 @@ import javax.ws.rs.core.Response;
 import javax.xml.bind.JAXBContext;
 import javax.xml.bind.Unmarshaller;
 import javax.xml.namespace.QName;
+import javax.xml.ws.Service;
+import javax.xml.ws.soap.SOAPBinding;
 
 import org.apache.commons.httpclient.HttpClient;
 import org.apache.commons.httpclient.methods.FileRequestEntity;
@@ -61,6 +63,11 @@ import org.apache.cxf.jaxrs.provider.JAX
 import org.apache.cxf.message.Message;
 import org.apache.cxf.phase.AbstractPhaseInterceptor;
 import org.apache.cxf.phase.Phase;
+import org.apache.cxf.systest.jaxrs.jaxws.BookSoapService;
+import org.apache.cxf.systest.jaxrs.jaxws.BookStoreJaxrsJaxws;
+import org.apache.cxf.systest.jaxrs.jaxws.HelloWorld;
+import org.apache.cxf.systest.jaxrs.jaxws.User;
+import org.apache.cxf.systest.jaxrs.jaxws.UserImpl;
 import org.apache.cxf.testutil.common.AbstractBusClientServerTestBase;
 import org.apache.cxf.transport.http.HTTPConduit;
 
@@ -78,6 +85,41 @@ public class JAXRSSoapBookTest extends A
     }
     
     @Test
+    public void testHelloRest() throws Exception {
+        String address = "http://localhost:" + PORT + "/test/services/hello-rest";
+        
+        HelloWorld service = JAXRSClientFactory.create(address, HelloWorld.class);
+        useHelloService(service);
+    }
+    
+    @Test
+    public void testHelloSoap() throws Exception {
+        final QName serviceName = new QName("http://hello.com", "HelloWorld");
+        final QName portName = new QName("http://hello.com", "HelloWorldPort");
+        final String address = "http://localhost:" + PORT + "/test/services/hello-soap";
+        
+        Service service = Service.create(serviceName);
+        service.addPort(portName, SOAPBinding.SOAP11HTTP_BINDING, address);
+    
+        HelloWorld hw = service.getPort(HelloWorld.class); 
+    
+        useHelloService(hw);
+    }
+    
+    private void useHelloService(HelloWorld service) {
+        assertEquals("Hello Barry", service.sayHi("Barry"));
+        assertEquals("Hello Fred", service.sayHiToUser(new UserImpl("Fred")));
+        
+        Map<Integer, User> users = service.getUsers();
+        assertEquals(1, users.size());
+        assertEquals("Fred", users.entrySet().iterator().next().getValue().getName());
+        
+        users = service.echoUsers(users);
+        assertEquals(1, users.size());
+        assertEquals("Fred", users.entrySet().iterator().next().getValue().getName());
+    }
+    
+    @Test
     public void testGetAll() throws Exception {
         
         InputStream in = getHttpInputStream("http://localhost:" + PORT 

Modified: cxf/branches/2.3.x-fixes/systests/jaxrs/src/test/resources/jaxrs_soap_rest/WEB-INF/beans.xml
URL: http://svn.apache.org/viewvc/cxf/branches/2.3.x-fixes/systests/jaxrs/src/test/resources/jaxrs_soap_rest/WEB-INF/beans.xml?rev=1039046&r1=1039045&r2=1039046&view=diff
==============================================================================
--- cxf/branches/2.3.x-fixes/systests/jaxrs/src/test/resources/jaxrs_soap_rest/WEB-INF/beans.xml
(original)
+++ cxf/branches/2.3.x-fixes/systests/jaxrs/src/test/resources/jaxrs_soap_rest/WEB-INF/beans.xml
Thu Nov 25 13:59:48 2010
@@ -47,14 +47,14 @@ http://cxf.apache.org/schemas/jaxrs.xsd"
 
   <jaxrs:client id="restClient"
          address="http://localhost:${testutil.ports.BookServerRestSoap}/test/services/rest"
-         serviceClass="org.apache.cxf.systest.jaxrs.BookStoreJaxrsJaxws"
+         serviceClass="org.apache.cxf.systest.jaxrs.jaxws.BookStoreJaxrsJaxws"
          inheritHeaders="true">
          <jaxrs:headers>
              <entry key="Accept" value="text/xml"/>
          </jaxrs:headers>
   </jaxrs:client>       
          
-  <bean id="bookstore" class="org.apache.cxf.systest.jaxrs.BookStoreSoapRestImpl"/>
+  <bean id="bookstore" class="org.apache.cxf.systest.jaxrs.jaxws.BookStoreSoapRestImpl"/>
 
   <jaxws:endpoint xmlns:s="http://books.com"
       serviceName="s:BookService"
@@ -70,6 +70,19 @@ http://cxf.apache.org/schemas/jaxrs.xsd"
     </jaxrs:serviceBeans>		   
   </jaxrs:server>
 
+  <jaxrs:server id="hello_rest" address="/hello-rest">
+    <jaxrs:serviceBeans>
+      <bean class="org.apache.cxf.systest.jaxrs.jaxws.HelloWorldImpl"/>
+    </jaxrs:serviceBeans>		   
+  </jaxrs:server>
+
+  <jaxws:endpoint xmlns:s="http://hello.com"
+      serviceName="s:HelloWorld"
+      endpointName="s:HelloWorldPort"
+      id="hello_soap"
+      implementor="org.apache.cxf.systest.jaxrs.jaxws.HelloWorldImpl"
+      address="/hello-soap"/>
+
   <jaxws:endpoint xmlns:s="http://books.com"
       serviceName="s:BookService"
       endpointName="s:BookPort"
@@ -87,7 +100,7 @@ http://cxf.apache.org/schemas/jaxrs.xsd"
       <ref bean="bookstore2"/>
     </jaxrs:serviceBeans>		   
   </jaxrs:server>
-  <bean id="bookstore2" class="org.apache.cxf.systest.jaxrs.BookStoreSoapRestImpl2"/>
+  <bean id="bookstore2" class="org.apache.cxf.systest.jaxrs.jaxws.BookStoreSoapRestImpl2"/>
 
   <util:list id="fastinfosetType">
     <value>application/fastinfoset</value>



Mime
View raw message