Author: sergeyb
Date: Tue Mar 15 17:50:31 2011
New Revision: 1081883
URL: http://svn.apache.org/viewvc?rev=1081883&view=rev
Log:
Fixing http osgi test
Modified:
cxf/trunk/rt/transports/http-osgi/src/test/java/org/apache/cxf/transport/http_osgi/OsgiServletTest.java
Modified:
cxf/trunk/rt/transports/http-osgi/src/test/java/org/apache/cxf/transport/http_osgi/OsgiServletTest.java
URL:
http://svn.apache.org/viewvc/cxf/trunk/rt/transports/http-osgi/src/test/java/org/apache/cxf/transport/http_osgi/OsgiServletTest.java?rev=1081883&r1=1081882&r2=1081883&view=diff
==============================================================================
---
cxf/trunk/rt/transports/http-osgi/src/test/java/org/apache/cxf/transport/http_osgi/OsgiServletTest.java
(original)
+++
cxf/trunk/rt/transports/http-osgi/src/test/java/org/apache/cxf/transport/http_osgi/OsgiServletTest.java
Tue Mar 15 17:50:31 2011
@@ -111,7 +111,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));
@@ -200,14 +200,16 @@ public class OsgiServletTest extends Ass
@Test
public void testInvokeRestful() throws Exception {
setUpRequest(URI, null, -1);
- paths.add(ADDRESS);
+ EasyMock.expect(request.getContextPath()).andReturn("");
+ EasyMock.expect(request.getServletPath()).andReturn("/cxf");
+ paths.add(PATH);
// TODO How can the registry first return null then destination for
the same path?
-
EasyMock.expect(registry.getDestinationForPath(ADDRESS)).andReturn(null);
-
EasyMock.expect(registry.getDestinationForPath(ADDRESS)).andReturn(destination);
+ EasyMock.expect(registry.getDestinationForPath(PATH)).andReturn(null);
+
EasyMock.expect(registry.getDestinationForPath(PATH)).andReturn(destination);
EasyMock.expect(registry.checkRestfulRequest(EasyMock.isA(String.class))).andReturn(destination);
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();
control.replay();
@@ -229,7 +231,7 @@ public class OsgiServletTest extends Ass
EasyMock.expect(request.getPathInfo()).andReturn(path != null
? path
- : ADDRESS).anyTimes();
+ : PATH).anyTimes();
if (path != null) {
EasyMock.expect(registry.getDestinationForPath(path)).andReturn(destination);
}