Package org.glassfish.jersey.server

Examples of org.glassfish.jersey.server.ResourceConfig


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

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


        super(new JettyTestContainerFactory());
    }

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

     */
    @Test
    public void testParentServiceLocator() {
        final ServiceLocator locator = new ServiceLocatorImpl("MyServiceLocator", null);
        final Server server = JettyHttpContainerFactory.createServer(URI.create("http://localhost:9876"),
                    new ResourceConfig(Resource.class), false, locator);
            JettyHttpContainer container = (JettyHttpContainer) server.getHandler();
            ServiceLocator appLocator = container.getApplicationHandler().getServiceLocator();
            assertTrue("Application service locator was expected to have defined parent locator", appLocator.getParent() == locator);
    }
View Full Code Here

*/
public class HttpMethodTest extends JerseyTest {

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

    }


    @Override
    protected DeploymentContext configureDeployment() {
        return ServletDeploymentContext.forServlet(new ServletContainer(new ResourceConfig(TestResource.class))).build();
    }
View Full Code Here

        }
    }

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

    }


    @Override
    protected DeploymentContext configureDeployment() {
        return ServletDeploymentContext.forServlet(new ServletContainer(new ResourceConfig(Resource.class))).build();
    }
View Full Code Here

    @Override
    protected Application configure() {
        System.setProperty("spring.profiles.active", "");
        ApplicationContext context = new AnnotationConfigApplicationContext("org.glassfish.jersey.server.spring.profiles");
        return new ResourceConfig()
                .register(RequestContextFilter.class)
                .register(LoggingFilter.class)
                .packages("org.glassfish.jersey.server.spring.profiles")
                .property("contextConfig", context);
    }
View Full Code Here

    public void testAutoDiscoverableGlobalEnabledServerDisabled() throws Exception {
        _test("Disabled", false, true);
    }

    private void _test(final String response, final Boolean globalDisable, final Boolean serverDisable) throws Exception {
        final ResourceConfig resourceConfig = new ResourceConfig(Resource.class, Filter.class);

        if (globalDisable != null) {
            resourceConfig.property(CommonProperties.JSON_PROCESSING_FEATURE_DISABLE, globalDisable);
        }
        if (serverDisable != null) {
            resourceConfig.property(ServerProperties.JSON_PROCESSING_FEATURE_DISABLE, serverDisable);
        }

        final ApplicationHandler app = new ApplicationHandler(resourceConfig);

        final URI baseUri = URI.create("/");
View Full Code Here

    @Override
    protected Application configure() {
        System.setProperty("spring.profiles.active", "dev");
        AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext("org.glassfish.jersey.server.spring.profiles");
        return new ResourceConfig()
                .register(RequestContextFilter.class)
                .register(LoggingFilter.class)
                .packages("org.glassfish.jersey.server.spring.profiles")
                .property("contextConfig", context);
    }
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.