Package org.glassfish.jersey.server

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


        resourceConfig.property(ServerProperties.MONITORING_STATISTICS_MBEANS_ENABLED, true);
        resourceConfig.property(ServerProperties.MONITORING_STATISTICS_ENABLED, true);
        final MonitoringFeature monitoringFeature = new MonitoringFeature();
        monitoringFeature.setmBeansEnabled(false);
        resourceConfig.register(monitoringFeature);
        final ApplicationHandler applicationHandler = new ApplicationHandler(resourceConfig);

        final ResourceConfig config = applicationHandler.getConfiguration();
        Assert.assertTrue(config.isRegistered(ApplicationInfoListener.class));
        Assert.assertTrue(config.isRegistered(MonitoringEventListener.class));
        Assert.assertTrue(config.isRegistered(MBeanExposer.class));
    }
View Full Code Here


    @Test
    public void testOnlyMBeansEnabled() {
        final ResourceConfig resourceConfig = new ResourceConfig();
        resourceConfig.property(ServerProperties.MONITORING_STATISTICS_MBEANS_ENABLED, true);
        final ApplicationHandler applicationHandler = new ApplicationHandler(resourceConfig);

        final ResourceConfig config = applicationHandler.getConfiguration();
        Assert.assertTrue(config.isRegistered(ApplicationInfoListener.class));
        Assert.assertTrue(config.isRegistered(MonitoringEventListener.class));
        Assert.assertTrue(config.isRegistered(MBeanExposer.class));
    }
View Full Code Here

    @Test
    public void testOnlyMBeansEnabled2() {
        final ResourceConfig resourceConfig = new ResourceConfig();
        resourceConfig.property(ServerProperties.MONITORING_STATISTICS_MBEANS_ENABLED, true);
        resourceConfig.property(ServerProperties.MONITORING_STATISTICS_ENABLED, false);
        final ApplicationHandler applicationHandler = new ApplicationHandler(resourceConfig);

        final ResourceConfig config = applicationHandler.getConfiguration();
        Assert.assertTrue(config.isRegistered(ApplicationInfoListener.class));
        Assert.assertTrue(config.isRegistered(MonitoringEventListener.class));
        Assert.assertTrue(config.isRegistered(MBeanExposer.class));
    }
View Full Code Here

    public void testOnlyMBeansEnabled3() {
        final ResourceConfig resourceConfig = new ResourceConfig();
        resourceConfig.property(ServerProperties.MONITORING_STATISTICS_MBEANS_ENABLED, true);
        resourceConfig.property(ServerProperties.MONITORING_STATISTICS_ENABLED, false);
        resourceConfig.register(new MonitoringFeature());
        final ApplicationHandler applicationHandler = new ApplicationHandler(resourceConfig);

        final ResourceConfig config = applicationHandler.getConfiguration();
        Assert.assertTrue(config.isRegistered(ApplicationInfoListener.class));
        Assert.assertTrue(config.isRegistered(MonitoringEventListener.class));
        Assert.assertTrue(config.isRegistered(MBeanExposer.class));
    }
View Full Code Here

        @Test
        public void testDisableWadl() throws ExecutionException, InterruptedException {
            final ResourceConfig rc = new ResourceConfig(WidgetsResource.class, ExtraResource.class);
            rc.property(ServerProperties.WADL_FEATURE_DISABLE, true);

            final ApplicationHandler applicationHandler = new ApplicationHandler(rc);

            final ContainerResponse containerResponse = applicationHandler.apply(new ContainerRequest(
                    URI.create("/"), URI.create("/application.wadl"),
                    "GET", null, new MapPropertiesDelegate())).get();

            assertEquals(404, containerResponse.getStatus());
        }
View Full Code Here

        @Test
        public void testEnableWadl() throws ExecutionException, InterruptedException {
            final ResourceConfig rc = new ResourceConfig(WidgetsResource.class, ExtraResource.class);
            rc.property(ServerProperties.WADL_FEATURE_DISABLE, false);

            final ApplicationHandler applicationHandler = new ApplicationHandler(rc);

            final ContainerResponse containerResponse = applicationHandler.apply(new ContainerRequest(
                    URI.create("/"), URI.create("/application.wadl"),
                    "GET", null, new MapPropertiesDelegate())).get();

            assertEquals(200, containerResponse.getStatus());
        }
View Full Code Here

        @Test
        public void testCustomWadlResourcesBaseUri() throws Exception {
            final ResourceConfig rc = new ResourceConfig(WidgetsResource.class, ExtraResource.class);
            rc.property(ServerProperties.WADL_GENERATOR_CONFIG, MyWadlGeneratorConfig.class.getName());

            final ApplicationHandler applicationHandler = new ApplicationHandler(rc);

            final ContainerResponse containerResponse = applicationHandler.apply(new ContainerRequest(
                    URI.create("/"), URI.create("/application.wadl"),
                    "GET", null, new MapPropertiesDelegate())).get();

            final DocumentBuilderFactory bf = DocumentBuilderFactory.newInstance();
            bf.setNamespaceAware(true);
View Full Code Here

        @Test
        public void testEmptyProduces() throws Exception {
            final ResourceConfig rc = new ResourceConfig(EmptyProducesTestResource.class);
            rc.property(ServerProperties.WADL_FEATURE_DISABLE, false);

            final ApplicationHandler applicationHandler = new ApplicationHandler(rc);

            final ContainerResponse containerResponse = applicationHandler.apply(new ContainerRequest(
                    URI.create("/"), URI.create("/application.wadl"),
                    "GET", null, new MapPropertiesDelegate())).get();

            assertEquals(200, containerResponse.getStatus());
View Full Code Here

        }
        return resourceConfig;
    }

    private void assertApply(int responseStatus, ResourceConfig resourceConfig, URI uri) throws InterruptedException, ExecutionException {
        final ApplicationHandler applicationHandler = new ApplicationHandler(resourceConfig);
        final ContainerRequest requestContext = new ContainerRequest(uri, uri, "POST", null, new MapPropertiesDelegate());
        final ContainerResponse containerResponse = applicationHandler.apply(requestContext).get();

        assertEquals(responseStatus, containerResponse.getStatus());
    }
View Full Code Here

public class PathParamAsPrimitiveTest {

    ApplicationHandler app;

    private ApplicationHandler createApplication(Class<?>... classes) {
        return new ApplicationHandler(new ResourceConfig(classes));
    }
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.