Author: sergeyb
Date: Tue Mar 15 21:26:01 2011
New Revision: 1081946

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

........
  r1081883 | sergeyb | 2011-03-15 17:50:31 +0000 (Tue, 15 Mar 2011) | 1 line
  
  Fixing http osgi test
........

Modified:
    cxf/branches/2.3.x-fixes/   (props changed)
    
cxf/branches/2.3.x-fixes/rt/transports/http-osgi/src/test/java/org/apache/cxf/transport/http_osgi/OsgiServletTest.java

Propchange: cxf/branches/2.3.x-fixes/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Mar 15 21:26:01 2011
@@ -1 +1 @@
-/cxf/trunk:1081787,1081825,1081842
+/cxf/trunk:1081787,1081825,1081842,1081883

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

Modified: 
cxf/branches/2.3.x-fixes/rt/transports/http-osgi/src/test/java/org/apache/cxf/transport/http_osgi/OsgiServletTest.java
URL: 
http://svn.apache.org/viewvc/cxf/branches/2.3.x-fixes/rt/transports/http-osgi/src/test/java/org/apache/cxf/transport/http_osgi/OsgiServletTest.java?rev=1081946&r1=1081945&r2=1081946&view=diff
==============================================================================
--- 
cxf/branches/2.3.x-fixes/rt/transports/http-osgi/src/test/java/org/apache/cxf/transport/http_osgi/OsgiServletTest.java
 (original)
+++ 
cxf/branches/2.3.x-fixes/rt/transports/http-osgi/src/test/java/org/apache/cxf/transport/http_osgi/OsgiServletTest.java
 Tue Mar 15 21:26:01 2011
@@ -105,7 +105,7 @@ public class OsgiServletTest extends Ass
         observer = control.createMock(MessageObserver.class);
         extensor = control.createMock(AddressType.class);
         endpoint = new EndpointInfo();
-        endpoint.setAddress(ADDRESS);
+        endpoint.setAddress(PATH);
         endpoint.setName(QNAME);
         ServiceInfo service = new ServiceInfo();
         service.setInterface(new InterfaceInfo(service, QNAME));
@@ -148,9 +148,14 @@ public class OsgiServletTest extends Ass
     @Test
     public void testInvokeGetServices() throws Exception {
         setUpRequest(SERVICES, null, 1);
+        paths.add(PATH);
+        EasyMock.expect(request.getContextPath()).andReturn("");
+        EasyMock.expect(request.getServletPath()).andReturn("/cxf");
+        
EasyMock.expect(registry.getDestinationForPath(PATH)).andReturn(destination);
+        
         setUpResponse(0, TEXT_LIST, 
                       "<span class=\"field\">Endpoint address:</span> "
-                      + "<span class=\"value\">" + ADDRESS + "</span>");
+                      + "<span class=\"value\">" + ROOT + URI + "</span>");
 
         control.replay();
 
@@ -229,9 +234,10 @@ public class OsgiServletTest extends Ass
         
EasyMock.expect(destination.getEndpointInfo()).andReturn(endpoint).anyTimes();
         EasyMock.expect(destination.getBus()).andReturn(bus).anyTimes();
 
+        String defaultPath = SERVICES.equals(requestURI) ? "/services" : PATH;
         EasyMock.expect(request.getPathInfo()).andReturn(path != null 
                                                 ? path
-                                                : ADDRESS).anyTimes();
+                                                : defaultPath).anyTimes();
         if (path != null) {
             
EasyMock.expect(registry.getDestinationForPath(path)).andReturn(destination);
         }
@@ -325,12 +331,14 @@ public class OsgiServletTest extends Ass
     }
 
     private void setUpRestful() {
-        paths.add(ADDRESS);
-        
EasyMock.expect(registry.getDestinationForPath(ADDRESS)).andReturn(null);
-        
EasyMock.expect(registry.getDestinationForPath(ADDRESS)).andReturn(destination).times(2);
+        paths.add(PATH);
+        EasyMock.expect(request.getContextPath()).andReturn("");
+        EasyMock.expect(request.getServletPath()).andReturn("/cxf");
+        EasyMock.expect(registry.getDestinationForPath(PATH)).andReturn(null);
+        
EasyMock.expect(registry.getDestinationForPath(PATH)).andReturn(destination).times(2);
         EasyMock.expect(destination.getMessageObserver()).andReturn(observer);
         endpoint.addExtensor(extensor);
-        extensor.setLocation(EasyMock.eq(ROOT + "/cxf/Soap" + ADDRESS));
+        extensor.setLocation(EasyMock.eq(ROOT + URI));
         EasyMock.expectLastCall();
     }
 


Reply via email to