use of org.apache.tomcat.unittest.TesterServletContext in project tomcat by apache.
the class TestWsServerContainer method testDuplicatePaths23.
/*
* POJO programmatic followed by programmatic duplicate.
*/
@Test(expected = DeploymentException.class)
public void testDuplicatePaths23() throws Exception {
WsServerContainer sc = new WsServerContainer(new TesterServletContext());
ServerEndpointConfig configA = ServerEndpointConfig.Builder.create(PojoTemplate.class, "/foo/{a}").build();
sc.addEndpoint(PojoTemplate.class);
sc.addEndpoint(configA);
}
use of org.apache.tomcat.unittest.TesterServletContext in project tomcat by apache.
the class TestWsServerContainer method testSpecExample4.
@Test
public void testSpecExample4() throws Exception {
WsServerContainer sc = new WsServerContainer(new TesterServletContext());
ServerEndpointConfig configA = ServerEndpointConfig.Builder.create(Object.class, "/{var1}/d").build();
ServerEndpointConfig configB = ServerEndpointConfig.Builder.create(Object.class, "/b/{var2}").build();
sc.addEndpoint(configA);
sc.addEndpoint(configB);
Assert.assertEquals(configB, sc.findMapping("/b/d").getConfig());
}
use of org.apache.tomcat.unittest.TesterServletContext in project tomcat by apache.
the class TestWsServerContainer method testDuplicatePaths04.
@Test
public void testDuplicatePaths04() throws Exception {
WsServerContainer sc = new WsServerContainer(new TesterServletContext());
ServerEndpointConfig configA = ServerEndpointConfig.Builder.create(Object.class, "/a/{var1}/{var2}").build();
ServerEndpointConfig configB = ServerEndpointConfig.Builder.create(Object.class, "/a/b/{var2}").build();
sc.addEndpoint(configA);
sc.addEndpoint(configB);
Assert.assertEquals(configA, sc.findMapping("/a/x/y").getConfig());
Assert.assertEquals(configB, sc.findMapping("/a/b/y").getConfig());
}
Aggregations