Package org.jolokia.request

Examples of org.jolokia.request.JmxListRequest


    }

    @Test
    public void plainTest() throws Exception {

        JmxListRequest request = new JmxRequestBuilder(RequestType.LIST).build();

        MBeanServerConnection connection = createMock(MBeanServerConnection.class);
        Set<ObjectName> nameSet = new HashSet<ObjectName>();
        for (String name : new String[] { "java.lang:type=Memory", "java.lang:type=Runtime" }) {
            ObjectName oName = new ObjectName(name);
View Full Code Here




    @Test
    public void iOException() throws Exception {
        JmxListRequest request = new JmxRequestBuilder(RequestType.LIST).build();

        MBeanServerConnection connection = prepareForIOException(false);


        Map res = (Map) handler.handleRequest(getMBeanServerManager(connection),request);
View Full Code Here

        assertEquals(rt.size(),1);
    }

    @Test(expectedExceptions = {IOException.class})
    public void iOExceptionWithPath() throws Exception {
        JmxListRequest request = new JmxRequestBuilder(RequestType.LIST).pathParts("java.lang","type=Runtime","attr").build();

        MBeanServerConnection server = prepareForIOException(true);
        Map res = (Map) handler.handleRequest(getMBeanServerManager(server),request);
    }
View Full Code Here

    }

    @Test
    public void singleSlashPath() throws Exception {
        for (String p : new String[]{null, "", "/"}) {
            JmxListRequest request = new JmxRequestBuilder(RequestType.LIST).path(p).build();
            Map res = execute(request);
            assertTrue(res.containsKey("java.lang"));
            assertTrue(res.get("java.lang") instanceof Map);
        }
    }
View Full Code Here

        }
    }

    @Test
    public void domainPath() throws Exception {
        JmxListRequest request = new JmxRequestBuilder(RequestType.LIST).pathParts("java.lang").build();
        Map res = execute(request);
        assertTrue(res.containsKey("type=Memory"));
        assertTrue(res.get("type=Memory") instanceof Map);
    }
View Full Code Here

        assertTrue(res.get("type=Memory") instanceof Map);
    }

    @Test
    public void propertiesPath() throws Exception {
        JmxListRequest request = new JmxRequestBuilder(RequestType.LIST).pathParts("java.lang", "type=Memory").build();
        Map res = execute(request);
        for (String k : new String[]{"desc", "op", "attr"}) {
            assertTrue(res.containsKey(k));
        }
        assertEquals(res.size(), 3);
View Full Code Here

        assertEquals(res.size(), 3);
    }

    @Test
    public void attrPath() throws Exception {
        JmxListRequest request = new JmxRequestBuilder(RequestType.LIST).pathParts("java.lang","type=Memory","attr").build();
        Map res = execute(request);
        assertTrue(res.containsKey("HeapMemoryUsage"));
    }
View Full Code Here

        assertTrue(res.containsKey("HeapMemoryUsage"));
    }

    @Test
    public void descPath() throws Exception {
        JmxListRequest request = new JmxRequestBuilder(RequestType.LIST).pathParts("java.lang","type=Memory","desc").build();
        String res = (String) handler.handleRequest(executor, request);
        assertNotNull(res);
    }
View Full Code Here

        assertNotNull(res);
    }

    @Test
    public void descPathWithDepth() throws Exception {
        JmxListRequest request = new JmxRequestBuilder(RequestType.LIST)
                .pathParts("java.lang","type=Memory","desc")
                .option(ConfigKey.MAX_DEPTH,"4")
                .build();
        String res = (String) handler.handleRequest(executor, request);
        assertNotNull(res);
View Full Code Here

        assertNotNull(res);
    }

    @Test
    public void opPath() throws Exception {
        JmxListRequest request = new JmxRequestBuilder(RequestType.LIST).pathParts("java.lang","type=Memory","op").build();
        Map res = execute(request);
        assertTrue(res.containsKey("gc"));
    }
View Full Code Here

TOP

Related Classes of org.jolokia.request.JmxListRequest

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.