Examples of ISimpleMXBean


Examples of org.apache.camel.component.jmx.beans.ISimpleMXBean

        super.setUp();
    }

    @Test
    public void test() throws Exception {
        ISimpleMXBean simpleBean = getSimpleMXBean();
        simpleBean.userData("myUserData");

        waitForMessages();

        Message m = getMessage(0);
        URI uri = (URI) m.getHeader("jmx.handback");
View Full Code Here

Examples of org.apache.camel.component.jmx.beans.ISimpleMXBean

*/
public class JMXObjectPropertiesTest extends SimpleBeanFixture {

    @Test
    public void testObjectProperties() throws Exception {
        ISimpleMXBean bean = getSimpleMXBean();
        bean.touch();
        waitForMessages();
    }
View Full Code Here

Examples of org.apache.camel.component.jmx.beans.ISimpleMXBean

     */
    private LinkedHashSet<Notification> mRejected = new LinkedHashSet<Notification>();

    @Test
    public void testNotificationFilter() throws Exception {
        ISimpleMXBean bean = getSimpleMXBean();

        assertEquals("no notifications should have been filtered at this point", 0, mRejected.size());

        // we should only get 5 messages, which is 1/2 the number of times we touched the object.
        // The 1/2 is due to the behavior of the test NotificationFilter implemented below
        getMockEndpoint().setExpectedMessageCount(5);
        for (int i = 0; i < 10; i++) {
            bean.touch();
        }

        waitForMessages();
        assertEquals("5 notifications should have been filtered", 5, mRejected.size());

View Full Code Here

Examples of org.apache.camel.component.jmx.beans.ISimpleMXBean

        assertEquals(0, mMonitorSink.getReceivedCounter());

        mMonitorSink.setExpectedMessageCount(1);
        getMockEndpoint().setExpectedMessageCount(2);

        ISimpleMXBean simpleBean = getSimpleMXBean();

        // we should get an event after the sequence reaches 2

        // changing the attrib increments the sequence
        simpleBean.setStringValue("foo");
        // changing the attrib increments the sequence again
        simpleBean.setStringValue("bar");

        // we should have gotten 2 attribute change messages
        waitForMessages();

        // and 1 monitor message
View Full Code Here

Examples of org.apache.camel.component.jmx.beans.ISimpleMXBean

public class JMXMonitorTypeStringMatchesTest extends SimpleBeanFixture {
   
    @Test
    public void matches() throws Exception {

        ISimpleMXBean simpleBean = getSimpleMXBean();
       
        simpleBean.setStringValue("bogus");
        Thread.sleep(600);
        simpleBean.setStringValue("initial");
        getMockFixture().waitForMessages();
        getMockFixture().assertMessageReceived(new File("src/test/resources/monitor-consumer/stringMatches.xml"));
    }
View Full Code Here

Examples of org.apache.camel.component.jmx.beans.ISimpleMXBean

        super.setUp();
    }

    @Test
    public void test() throws Exception {
        ISimpleMXBean simpleBean = getSimpleMXBean();
        simpleBean.userData("myUserData");

        getMockFixture().waitForMessages();

        Message m = getMockFixture().getMessage(0);
        URI uri = (URI) m.getHeader("jmx.handback");
View Full Code Here

Examples of org.apache.camel.component.jmx.beans.ISimpleMXBean

public class JMXMonitorTypeStringDiffersTest extends SimpleBeanFixture {
   
    @Test
    public void differs() throws Exception {

        ISimpleMXBean simpleBean = getSimpleMXBean();
       
        simpleBean.setStringValue("changed");
        getMockFixture().waitForMessages();
        getMockFixture().assertMessageReceived(new File("src/test/resources/monitor-consumer/stringDiffers.xml"));
    }
View Full Code Here

Examples of org.apache.camel.component.jmx.beans.ISimpleMXBean

*/
public class JMXObjectPropertiesTest extends SimpleBeanFixture {

    @Test
    public void testObjectProperties() throws Exception {
        ISimpleMXBean bean = getSimpleMXBean();
        bean.touch();
        getMockFixture().waitForMessages();
    }
View Full Code Here

Examples of org.apache.camel.component.jmx.beans.ISimpleMXBean

public class JMXMonitorTypeGaugeTest extends SimpleBeanFixture {
   
    @Test
    public void gauge() throws Exception {

        ISimpleMXBean simpleBean = getSimpleMXBean();
       
        // we should get an event after the number exceeds 100 or drops below 50
        simpleBean.setMonitorNumber(75);
        simpleBean.setMonitorNumber(110);
        getMockFixture().waitForMessages();
        getMockFixture().assertMessageReceived(new File("src/test/resources/monitor-consumer/gaugeNotification-high.xml"));
       
        getMockFixture().getMockEndpoint().setExpectedMessageCount(1);
        simpleBean.setMonitorNumber(90);
        Thread.sleep(600);
        simpleBean.setMonitorNumber(60);
        Thread.sleep(600);
        simpleBean.setMonitorNumber(40);
        getMockFixture().waitForMessages();
        getMockFixture().assertMessageReceived(new File("src/test/resources/monitor-consumer/gaugeNotification-low.xml"));
    }
View Full Code Here

Examples of org.apache.camel.component.jmx.beans.ISimpleMXBean

     */
    private LinkedHashSet<Notification> mRejected = new LinkedHashSet<Notification>();

    @Test
    public void testNotificationFilter() throws Exception {
        ISimpleMXBean bean = getSimpleMXBean();

        assertEquals("no notifications should have been filtered at this point", 0, mRejected.size());

        // we should only get 5 messages, which is 1/2 the number of times we touched the object.
        // The 1/2 is due to the behavior of the test NotificationFilter implemented below
        getMockFixture().getMockEndpoint().setExpectedMessageCount(5);
        for (int i = 0; i < 10; i++) {
            bean.touch();
        }

        getMockFixture().waitForMessages();
        assertEquals("5 notifications should have been filtered", 5, mRejected.size());

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.