Package org.glassfish.jersey.server

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


    @Test
    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));
View Full Code Here


    @Test
    public void testStatisticsEnabledMbeansEnabledByInstance2() {
        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));
View Full Code Here

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

    @Test
    public void testAllDisabled2() {
        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();
View Full Code Here

        final ResourceConfig resourceConfig = new ResourceConfig();
        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));
View Full Code Here

    @Test
    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));
View Full Code Here

public class MonitoringFeatureTest {

    @Test
    public void testStatisticsEnabled() {
        final ResourceConfig resourceConfig = new ResourceConfig();
        resourceConfig.register(MonitoringFeature.class);
        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

    }

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


    @Override
    protected Application configure() {
        final ResourceConfig config = new ResourceConfig(Resource.class);
        config.register(new MetainfServicesBinder(config));
        return config;
    }

    @Override
    protected void configureClient(final ClientConfig config) {
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.