cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r1163375 - in /cxf/trunk: rt/transports/http/src/main/java/org/apache/cxf/transport/servlet/servicelist/ systests/transports/src/test/java/org/apache/cxf/systest/servlet/
Date Tue, 30 Aug 2011 20:56:48 GMT
Author: dkulp
Date: Tue Aug 30 20:56:48 2011
New Revision: 1163375

URL: http://svn.apache.org/viewvc?rev=1163375&view=rev
Log:
[CXF-2774] Use the endpointPublishUrl in the service list

Modified:
    cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/servlet/servicelist/FormattedServiceListWriter.java
    cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/servlet/servicelist/UnformattedServiceListWriter.java
    cxf/trunk/systests/transports/src/test/java/org/apache/cxf/systest/servlet/CXFServletTest.java
    cxf/trunk/systests/transports/src/test/java/org/apache/cxf/systest/servlet/ExternalServicesServletTest.java
    cxf/trunk/systests/transports/src/test/java/org/apache/cxf/systest/servlet/cxf-servlet.xml

Modified: cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/servlet/servicelist/FormattedServiceListWriter.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/servlet/servicelist/FormattedServiceListWriter.java?rev=1163375&r1=1163374&r2=1163375&view=diff
==============================================================================
--- cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/servlet/servicelist/FormattedServiceListWriter.java
(original)
+++ cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/servlet/servicelist/FormattedServiceListWriter.java
Tue Aug 30 20:56:48 2011
@@ -109,7 +109,11 @@ public class FormattedServiceListWriter 
     }
 
     private String getAbsoluteAddress(String basePath, AbstractDestination d) {
-        String endpointAddress = d.getEndpointInfo().getAddress();
+        String endpointAddress = (String)d.getEndpointInfo().getProperty("publishedEndpointUrl");
+        if (endpointAddress != null) {
+            return endpointAddress;
+        }
+        endpointAddress = d.getEndpointInfo().getAddress();
         if (basePath == null || endpointAddress.startsWith(basePath)) {
             return endpointAddress;
         } else {

Modified: cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/servlet/servicelist/UnformattedServiceListWriter.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/servlet/servicelist/UnformattedServiceListWriter.java?rev=1163375&r1=1163374&r2=1163375&view=diff
==============================================================================
--- cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/servlet/servicelist/UnformattedServiceListWriter.java
(original)
+++ cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/servlet/servicelist/UnformattedServiceListWriter.java
Tue Aug 30 20:56:48 2011
@@ -71,7 +71,11 @@ public class UnformattedServiceListWrite
     }
 
     private String getAbsoluteAddress(String basePath, AbstractDestination d) {
-        String endpointAddress = d.getEndpointInfo().getAddress();
+        String endpointAddress = (String)d.getEndpointInfo().getProperty("publishedEndpointUrl");
+        if (endpointAddress != null) {
+            return endpointAddress;
+        }
+        endpointAddress = d.getEndpointInfo().getAddress();
         if (basePath == null || endpointAddress.startsWith(basePath)) {
             return endpointAddress;
         } else {

Modified: cxf/trunk/systests/transports/src/test/java/org/apache/cxf/systest/servlet/CXFServletTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/transports/src/test/java/org/apache/cxf/systest/servlet/CXFServletTest.java?rev=1163375&r1=1163374&r2=1163375&view=diff
==============================================================================
--- cxf/trunk/systests/transports/src/test/java/org/apache/cxf/systest/servlet/CXFServletTest.java
(original)
+++ cxf/trunk/systests/transports/src/test/java/org/apache/cxf/systest/servlet/CXFServletTest.java
Tue Aug 30 20:56:48 2011
@@ -96,7 +96,7 @@ public class CXFServletTest extends Abst
         
         
         WebLink[] links = res.getLinks();
-        assertEquals("There should get two links for the service", 3, links.length);
+        assertEquals("Wrong number of service links", 4, links.length);
         
         Set<String> links2 = new HashSet<String>();
         for (WebLink l : links) {
@@ -105,6 +105,7 @@ public class CXFServletTest extends Abst
         
         assertTrue(links2.contains(CONTEXT_URL + "/services/greeter?wsdl"));       
         assertTrue(links2.contains(CONTEXT_URL + "/services/greeter2?wsdl")); 
+        assertTrue(links2.contains("http://cxf.apache.org/MyGreeter?wsdl")); 
         assertEquals("text/html", res.getContentType());
         
         res = client.getResponse(CONTEXT_URL + "/services/");
@@ -116,9 +117,10 @@ public class CXFServletTest extends Abst
             links2.add(l.getURLString());
         }
         
-        assertEquals("There should get two links for the service", 3, links.length);
+        assertEquals("Wrong number of service links", 4, links.length);
         assertTrue(links2.contains(CONTEXT_URL + "/services/greeter?wsdl"));       
         assertTrue(links2.contains(CONTEXT_URL + "/services/greeter2?wsdl")); 
+        assertTrue(links2.contains("http://cxf.apache.org/MyGreeter?wsdl")); 
         
         assertEquals("text/html", res.getContentType());
         

Modified: cxf/trunk/systests/transports/src/test/java/org/apache/cxf/systest/servlet/ExternalServicesServletTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/transports/src/test/java/org/apache/cxf/systest/servlet/ExternalServicesServletTest.java?rev=1163375&r1=1163374&r2=1163375&view=diff
==============================================================================
--- cxf/trunk/systests/transports/src/test/java/org/apache/cxf/systest/servlet/ExternalServicesServletTest.java
(original)
+++ cxf/trunk/systests/transports/src/test/java/org/apache/cxf/systest/servlet/ExternalServicesServletTest.java
Tue Aug 30 20:56:48 2011
@@ -59,7 +59,7 @@ public class ExternalServicesServletTest
         //test the '/' context get service list
         WebResponse  res = client.getResponse(CONTEXT_URL + "/");
         WebLink[] links = res.getLinks();
-        assertEquals("There should get two links for the services", 3, links.length);
+        assertEquals("Wrong number of service links", 4, links.length);
         
         Set<String> links2 = new HashSet<String>();
         for (WebLink l : links) {

Modified: cxf/trunk/systests/transports/src/test/java/org/apache/cxf/systest/servlet/cxf-servlet.xml
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/transports/src/test/java/org/apache/cxf/systest/servlet/cxf-servlet.xml?rev=1163375&r1=1163374&r2=1163375&view=diff
==============================================================================
--- cxf/trunk/systests/transports/src/test/java/org/apache/cxf/systest/servlet/cxf-servlet.xml
(original)
+++ cxf/trunk/systests/transports/src/test/java/org/apache/cxf/systest/servlet/cxf-servlet.xml
Tue Aug 30 20:56:48 2011
@@ -44,5 +44,18 @@ http://cxf.apache.org/jaxws http://cxf.a
         <jaxws:schemaLocation>/org/apache/cxf/systest/servlet/hello_world_includes.xsd</jaxws:schemaLocation>
     </jaxws:schemaLocations>
   </jaxws:endpoint>
+
+  <jaxws:endpoint 
+    id="greeter4" 
+    address="/greeter4"
+    implementor="org.apache.cxf.systest.servlet.CXFServletTest$NoWsdlGreeter">
+    <jaxws:schemaLocations >
+        <jaxws:schemaLocation>/org/apache/cxf/systest/servlet/hello_world_includes.xsd</jaxws:schemaLocation>
+    </jaxws:schemaLocations>
+    <jaxws:properties>
+        <entry key="publishedEndpointUrl" value="http://cxf.apache.org/MyGreeter"/>
+    </jaxws:properties>
+  </jaxws:endpoint>
+
   
 </beans>
\ No newline at end of file



Mime
View raw message