use of org.apache.tomcat.unittest.TesterServletContext in project tomcat by apache.
the class TestWsServerContainer method testDuplicatePaths03.
@Test(expected = DeploymentException.class)
public void testDuplicatePaths03() throws Exception {
WsServerContainer sc = new WsServerContainer(new TesterServletContext());
ServerEndpointConfig configA = ServerEndpointConfig.Builder.create(Object.class, "/a/b/{var1}").build();
ServerEndpointConfig configB = ServerEndpointConfig.Builder.create(Object.class, "/a/b/{var2}").build();
sc.addEndpoint(configA);
sc.addEndpoint(configB);
}
use of org.apache.tomcat.unittest.TesterServletContext in project tomcat by apache.
the class TestWsServerContainer method testDuplicatePaths02.
@Test(expected = DeploymentException.class)
public void testDuplicatePaths02() throws Exception {
WsServerContainer sc = new WsServerContainer(new TesterServletContext());
ServerEndpointConfig configA = ServerEndpointConfig.Builder.create(Object.class, "/a/b/{var}").build();
ServerEndpointConfig configB = ServerEndpointConfig.Builder.create(Object.class, "/a/b/{var}").build();
sc.addEndpoint(configA);
sc.addEndpoint(configB);
}
use of org.apache.tomcat.unittest.TesterServletContext in project tomcat by apache.
the class TestWsServerContainer method testDuplicatePaths12.
/*
* POJO auto deployment followed by programmatic duplicate. Keep POJO.
*/
@Test
public void testDuplicatePaths12() throws Exception {
WsServerContainer sc = new WsServerContainer(new TesterServletContext());
ServerEndpointConfig configA = ServerEndpointConfig.Builder.create(Pojo.class, "/foo").build();
sc.addEndpoint(Pojo.class, true);
sc.addEndpoint(configA);
Assert.assertNotEquals(configA, sc.findMapping("/foo").getConfig());
}
use of org.apache.tomcat.unittest.TesterServletContext in project tomcat by apache.
the class TestWsServerContainer method testSpecExample3.
@Test
public void testSpecExample3() throws Exception {
WsServerContainer sc = new WsServerContainer(new TesterServletContext());
ServerEndpointConfig configA = ServerEndpointConfig.Builder.create(Object.class, "/a/{var}/c").build();
ServerEndpointConfig configB = ServerEndpointConfig.Builder.create(Object.class, "/a/b/c").build();
ServerEndpointConfig configC = ServerEndpointConfig.Builder.create(Object.class, "/a/{var1}/{var2}").build();
sc.addEndpoint(configA);
sc.addEndpoint(configB);
sc.addEndpoint(configC);
Assert.assertEquals(configB, sc.findMapping("/a/b/c").getConfig());
Assert.assertEquals(configA, sc.findMapping("/a/d/c").getConfig());
Assert.assertEquals(configC, sc.findMapping("/a/x/y").getConfig());
}
use of org.apache.tomcat.unittest.TesterServletContext in project tomcat by apache.
the class TestWsServerContainer method testDuplicatePaths24.
/*
* POJO auto deployment followed by programmatic on same path.
*/
@Test(expected = DeploymentException.class)
public void testDuplicatePaths24() throws Exception {
WsServerContainer sc = new WsServerContainer(new TesterServletContext());
ServerEndpointConfig configA = ServerEndpointConfig.Builder.create(Object.class, "/foo/{a}").build();
sc.addEndpoint(PojoTemplate.class, true);
sc.addEndpoint(configA);
}
Aggregations