Author: alessio.soldano(a)jboss.com
Date: 2010-08-24 07:13:22 -0400 (Tue, 24 Aug 2010)
New Revision: 12843
Modified:
projects/jaxws-httpserver-httpspi/trunk/src/main/java/org/jboss/ws/httpserver_httpspi/HttpServerContextFactory.java
projects/jaxws-httpserver-httpspi/trunk/src/test/java/org/jboss/ws/httpserver_httpspi/EndpointAPITest.java
Log:
Fixing address provided when building a context in HttpServerContextFactory and added
additional test coverage
Modified:
projects/jaxws-httpserver-httpspi/trunk/src/main/java/org/jboss/ws/httpserver_httpspi/HttpServerContextFactory.java
===================================================================
---
projects/jaxws-httpserver-httpspi/trunk/src/main/java/org/jboss/ws/httpserver_httpspi/HttpServerContextFactory.java 2010-08-24
11:12:09 UTC (rev 12842)
+++
projects/jaxws-httpserver-httpspi/trunk/src/main/java/org/jboss/ws/httpserver_httpspi/HttpServerContextFactory.java 2010-08-24
11:13:22 UTC (rev 12843)
@@ -36,6 +36,6 @@
{
public static HttpContext createHttpContext(HttpServer server, String contextPath,
String path)
{
- return new HttpContextDelegate(server.createContext(contextPath), path);
+ return new HttpContextDelegate(server.createContext(contextPath + path), path);
}
}
Modified:
projects/jaxws-httpserver-httpspi/trunk/src/test/java/org/jboss/ws/httpserver_httpspi/EndpointAPITest.java
===================================================================
---
projects/jaxws-httpserver-httpspi/trunk/src/test/java/org/jboss/ws/httpserver_httpspi/EndpointAPITest.java 2010-08-24
11:12:09 UTC (rev 12842)
+++
projects/jaxws-httpserver-httpspi/trunk/src/test/java/org/jboss/ws/httpserver_httpspi/EndpointAPITest.java 2010-08-24
11:13:22 UTC (rev 12843)
@@ -108,9 +108,36 @@
invokeEndpoint(address);
endpoint.stop();
- server.removeContext(contextPath);
+ server.removeContext(contextPath + path);
}
}
+
+ @Test
+ public void testMultipleEndpointsSameContext() throws Exception
+ {
+ server.start();
+ String contextPath = "/ctxt";
+ String path = "/echo";
+ int k = 3;
+ Endpoint[] endpoints = new Endpoint[k];
+ HttpContext[] contexts = new HttpContext[k];
+ String[] addresses = new String[k];
+ for (int i = 0; i < k; i++)
+ {
+ addresses[i] = "http://localhost:" + currentPort + contextPath + path
+ i;
+ contexts[i] = HttpServerContextFactory.createHttpContext(server, contextPath,
path + i);
+ endpoints[i] = Endpoint.create(new EndpointBean());
+ endpoints[i].publish(contexts[i]);
+ }
+ for (int i = 0; i < k; i++)
+ {
+ invokeEndpoint(addresses[i]);
+ }
+ for (int i = 0; i < k; i++)
+ {
+ endpoints[i].stop();
+ }
+ }
@Test
public void testMultipleEndpointsDifferentContexts() throws Exception
Show replies by date