Example #1
0
  @Test(expected = javax.websocket.DeploymentException.class)
  public void testDuplicatePaths_03() 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);
  }
Example #2
0
  @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());
  }