@Test
public void testSetAttribute() throws Exception {

    Attribute attribute = new Attribute("ID.enabled", "false");
    jmx.setAttribute(attribute);
    assertThat(jmx.getAttribute("ID.enabled").toString(), is("false"));
    attribute = new Attribute("ID.limit", "8");
    jmx.setAttribute(attribute);
    assertThat(jmx.getAttribute("ID.limit").toString(), is("8"));
    try {
        attribute = new Attribute("something", "enable");
        jmx.setAttribute(attribute);
        fail("there is no attribute with specified key");
    } catch (AttributeNotFoundException ex) {
        // it's OK
    }
}