Package org.glassfish.jersey.server

Examples of org.glassfish.jersey.server.ApplicationHandler$FutureResponseWriter


        assertEquals("get-child", response.getEntity());
        assertResponseHeaders(response, "MyResource", "getChild");
    }

    private ApplicationHandler getApplication() {
        return new ApplicationHandler(new ResourceConfig(MyResource.class, MyAnotherResource.class, MyRequestFilter.class,
                MyResponseFilter.class, ResourceTestingInfo.class, MyPrematchingFilter.class));
    }
View Full Code Here


                MyResponseFilter.class, ResourceTestingInfo.class, MyPrematchingFilter.class));
    }

    @Test
    public void testGetChild() throws ExecutionException, InterruptedException {
        ApplicationHandler handler = getApplication();
        final ContainerResponse response = handler.apply(RequestContextBuilder.from("/resource/get-child", "GET").build()).get();
        assertEquals(200, response.getStatus());
        assertEquals("get-child", response.getEntity());

        final String className = "MyResource";
        final String methodName = "getChild";
View Full Code Here

        assertEquals(methodName, response.getHeaders().get("MyResponseFilter-method").get(0));
    }

    @Test
    public void testPost() throws ExecutionException, InterruptedException {
        ApplicationHandler handler = getApplication();
        final ContainerResponse response = handler.apply(RequestContextBuilder.from("/resource", "POST").entity("entity")
                .build()).get();
        assertEquals(200, response.getStatus());
        assertEquals("post", response.getEntity());
        assertResponseHeaders(response, "MyResource", "post");
    }
View Full Code Here

        assertResponseHeaders(response, "MyResource", "post");
    }

    @Test
    public void testGetAnotherResource() throws ExecutionException, InterruptedException {
        ApplicationHandler handler = getApplication();
        final ContainerResponse response = handler.apply(RequestContextBuilder.from("/resource-another", "GET").build()).get();
        assertEquals(200, response.getStatus());
        assertEquals("get-another", response.getEntity());
        assertResponseHeaders(response, "MyAnotherResource", "getAnother");
    }
View Full Code Here

        assertResponseHeaders(response, "MyAnotherResource", "getAnother");
    }

    @Test
    public void testGetSubResource() throws ExecutionException, InterruptedException {
        ApplicationHandler handler = getApplication();
        final ContainerResponse response = handler.apply(RequestContextBuilder.from("/resource/locator", "GET").build()).get();
        assertEquals(200, response.getStatus());
        assertEquals("get-sub-resource", response.getEntity());
        assertResponseHeaders(response, "SubResource", "getFromSubResource");
    }
View Full Code Here

public class SubResourceClassDynamicTest {

    ApplicationHandler app;

    private ApplicationHandler createApplication(Class<?>... classes) {
        return new ApplicationHandler(new ResourceConfig(classes));
    }
View Full Code Here

public class HeadTest {

    private ApplicationHandler app;

    private void initiateWebApplication(Class<?>... classes) {
        app = new ApplicationHandler(new ResourceConfig(classes));
    }
View Full Code Here

        return initiateWebApplication(new ResourceConfig(resourceClasses));
    }

    private List<ResourceModelIssue> initiateWebApplication(final ResourceConfig resourceConfig) {
        try {
            ApplicationHandler server = new ApplicationHandler(resourceConfig);
            fail("Application build expected to fail: " + server);
        } catch (ModelValidationException e) {
            return e.getIssues();
        }
        return null;
View Full Code Here

public class HeadSubResourceMethodTest {

    private ApplicationHandler app;

    private void initiateWebApplication(Class<?>... classes) {
        app = new ApplicationHandler(new ResourceConfig(classes));
    }
View Full Code Here

*/
public class ChildResourceTest {

    @Test
    public void testRootResource() throws ExecutionException, InterruptedException {
        ApplicationHandler applicationHandler = createApplication();
        final ContainerResponse response = applicationHandler.apply(RequestContextBuilder.from("/root", "GET").build()).get();
        assertEquals(200, response.getStatus());
        assertEquals("root-get", response.getEntity());
    }
View Full Code Here

TOP

Related Classes of org.glassfish.jersey.server.ApplicationHandler$FutureResponseWriter

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.