Package org.jolokia.config

Examples of org.jolokia.config.Configuration


    MBeanServerHandler handler;

    @BeforeTest
    public void setup() {
        Configuration config = new Configuration(ConfigKey.DEBUG, "true");
        handler = new MBeanServerHandler(config, this);
    }
View Full Code Here


        finalCfg.putAll(pConfig);

        prepareDetectorOptions(finalCfg);
        addJolokiaId(finalCfg);

        jolokiaConfig = new Configuration();
        jolokiaConfig.updateGlobalConfiguration(finalCfg);
        initConfigAndValidate(finalCfg);
    }
View Full Code Here

    private ProcessingParameters procParams;

    @BeforeTest
    private void setup() {
        dispatcher = createDispatcherPointingToLocalMBeanServer();
        procParams = new Configuration().getProcessingParameters(new HashMap<String, String>());
    }
View Full Code Here

    // ===================================================================================================

    private void init() throws MalformedObjectNameException {
        TestDetector.reset();
        Configuration config = new Configuration(ConfigKey.MBEAN_QUALIFIER,"qualifier=test");
        handler = new MBeanServerHandler(config, new LogHandler() {
            public void debug(String message) {
            }

            public void info(String message) {
View Full Code Here

    public void postDetectWithNegativConfig() throws MalformedObjectNameException, InstanceNotFoundException, ReflectionException, AttributeNotFoundException, MBeanException {
        ServerHandle handle = doPlainDetect();
        MBeanServer mockServer = createMock(MBeanServer.class);
        expect(mockServer.queryNames(new ObjectName("amx:type=domain-root,*"),null)).andReturn(null).anyTimes();
        replay(mockServer);
        Configuration config = new Configuration(ConfigKey.DETECTOR_OPTIONS,"{\"glassfish\": {\"bootAmx\" : false}}");
        handle.postDetect(getMBeanServerManager(mockServer), config, null);
        verify(mockServer);
    }
View Full Code Here

        expect(mockServer.queryNames(new ObjectName("amx:type=domain-root,*"),null)).andReturn(Collections.<ObjectName>emptySet()).anyTimes();
        ObjectName bootAmxName = new ObjectName("amx-support:type=boot-amx");
        expect(mockServer.isRegistered(bootAmxName)).andStubReturn(true);
        expect(mockServer.invoke(bootAmxName,"bootAMX",null,null)).andReturn(null);
        replay(mockServer);
        Configuration config = new Configuration(ConfigKey.DETECTOR_OPTIONS,opts);
        MBeanServerExecutor servers = getMBeanServerManager(mockServer);
        handle.postDetect(servers, config, null);
        handle.preDispatch(servers,null);
        verify(mockServer);
    }
View Full Code Here

        expect(mockServer.invoke(bootAmxName, "bootAMX", null, null)).andThrow(exp);
        LogHandler log = createMock(LogHandler.class);
        log.error(matches(regexp),isA(exp.getClass()));
        replay(mockServer,log);
        MBeanServerExecutor servers = getMBeanServerManager(mockServer);
        handle.postDetect(servers,new Configuration(),log);
        handle.preDispatch(servers,null);
        verify(mockServer);
    }
View Full Code Here

    }

    @Test
    public void detectorArgs() {
        JvmAgentConfig config = new JvmAgentConfig("bootAmx=true");
        Configuration jConfig = config.getJolokiaConfig();
        String detectorOpts = jConfig.get(ConfigKey.DETECTOR_OPTIONS);
        assertEquals(detectorOpts.replaceAll("\\s*",""),"{\"glassfish\":{\"bootAmx\":true}}");
    }
View Full Code Here

    @Test
    public void jolokiaConfig() {
        JvmAgentConfig config = new JvmAgentConfig("maxDepth=42");

        Configuration jolokiaConfig = config.getJolokiaConfig();
        assertEquals(jolokiaConfig.get(ConfigKey.MAX_DEPTH),"42");
    }
View Full Code Here

                {"classpath:/access-restrictor.xml","not allowed"},
                {"file:///not-existing.xml","No access"},
                {"classpath:/${prop:jolokia.test1.policy.location}", "not allowed"},
                {"classpath:/${prop:jolokia.test2.policy.location}.xml", "not allowed"}
        }) {
            Configuration config = getConfig(ConfigKey.POLICY_LOCATION,params[0]);
            JolokiaHttpHandler newHandler = new JolokiaHttpHandler(config);
            HttpExchange exchange = prepareExchange("http://localhost:8080/jolokia/read/java.lang:type=Memory/HeapMemoryUsage");
            // Simple GET method
            expect(exchange.getRequestMethod()).andReturn("GET");
            Headers header = new Headers();
View Full Code Here

TOP

Related Classes of org.jolokia.config.Configuration

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.