Package org.glassfish.jersey.server

Examples of org.glassfish.jersey.server.ResourceConfig


*/
public class GrizzlyPackageTest extends JerseyTest {
    @Override
    protected ResourceConfig configure() {
        enable(TestProperties.LOG_TRAFFIC);
        return new ResourceConfig().packages(this.getClass().getPackage().getName());
    }
View Full Code Here


    }

    @Test
    public void testCreateHttpServer() throws Exception {
        server = JdkHttpServerFactory.createHttpServer(
                UriBuilder.fromUri("http://localhost/").port(getPort()).build(), new ResourceConfig(TestResource.class));

        assertThat(server, instanceOf(HttpServer.class));
        assertThat(server, not(instanceOf(HttpsServer.class)));
    }
View Full Code Here

    }

    @Test
    public void testCreateHttpsServer() throws Exception {
        server = JdkHttpServerFactory.createHttpServer(
                UriBuilder.fromUri("https://localhost/").port(getPort()).build(), new ResourceConfig(TestResource.class));

        assertThat(server, instanceOf(HttpsServer.class));
    }
View Full Code Here

        }
    }

    @Override
    protected DeploymentContext configureDeployment() {
        return DeploymentContext.builder(new ResourceConfig(TestResource.class))
                .contextPath("context1/context2")
                .build();
    }
View Full Code Here

        sslContext.setKeyStoreBytes(ByteStreams.toByteArray(keyStore))// contains server keypair
        sslContext.setKeyStorePass("asdfgh");
        sslContext.setTrustStoreBytes(ByteStreams.toByteArray(trustStore)); // contains client certificate
        sslContext.setTrustStorePass("asdfgh");

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

        try {
            webServer = GrizzlyHttpServerFactory.createHttpServer(
                    getBaseURI(),
                    rc,
View Full Code Here

    }

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

        super(new SimpleTestContainerFactory());
    }

    @Override
    protected ResourceConfig configure() {
        return new ResourceConfig(Resource.class);
    }
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

        }
    }

    @Override
    protected DeploymentContext configureDeployment() {
        return ServletDeploymentContext.builder(new ResourceConfig())
                .initParam(ServerProperties.PROVIDER_PACKAGES, this.getClass().getPackage().getName())
                .build();
    }
View Full Code Here

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

        return ServletDeploymentContext.forServlet(new ServletContainer(new ResourceConfig(TestResource.class))).build();
    }
View Full Code Here

TOP

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

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.