Package org.glassfish.jersey.server

Examples of org.glassfish.jersey.server.ResourceConfig$ImmutableState


    @Test
    public void testStartupShutdownHooks() {
        final StartStopListener listener = new StartStopListener();

        startServer(new ResourceConfig(One.class).register(listener));

        Client client = ClientBuilder.newClient();
        WebTarget r = client.target(getUri().path("/").build());

        assertThat(r.path("one").request().get(String.class), equalTo("one"));
View Full Code Here


public class MyResourceTest extends JerseyTest {

    @Override
    protected Application configure() {
        return new ResourceConfig(MyResource.class);
    }
View Full Code Here

        }
    }

    @Override
    protected Application configure() {
        ResourceConfig config = new ResourceConfig(TracingResource.class);
        config.register(new LoggingFilter(LOGGER, true));
        final Resource.Builder resourceBuilder = Resource.builder(ROOT_PATH_PROGRAMMATIC);
        resourceBuilder.addMethod(TRACE.NAME).handledBy(new Inflector<ContainerRequestContext, Response>() {

            @Override
            public Response apply(ContainerRequestContext request) {
                if (request == null) {
                    return Response.noContent().build();
                } else {
                    return Response.ok(stringify((ContainerRequest) request), MediaType.TEXT_PLAIN).build();
                }
            }
        });

        return config.registerResources(resourceBuilder.build());

    }
View Full Code Here

        }
    }

    @Override
    protected Application configure() {
        ResourceConfig config = new ResourceConfig(HttpMethodResource.class);
        config.register(new LoggingFilter(LOGGER, true));
        return config;
    }
View Full Code Here

        }
    }

    @Override
    protected Application configure() {
        ResourceConfig config = new ResourceConfig(HttpMethodResource.class);
        config.register(new LoggingFilter(LOGGER, true));
        return config;
    }
View Full Code Here

        }
    }

    @Override
    protected Application configure() {
        ResourceConfig config = new ResourceConfig(HttpMethodResource.class);
        config.register(new LoggingFilter(LOGGER, true));
        return config;
    }
View Full Code Here

    private static final Logger LOGGER = Logger.getLogger(AuthFilterTest.class.getName());

    @Override
    protected Application configure() {
        ResourceConfig config = new ResourceConfig(AuthTest.AuthResource.class);
        config.register(new LoggingFilter(LOGGER, true));
        return config;
    }
View Full Code Here

        sslContextFactory.setKeyStoreResource(Resource.newResource(keyStore))// contains server keypair
        sslContextFactory.setKeyStorePassword("asdfgh");
        sslContextFactory.setTrustStoreResource(Resource.newResource(trustStore)); // contains client certificate
        sslContextFactory.setTrustStorePassword("asdfgh");

        ResourceConfig rc = new ResourceConfig();
        rc.register(new LoggingFilter(LOGGER, true));
        rc.registerClasses(RootResource.class, SecurityFilter.class, AuthenticationExceptionMapper.class);

        try {
            webServer = JettyHttpContainerFactory.createServer(
                    getBaseURI(),
                    sslContextFactory,
View Full Code Here

        }
    }

    @Test
    public void testJdkHttpPackage() {
        final ResourceConfig rc = new ResourceConfig();
        rc.packages(this.getClass().getPackage().getName());

        startServer(rc);

        WebTarget r = ClientBuilder.newClient().target(getUri().path("/").build());
View Full Code Here

    @Override
    protected DeploymentContext configureDeployment() {
        forceSet(TestProperties.CONTAINER_PORT, "0");

        return DeploymentContext.builder(new ResourceConfig(TestResource.class)).build();
    }
View Full Code Here

TOP

Related Classes of org.glassfish.jersey.server.ResourceConfig$ImmutableState

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.