Package org.jolokia.config

Examples of org.jolokia.config.Configuration


        list.add(ConfigKey.AGENT_ID);
        list.add(UUID.randomUUID().toString());
        for (Object e : extra) {
            list.add(e);
        }
        Configuration config = new Configuration(list.toArray());
        debugToggle = !debugToggle;
        return config;
    }
View Full Code Here


        assertNull(handle.toJSONObject(null).get("extraInfo"));
    }

    @Test
    public void detectorOptions() {
        Configuration opts = new Configuration(ConfigKey.DETECTOR_OPTIONS, "{\"dukeNukem\" : {\"doIt\" : true }}");
        JSONObject config = serverHandle.getDetectorOptions(opts,null);
        assertTrue((Boolean) config.get("doIt"));
    }
View Full Code Here

        assertTrue((Boolean) config.get("doIt"));
    }

    @Test
    public void detectorOptionsEmpty() {
        JSONObject config = serverHandle.getDetectorOptions(new Configuration(),null);
        assertNull(config);
    }
View Full Code Here

    public void detectOptionsFail() {
        LogHandler handler = EasyMock.createMock(LogHandler.class);
        handler.error(matches("^.*parse options.*"),isA(Exception.class));
        replay(handler);

        Configuration opts = new Configuration(ConfigKey.DETECTOR_OPTIONS,"blub: bla");
        JSONObject config = serverHandle.getDetectorOptions(opts,handler);
        assertNull(config);
        verify(handler);
    }
View Full Code Here

    private MBeanServerHandler handler;

    @BeforeMethod
    public void setup() throws MalformedObjectNameException {
        TestDetector.reset();
        Configuration config = new Configuration(ConfigKey.MBEAN_QUALIFIER,"qualifier=test");
        handler = new MBeanServerHandler(config,getEmptyLogHandler());
        request = new JmxRequestBuilder(RequestType.READ,"java.lang:type=Memory").attribute("HeapMemoryUsage").build();
    }
View Full Code Here

    @BeforeMethod
    public void setup() {
        backend = createMock(BackendManager.class);
        expect(backend.isDebug()).andReturn(true).anyTimes();

        handler = new HttpRequestHandler(new Configuration(),backend, createDummyLogHandler());
    }
View Full Code Here

    private LogHandler log = new LogHandler.StdoutLogHandler(true);

    @BeforeTest
    public void setup() {
        config = new Configuration(ConfigKey.AGENT_ID,"test");
    }
View Full Code Here

    public void setup() {
        config = new Configuration(ConfigKey.AGENT_ID,"test");
    }
    @Test
    public void simpleRead() throws MalformedObjectNameException, InstanceNotFoundException, IOException, ReflectionException, AttributeNotFoundException, MBeanException {
        Configuration config = new Configuration(ConfigKey.DEBUG,"true",ConfigKey.AGENT_ID,"test");

        BackendManager backendManager = new BackendManager(config, log);
        JmxRequest req = new JmxRequestBuilder(RequestType.READ,"java.lang:type=Memory")
                .attribute("HeapMemoryUsage")
                .build();
View Full Code Here

        backendManager.destroy();
    }

    @Test
    public void notChanged() throws MalformedObjectNameException, MBeanException, AttributeNotFoundException, ReflectionException, InstanceNotFoundException, IOException {
        Configuration config = new Configuration(ConfigKey.DISPATCHER_CLASSES,RequestDispatcherTest.class.getName(),ConfigKey.AGENT_ID,"test");
        BackendManager backendManager = new BackendManager(config, log);
        JmxRequest req = new JmxRequestBuilder(RequestType.LIST).build();
        JSONObject ret = backendManager.handleRequest(req);
        assertEquals(ret.get("status"),304);
        backendManager.destroy();
View Full Code Here

    }

    @Test
    public void requestDispatcher() throws MalformedObjectNameException, InstanceNotFoundException, IOException, ReflectionException, AttributeNotFoundException, MBeanException {
        config = new Configuration(ConfigKey.DISPATCHER_CLASSES,RequestDispatcherTest.class.getName(),ConfigKey.AGENT_ID,"test");
        BackendManager backendManager = new BackendManager(config, log);
        JmxRequest req = new JmxRequestBuilder(RequestType.READ,"java.lang:type=Memory").build();
        backendManager.handleRequest(req);
        assertTrue(RequestDispatcherTest.called);
        backendManager.destroy();
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.