Package org.glassfish.jersey.server

Examples of org.glassfish.jersey.server.ResourceConfig.property()


        }

        @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"),
View Full Code Here


    @Test
    public void testMonitoringDisabled() {
        final ResourceConfig resourceConfig = new ResourceConfig();
        resourceConfig.register(MonitoringFeature.class);
        resourceConfig.property(ServerProperties.MONITORING_ENABLED, false);
        final ApplicationHandler applicationHandler = new ApplicationHandler(resourceConfig);

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

    @Test
    public void testStatisticsDisabled() {
        final ResourceConfig resourceConfig = new ResourceConfig();
        resourceConfig.register(MonitoringFeature.class);
        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.assertFalse(config.isRegistered(MonitoringEventListener.class));
View Full Code Here

    }

    @Test
    public void testMonitoringEnabledByAutodiscovery() {
        final ResourceConfig resourceConfig = new ResourceConfig();
        resourceConfig.property(ServerProperties.MONITORING_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));
View Full Code Here

        final ResourceConfig resourceConfig = new ResourceConfig(BeanValidationResource.class);
        if (registerFeature) {
            resourceConfig.register(ValidationFeature.class);
        }
        if (disableMetainfServicesLookup) {
            resourceConfig.property(ServerProperties.METAINF_SERVICES_LOOKUP_DISABLE, Boolean.TRUE);

            resourceConfig.register(org.glassfish.jersey.grizzly2.httpserver.GrizzlyHttpContainerProvider.class);
        }

        final HttpServer server = GrizzlyHttpServerFactory.createHttpServer(baseUri, resourceConfig);
View Full Code Here

    }

    @Override
    protected Application configure() {
        ResourceConfig resourceConfig = (ResourceConfig) super.configure();
        resourceConfig.property(ServerProperties.METAINF_SERVICES_LOOKUP_DISABLE, true);

        return resourceConfig;
    }

}
View Full Code Here

            return resourceConfig;
        }

        private static ResourceConfig getResourceConfig() {
            final ResourceConfig resourceConfig = new ResourceConfig();
            resourceConfig.property(ServerProperties.MONITORING_STATISTICS_MBEANS_ENABLED, true);
            return resourceConfig;
        }

        public static interface TestResultTracker {
            public void reloaded();
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"),
View Full Code Here

        final ResourceConfig resourceConfig = new ResourceConfig(BasicResource.class);

        resourceConfig.register(ContactBeanProvider.class);
        resourceConfig.register(MoxyXmlFeature.class);

        resourceConfig.property(ServerProperties.BV_SEND_ERROR_IN_RESPONSE, true);

        return resourceConfig;
    }

    @Override
View Full Code Here

        assertApply(responseStatus, initResourceConfig(disableValidation, disableAutoDiscovery, registerFeature), uri);

        if (responseStatus == 500) {
            // validation works - environment is validation friendly -> let's try to disable META-INF/services lookup
            final ResourceConfig resourceConfig = initResourceConfig(disableValidation, disableAutoDiscovery, true);
            resourceConfig.property(ServerProperties.METAINF_SERVICES_LOOKUP_DISABLE, true);

            assertApply(500, resourceConfig, uri);
        }
    }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.