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"));
}