Package org.jolokia.request

Examples of org.jolokia.request.JmxWriteRequest


    }


    @Test
    public void simple() throws MalformedObjectNameException, InstanceNotFoundException, IOException, ReflectionException, AttributeNotFoundException, MBeanException {
        JmxWriteRequest req = new JmxRequestBuilder(WRITE,oName).attribute("Simple").value("10").build();
        handler.doHandleRequest(getMBeanServer(),req);
        req = new JmxRequestBuilder(WRITE,oName).attribute("Simple").value("20").build();
        Integer ret = (Integer) handler.doHandleRequest(getMBeanServer(),req);
        assertEquals(ret,new Integer(10));
        assertEquals(handler.getType(),WRITE);
View Full Code Here


    @Test
    public void map() throws Exception {
        Map map = new HashMap<String,Integer>();
        map.put("answer",42);
        JmxWriteRequest req = new JmxRequestBuilder(WRITE,oName).attribute("Map").value(map).build();
        handler.doHandleRequest(getMBeanServer(),req);
        req = new JmxRequestBuilder(WRITE,oName).attribute("Map").value(null).build();
        Map ret = (Map) handler.doHandleRequest(getMBeanServer(),req);
        assertTrue(ret instanceof Map);
        assertEquals(((Map) ret).get("answer"),42);
View Full Code Here

    }

    @Test(expectedExceptions = {AttributeNotFoundException.class})
    public void invalidAttribute() throws MalformedObjectNameException, InstanceNotFoundException, IOException, ReflectionException, AttributeNotFoundException, MBeanException {
        JmxWriteRequest req = new JmxRequestBuilder(WRITE,oName).attribute("ReadOnly").value("Sommer").build();
        handler.doHandleRequest(getMBeanServer(),req);
    }
View Full Code Here

        handler.doHandleRequest(getMBeanServer(),req);
    }

    @Test
    public void invalidValue() throws Exception {
        JmxWriteRequest req = new JmxRequestBuilder(WRITE,oName).attribute("Boolean").value(10).build();
        handler.doHandleRequest(getMBeanServer(),req);
    }
View Full Code Here

TOP

Related Classes of org.jolokia.request.JmxWriteRequest

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.