cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r1026391 - in /cxf/branches/2.2.x-fixes: ./ rt/core/src/main/java/org/apache/cxf/interceptor/ rt/transports/http/src/main/java/org/apache/cxf/transport/servlet/ systests/transports/src/test/java/org/apache/cxf/systest/servlet/
Date Fri, 22 Oct 2010 16:13:48 GMT
Author: dkulp
Date: Fri Oct 22 16:13:47 2010
New Revision: 1026391

URL: http://svn.apache.org/viewvc?rev=1026391&view=rev
Log:
Merged revisions 1026352 via svnmerge from 
https://svn.apache.org/repos/asf/cxf/branches/2.3.x-fixes

................
  r1026352 | dkulp | 2010-10-22 10:54:31 -0400 (Fri, 22 Oct 2010) | 10 lines
  
  Merged revisions 1026341 via svnmerge from 
  https://svn.apache.org/repos/asf/cxf/trunk
  
  ........
    r1026341 | dkulp | 2010-10-22 10:32:21 -0400 (Fri, 22 Oct 2010) | 2 lines
    
    [CXF-3082] Make EndpointImpl.publish() work correctly without throwing
    the NPE on the get of the service list and wsdl
  ........
................

Modified:
    cxf/branches/2.2.x-fixes/   (props changed)
    cxf/branches/2.2.x-fixes/rt/core/src/main/java/org/apache/cxf/interceptor/URIMappingInterceptor.java
    cxf/branches/2.2.x-fixes/rt/transports/http/src/main/java/org/apache/cxf/transport/servlet/ServletController.java
    cxf/branches/2.2.x-fixes/rt/transports/http/src/main/java/org/apache/cxf/transport/servlet/ServletDestination.java
    cxf/branches/2.2.x-fixes/systests/transports/src/test/java/org/apache/cxf/systest/servlet/NoSpringServletClientTest.java
    cxf/branches/2.2.x-fixes/systests/transports/src/test/java/org/apache/cxf/systest/servlet/NoSpringServletServer.java

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

Modified: cxf/branches/2.2.x-fixes/rt/core/src/main/java/org/apache/cxf/interceptor/URIMappingInterceptor.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/rt/core/src/main/java/org/apache/cxf/interceptor/URIMappingInterceptor.java?rev=1026391&r1=1026390&r2=1026391&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/rt/core/src/main/java/org/apache/cxf/interceptor/URIMappingInterceptor.java
(original)
+++ cxf/branches/2.2.x-fixes/rt/core/src/main/java/org/apache/cxf/interceptor/URIMappingInterceptor.java
Fri Oct 22 16:13:47 2010
@@ -337,13 +337,12 @@ public class URIMappingInterceptor exten
         return queries;
     }
     
-    private String getBasePath(Message message) {
-        return (String)message.get(Message.BASE_PATH);        
-    }
-    
     private String getRest(Message message) {
         String path = (String)message.get(Message.PATH_INFO);
-        String basePath = getBasePath(message);        
+        String basePath = (String)message.get(Message.BASE_PATH);
+        if (basePath == null) {
+            basePath = "/";
+        }
         return StringUtils.diff(path, basePath);        
     }
     

