Examples of JmxRequestBuilder


Examples of org.jolokia.request.JmxRequestBuilder

                              new JmxRequestBuilder(RequestType.SEARCH, "java.lang:*").<JmxSearchRequest>build());
    }

    @Test
    public void handleAllServersAtOnce() throws MalformedObjectNameException {
        assertTrue(handler.handleAllServersAtOnce(new JmxRequestBuilder(RequestType.SEARCH, "java.lang:*").<JmxSearchRequest>build()));
    }
View Full Code Here

Examples of org.jolokia.request.JmxRequestBuilder

        verify(server);
    }

    private List<String> doSearch(String pPattern, String pUseCanonicalName, String ... pFoundNames) throws MalformedObjectNameException, IOException, InstanceNotFoundException, AttributeNotFoundException, ReflectionException, MBeanException, NotChangedException {
        ObjectName oName = new ObjectName(pPattern);
        JmxSearchRequest request = new JmxRequestBuilder(RequestType.SEARCH,oName).option(ConfigKey.CANONICAL_NAMING,pUseCanonicalName).build();

        server = createMock(MBeanServer.class);
        Set<ObjectName> names = new HashSet<ObjectName>();
        for (String name : pFoundNames) {
            names.add(new ObjectName(name));
View Full Code Here

Examples of org.jolokia.request.JmxRequestBuilder

     * If a field in the argument is not set it will be set to its default value
     */
    @Test
    public void missingField() throws InstanceNotFoundException, IOException, ReflectionException, AttributeNotFoundException, MBeanException, MalformedObjectNameException, NotChangedException {
      // set a value just for stringField, leave out intField
        JmxExecRequest request = new JmxRequestBuilder(EXEC, oName).
                operation("compositeData").
                arguments("{ \"stringField\":\"aString\" }").
                build();
        CompositeData data  = (CompositeData) handler.handleRequest(getMBeanServer(),request);
        assertEquals(data.get("stringField"),"aString");
View Full Code Here

Examples of org.jolokia.request.JmxRequestBuilder

     * set a non-existing field
     */
    @Test(expectedExceptions={IllegalArgumentException.class})
    public void invalidField() throws MalformedObjectNameException, InstanceNotFoundException, AttributeNotFoundException, ReflectionException, MBeanException, IOException, NotChangedException {
      // set a value just for stringField, leave out intField
        JmxExecRequest request = new JmxRequestBuilder(EXEC, oName).
                operation("compositeData").
                arguments("{ \"nonExistentField\":\"aString\" }").
                build();
        handler.handleRequest(getMBeanServer(),request);     
    }   
View Full Code Here

Examples of org.jolokia.request.JmxRequestBuilder

    /**
     * Give an invalid value (wrong type) for the field
     */
    @Test(expectedExceptions={ NumberFormatException.class })
    public void invalidValueForField() throws MalformedObjectNameException, InstanceNotFoundException, AttributeNotFoundException, ReflectionException, MBeanException, IOException, NotChangedException {
        JmxExecRequest request = new JmxRequestBuilder(EXEC, oName).
            operation("compositeData").
            arguments("{ \"intField\":\"aString\" }").
            build();
        handler.handleRequest(getMBeanServer(),request);     
    }
View Full Code Here

Examples of org.jolokia.request.JmxRequestBuilder

    /**
     * The operation argument is an array
     */
    @Test
    public void arrayOfComposites() throws InstanceNotFoundException, IOException, ReflectionException, AttributeNotFoundException, MBeanException, MalformedObjectNameException, NotChangedException {
        JmxExecRequest request = new JmxRequestBuilder(EXEC, oName).
                operation("arrayData").
                arguments("[ { \"stringField\":\"aString\" } ]").
                build();
        handler.handleRequest(getMBeanServer(),request);
    }
View Full Code Here

Examples of org.jolokia.request.JmxRequestBuilder

    /**
     * The operation argument is a List
     */
    @Test
    public void listOfComposites() throws InstanceNotFoundException, IOException, ReflectionException, AttributeNotFoundException, MBeanException, MalformedObjectNameException, NotChangedException {
        JmxExecRequest request = new JmxRequestBuilder(EXEC, oName).
                operation("listData").
                arguments("[ { \"stringField\":\"aString\" } ]").
                build();
        handler.handleRequest(getMBeanServer(),request);
    }
View Full Code Here

Examples of org.jolokia.request.JmxRequestBuilder

    /**
     * The operation argument is a Set
     */
    @Test
    public void setOfComposites() throws InstanceNotFoundException, IOException, ReflectionException, AttributeNotFoundException, MBeanException, MalformedObjectNameException, NotChangedException {
        JmxExecRequest request = new JmxRequestBuilder(EXEC, oName).
                operation("opSetData").
                arguments("[ { \"stringField\":\"aString\" } ]").
                build();
        handler.handleRequest(getMBeanServer(),request);
    }
View Full Code Here

Examples of org.jolokia.request.JmxRequestBuilder

    /**
     * The operation argument is a Map
     */
    @Test
    public void mapOfComposites() throws InstanceNotFoundException, IOException, ReflectionException, AttributeNotFoundException, MBeanException, MalformedObjectNameException, NotChangedException {
        JmxExecRequest request = new JmxRequestBuilder(EXEC, oName).
                operation("mapData").
                arguments("{ \"aKey\":{ \"stringField\":\"aString\" } }").
                build();
        handler.handleRequest(getMBeanServer(),request);
    }
View Full Code Here

Examples of org.jolokia.request.JmxRequestBuilder

    /**
     * Set a nested field inside the composite argument
     */
    @Test
    public void nested() throws MalformedObjectNameException, InstanceNotFoundException, AttributeNotFoundException, ReflectionException, MBeanException, IOException, NotChangedException {
        JmxExecRequest request = new JmxRequestBuilder(EXEC, oName).
        operation("compositeData").
        arguments("{ \"nestedClass\":{\"nestedField\":\"aString\"} }").
        build();
        handler.handleRequest(getMBeanServer(),request);           
    }
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.