Package org.jolokia.request

Examples of org.jolokia.request.JmxRequestBuilder


        execute(request);
    }

    @Test(expectedExceptions = { IllegalArgumentException.class })
    public void invalidPath2() throws Exception {
        JmxListRequest request = new JmxRequestBuilder(RequestType.LIST)
                .pathParts("java.lang", "type=Runtime", "op", "bla")
                .option(ConfigKey.MAX_DEPTH,"3")
                .build();
        execute(request);
    }
View Full Code Here


        execute(request);
    }

    @Test(expectedExceptions = { IllegalArgumentException.class })
    public void invalidPath3() throws Exception {
        JmxListRequest request = new JmxRequestBuilder(RequestType.LIST)
                .pathParts("java.lang", "type=Runtime", "bla")
                .option(ConfigKey.MAX_DEPTH,"3")
                .build();
        execute(request);
    }
View Full Code Here

        execute(request);
    }

    @Test(expectedExceptions = { IllegalArgumentException.class })
    public void invalidPath4() throws Exception {
        JmxListRequest request = new JmxRequestBuilder(RequestType.LIST)
                .pathParts("java.lang", "type=*")
                .build();
        execute(request);
    }
View Full Code Here

    @Test
    public void invalidPath5() throws Exception {
        for (String what : new String[] { "attr", "op", "not" }) {
            try {
                JmxListRequest request = new JmxRequestBuilder(RequestType.LIST)
                        .pathParts("java.lang", "type=Memory", what, "HeapMemoryUsage", "bla")
                        .build();
                execute(request);
                fail();
            } catch (IllegalArgumentException exp) {
View Full Code Here

        }
    }

    @Test(expectedExceptions = { IllegalArgumentException.class }, expectedExceptionsMessageRegExp = ".*bla.*")
    public void invalidPath8() throws Exception {
        JmxListRequest request = new JmxRequestBuilder(RequestType.LIST)
                .pathParts("java.lang", "type=Memory", "desc", "bla")
                .build();
        execute(request);
    }
View Full Code Here

    }


    @Test
    public void emptyMaps() throws Exception {
        JmxListRequest request = new JmxRequestBuilder(RequestType.LIST)
                .pathParts("java.lang", "type=Runtime", "op")
                .build();
        Map res = (Map) handler.handleRequest(executor,request);
        assertEquals(res.size(),0);

        request = new JmxRequestBuilder(RequestType.LIST)
                .pathParts("java.lang", "type=Runtime", "not")
                .build();
        res = (Map) handler.handleRequest(executor,request);
        assertEquals(res.size(),0);
    }
View Full Code Here

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

    @Test
    public void singleMBeanMultipleServers() throws MalformedObjectNameException, InstanceNotFoundException, IOException, AttributeNotFoundException, ReflectionException, MBeanException, IntrospectionException, NotChangedException {
        JmxListRequest request = new JmxRequestBuilder(RequestType.LIST)
                .pathParts("java.lang", "type=Memory", "attr")
                .build();
        MBeanServerConnection dummyConn = EasyMock.createMock(MBeanServerConnection.class);
        Set<MBeanServerConnection> conns = new LinkedHashSet<MBeanServerConnection>();
        conns.add(dummyConn);
View Full Code Here

        assertEquals(((Map) res.get("Verbose")).get("type"),"boolean");
    }

    @Test(expectedExceptions = IllegalArgumentException.class, expectedExceptionsMessageRegExp = ".*No MBean.*")
    public void noMBeanMultipleServers() throws MalformedObjectNameException, InstanceNotFoundException, IOException, AttributeNotFoundException, ReflectionException, MBeanException, IntrospectionException, NotChangedException {
        JmxListRequest request = new JmxRequestBuilder(RequestType.LIST)
                .pathParts("bullerbue", "country=sweden")
                .build();
        MBeanServer dummyConn = EasyMock.createMock(MBeanServer.class);

        MBeanServerExecutor servers = getMBeanServerManager(dummyConn, ManagementFactory.getPlatformMBeanServer());
View Full Code Here

TOP

Related Classes of org.jolokia.request.JmxRequestBuilder

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.