Modified: cxf/branches/2.2.x-fixes/rt/transports/http/src/main/java/org/apache/cxf/transport/servlet/ServletController.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/rt/transports/http/src/main/java/org/apache/cxf/transport/servlet/ServletController.java?rev=1026391&r1=1026390&r2=1026391&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/rt/transports/http/src/main/java/org/apache/cxf/transport/servlet/ServletController.java
(original)
+++ cxf/branches/2.2.x-fixes/rt/transports/http/src/main/java/org/apache/cxf/transport/servlet/ServletController.java
Fri Oct 22 16:13:47 2010
@@ -91,6 +91,9 @@ public class ServletController extends A
                 && d2.getAddress() != null
                 && d2.getAddress().getAddress() != null) {
                 ad = d2.getAddress().getAddress().getValue();
+                if (ad == null) {
+                    ad = "/";
+                }
             }
             if (ad != null 
                 && (ad.equals(path)

Modified: cxf/branches/2.2.x-fixes/rt/transports/http/src/main/java/org/apache/cxf/transport/servlet/ServletDestination.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/rt/transports/http/src/main/java/org/apache/cxf/transport/servlet/ServletDestination.java?rev=1026391&r1=1026390&r2=1026391&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/rt/transports/http/src/main/java/org/apache/cxf/transport/servlet/ServletDestination.java
(original)
+++ cxf/branches/2.2.x-fixes/rt/transports/http/src/main/java/org/apache/cxf/transport/servlet/ServletDestination.java
Fri Oct 22 16:13:47 2010
@@ -102,6 +102,9 @@ public class ServletDestination extends 
     protected String getBasePath(String contextPath) throws IOException {
         
         String address = getAddress().getAddress().getValue();
+        if (address == null) {
+            return contextPath;
+        }
         if (address.startsWith("http")) {
             return URI.create(address).getPath();
         }

Modified: cxf/branches/2.2.x-fixes/systests/transports/src/test/java/org/apache/cxf/systest/servlet/NoSpringServletClientTest.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/systests/transports/src/test/java/org/apache/cxf/systest/servlet/NoSpringServletClientTest.java?rev=1026391&r1=1026390&r2=1026391&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/systests/transports/src/test/java/org/apache/cxf/systest/servlet/NoSpringServletClientTest.java
(original)
+++ cxf/branches/2.2.x-fixes/systests/transports/src/test/java/org/apache/cxf/systest/servlet/NoSpringServletClientTest.java
Fri Oct 22 16:13:47 2010
@@ -20,6 +20,9 @@ package org.apache.cxf.systest.servlet;
 
 import java.lang.reflect.UndeclaredThrowableException;
 import java.net.URL;
+import java.util.HashSet;
+import java.util.Set;
+
 import javax.xml.namespace.QName;
 
 import com.meterware.httpunit.WebConversation;
@@ -75,10 +78,16 @@ public class NoSpringServletClientTest e
     @Test
     public void testGetServiceList() throws Exception {
         WebConversation client = new WebConversation();
-        WebResponse res = client.getResponse(serviceURL);
+        WebResponse res = client.getResponse(serviceURL + "/services");
         WebLink[] links = res.getLinks();
-        assertEquals("There should get two links for the service", 2, links.length);
-        assertEquals(serviceURL + "Greeter?wsdl", links[0].getURLString());
+        Set<String> s = new HashSet<String>();
+        for (WebLink l : links) {
+            s.add(l.getURLString());
+        }
+        assertEquals("There should be 3 links for the service", 3, links.length);
+        assertTrue(s.contains(serviceURL + "Greeter?wsdl"));
+        assertTrue(s.contains(serviceURL + "Hello?wsdl"));
+        assertTrue(s.contains(serviceURL + "?wsdl"));
         assertEquals("text/html", res.getContentType());
     }
 }

Modified: cxf/branches/2.2.x-fixes/systests/transports/src/test/java/org/apache/cxf/systest/servlet/NoSpringServletServer.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/systests/transports/src/test/java/org/apache/cxf/systest/servlet/NoSpringServletServer.java?rev=1026391&r1=1026390&r2=1026391&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/systests/transports/src/test/java/org/apache/cxf/systest/servlet/NoSpringServletServer.java
(original)
+++ cxf/branches/2.2.x-fixes/systests/transports/src/test/java/org/apache/cxf/systest/servlet/NoSpringServletServer.java
Fri Oct 22 16:13:47 2010
@@ -22,6 +22,7 @@ import javax.xml.ws.Endpoint;
 
 import org.apache.cxf.Bus;
 import org.apache.cxf.BusFactory;
+import org.apache.cxf.jaxws.EndpointImpl;
 import org.apache.cxf.testutil.common.AbstractBusTestServerBase;
 import org.apache.cxf.transport.servlet.CXFNonSpringServlet;
 import org.apache.hello_world_soap_http.GreeterImpl;
@@ -62,6 +63,8 @@ public class NoSpringServletServer exten
             Endpoint.publish("/Greeter", impl);
             HelloImpl helloImpl = new HelloImpl();
             Endpoint.publish("/Hello", helloImpl);
+            
+            ((EndpointImpl)Endpoint.create(helloImpl)).publish();
 
         } catch (Exception e) {
             throw new RuntimeException(e);



Mime
View raw message