Package org.glassfish.jersey.server

Examples of org.glassfish.jersey.server.ApplicationHandler$ApplicationBinder$RuntimeConfigProvider


    }


    @Test
    public void testPathParamOnAmbiguousTemplate() throws ExecutionException, InterruptedException {
        final ApplicationHandler applicationHandler = new ApplicationHandler(new ResourceConfig(ResourceABC.class,
                ResourceXYZ.class));
        final ContainerResponse response = applicationHandler.apply(RequestContextBuilder.from("/uuu/a", "GET").build()).get();
        Assert.assertEquals(200, response.getStatus());
        Assert.assertEquals("a-abc:uuu", response.getEntity());
    }
View Full Code Here


        Assert.assertEquals("a-abc:uuu", response.getEntity());
    }

    @Test
    public void testPathParamOnAmbiguousTemplate2() throws ExecutionException, InterruptedException {
        final ApplicationHandler applicationHandler = new ApplicationHandler(new ResourceConfig(ResourceABC.class,
                ResourceXYZ.class));
        final ContainerResponse response = applicationHandler.apply(RequestContextBuilder.from("/test/x", "GET").build()).get();
        Assert.assertEquals(200, response.getStatus());
        Assert.assertEquals("x-xyz:test", response.getEntity());
    }
View Full Code Here

    }


    @Test
    public void testPathParamOnAmbiguousTemplate3() throws ExecutionException, InterruptedException {
        final ApplicationHandler applicationHandler = new ApplicationHandler(new ResourceConfig(ResourceABC.class,
                ResourceXYZ.class));
        final ContainerResponse response = applicationHandler.apply(RequestContextBuilder.from("/uuu", "GET").build()).get();
        Assert.assertEquals(200, response.getStatus());
        Assert.assertEquals("abc:uuu", response.getEntity());
    }
View Full Code Here

        Assert.assertEquals("abc:uuu", response.getEntity());
    }

    @Test
    public void testPathParamOnAmbiguousTemplate4() throws ExecutionException, InterruptedException {
        final ApplicationHandler applicationHandler = new ApplicationHandler(new ResourceConfig(ResourceABC.class,
                ResourceXYZ.class));
        final ContainerResponse response = applicationHandler.apply(RequestContextBuilder.from("/post", "POST")
                .entity("entity").build()).get();
        Assert.assertEquals(200, response.getStatus());
        Assert.assertEquals("xyz:post", response.getEntity());
    }
View Full Code Here

        Assert.assertEquals("xyz:post", response.getEntity());
    }

    @Test
    public void testPathParamOnAmbiguousTemplate5() throws ExecutionException, InterruptedException {
        final ApplicationHandler applicationHandler = new ApplicationHandler(new ResourceConfig(ResourceABC.class,
                ResourceXYZ.class));
        final ContainerResponse response = applicationHandler.apply(RequestContextBuilder.from("/xxx/foo", "GET").build()).get();
        Assert.assertEquals(200, response.getStatus());
        Assert.assertEquals("subx-xyz:xxx:foo", response.getEntity());
    }
View Full Code Here

        }
    }

    @Test
    public void testPathParamOnAmbiguousTemplateTroughSubResourceLocator1() throws ExecutionException, InterruptedException {
        final ApplicationHandler applicationHandler = new ApplicationHandler(new ResourceConfig(SimpleLocator.class));
        final ContainerResponse response = applicationHandler.apply(RequestContextBuilder.from("/locator/abc/uuu/a", "GET")
                .build()).get();
        Assert.assertEquals(404, response.getStatus());
    }
View Full Code Here

        Assert.assertEquals(404, response.getStatus());
    }

    @Test
    public void testPathParamOnAmbiguousTemplateTroughSubResourceLocator2() throws ExecutionException, InterruptedException {
        final ApplicationHandler applicationHandler = new ApplicationHandler(new ResourceConfig(SimpleLocator.class));
        final ContainerResponse response = applicationHandler.apply(RequestContextBuilder.from("/locator/abc/a", "GET")
                .build()).get();
        Assert.assertEquals(200, response.getStatus());
        Assert.assertEquals("a-abc:null", response.getEntity());
    }
View Full Code Here

        Assert.assertEquals("a-abc:null", response.getEntity());
    }

    @Test
    public void testPathParamOnAmbiguousTemplateTroughSubResourceLocator3() throws ExecutionException, InterruptedException {
        final ApplicationHandler applicationHandler = new ApplicationHandler(new ResourceConfig(SimpleLocator.class));
        final ContainerResponse response = applicationHandler.apply(RequestContextBuilder.from("/locator/xyz/subxfoo", "GET")
                .build()).get();
        Assert.assertEquals(200, response.getStatus());
        Assert.assertEquals("subx-xyz:null:subxfoo", response.getEntity());
    }
View Full Code Here

        }
    }

    @Test
    public void testSubResourceLocatorWithPathParams() throws ExecutionException, InterruptedException {
        final ApplicationHandler applicationHandler = new ApplicationHandler(new ResourceConfig(ResourceWithLocator.class));
        final ContainerResponse response = applicationHandler.apply(RequestContextBuilder.from("/uuu", "GET").build()).get();
        Assert.assertEquals(200, response.getStatus());
        Assert.assertEquals("uuu", response.getEntity());
    }
View Full Code Here

        Assert.assertEquals("uuu", response.getEntity());
    }

    @Test
    public void testSubResourceLocatorWithPathParams2() throws ExecutionException, InterruptedException {
        final ApplicationHandler applicationHandler = new ApplicationHandler(new ResourceConfig(ResourceWithLocator.class));
        final ContainerResponse response = applicationHandler.apply(RequestContextBuilder.from("/uuu/test", "GET").build()).get();
        Assert.assertEquals(200, response.getStatus());
        Assert.assertEquals("uuu:test", response.getEntity());
    }
View Full Code Here

TOP

Related Classes of org.glassfish.jersey.server.ApplicationHandler$ApplicationBinder$RuntimeConfigProvider

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.