Examples of ISimpleMXBean


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

public class JMXMonitorTypeCounterTest extends SimpleBeanFixture {
   
    @Test
    public void counter() throws Exception {

        ISimpleMXBean simpleBean = getSimpleMXBean();
       
        // we should get an event after the monitor number reaches 3
        simpleBean.setMonitorNumber(1);
        // this should trigger a notification
        simpleBean.setMonitorNumber(3);
       
        // we should get 1 change from the counter bean
        getMockFixture().waitForMessages();
        getMockFixture().assertMessageReceived(new File("src/test/resources/monitor-consumer/monitorNotification.xml"));
       
        // the offset value was two, so another change won't trigger an event.
        // it'll take 2 more changes to trigger the event
        getMockFixture().getMockEndpoint().setExpectedMessageCount(1);
        simpleBean.setMonitorNumber(4);
        simpleBean.setMonitorNumber(5);
        getMockFixture().waitForMessages();
        getMockFixture().assertMessageReceived(new File("src/test/resources/monitor-consumer/monitorNotification-2.xml"));
    }
View Full Code Here

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

public class JMXMonitorTypeLongCounterTest extends SimpleBeanFixture {
   
    @Test
    public void counter() throws Exception {

        ISimpleMXBean simpleBean = getSimpleMXBean();
       
        // we should get an event after the monitor number reaches 3
        simpleBean.setLongNumber(1L);
        // this should trigger a notification
        simpleBean.setLongNumber(3L);
       
        // we should get 1 change from the counter bean
        getMockFixture().waitForMessages();
        getMockFixture().assertMessageReceived(new File("src/test/resources/monitor-consumer/monitorNotificationLong.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

     */
    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.