Package org.glassfish.jersey.server

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


    @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));
        Assert.assertFalse(config.isRegistered(MBeanExposer.class));
    }
View Full Code Here


    @Test
    public void testMonitoringEnabledStatisticsDisabledByAutodiscovery() {
        final ResourceConfig resourceConfig = new ResourceConfig();
        resourceConfig.property(ServerProperties.MONITORING_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.assertFalse(config.isRegistered(MonitoringEventListener.class));
        Assert.assertFalse(config.isRegistered(MBeanExposer.class));
    }
View Full Code Here

    @Test
    public void testStatisticsEnabledByAutodiscovery() {
        final ResourceConfig resourceConfig = new ResourceConfig();
        resourceConfig.property(ServerProperties.MONITORING_STATISTICS_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.assertFalse(config.isRegistered(MBeanExposer.class));
    }
View Full Code Here

    @Test
    public void testStatisticsDisabledByAutodiscovery() {
        final ResourceConfig resourceConfig = new ResourceConfig();
        resourceConfig.property(ServerProperties.MONITORING_STATISTICS_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));
        Assert.assertFalse(config.isRegistered(MBeanExposer.class));
    }
View Full Code Here

    public void testStatisticsEnabledMbeansEnabledByInstance() {
        final ResourceConfig resourceConfig = new ResourceConfig();
        final MonitoringFeature monitoringFeature = new MonitoringFeature();
        monitoringFeature.setmBeansEnabled(true);
        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

        final ResourceConfig resourceConfig = new ResourceConfig();
        final MonitoringFeature monitoringFeature = new MonitoringFeature();
        monitoringFeature.setmBeansEnabled(true);
        resourceConfig.register(monitoringFeature);
        resourceConfig.property(ServerProperties.MONITORING_STATISTICS_MBEANS_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.assertFalse(config.isRegistered(MBeanExposer.class));
    }
View Full Code Here

        final MonitoringFeature monitoringFeature = new MonitoringFeature();
        monitoringFeature.setmBeansEnabled(true);
        resourceConfig.register(monitoringFeature);
        resourceConfig.property(ServerProperties.MONITORING_STATISTICS_MBEANS_ENABLED, false);
        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));
        Assert.assertFalse(config.isRegistered(MBeanExposer.class));
    }
View Full Code Here

        final ResourceConfig resourceConfig = new ResourceConfig();
        final MonitoringFeature monitoringFeature = new MonitoringFeature();
        resourceConfig.register(monitoringFeature);
        resourceConfig.property(ServerProperties.MONITORING_STATISTICS_MBEANS_ENABLED, false);
        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));
        Assert.assertFalse(config.isRegistered(MBeanExposer.class));
    }
View Full Code Here

    @Test
    public void testAllDisabled3() {
        final ResourceConfig resourceConfig = new ResourceConfig();
        resourceConfig.property(ServerProperties.MONITORING_STATISTICS_MBEANS_ENABLED, false);
        resourceConfig.property(ServerProperties.MONITORING_STATISTICS_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));
        Assert.assertFalse(config.isRegistered(MBeanExposer.class));
    }
View Full Code Here

    @Test
    public void testAllEnabled() {
        final ResourceConfig resourceConfig = new ResourceConfig();
        resourceConfig.property(ServerProperties.MONITORING_STATISTICS_MBEANS_ENABLED, true);
        resourceConfig.property(ServerProperties.MONITORING_STATISTICS_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

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.