use of alma.alarmsystem.clients.alarm.AlarmStatistics in project ACS by ACS-Community.
the class AlarmStatisticsTest method setUp.
@Override
protected void setUp() throws Exception {
stats = new AlarmStatistics();
assertNotNull(stats);
super.setUp();
}
use of alma.alarmsystem.clients.alarm.AlarmStatistics in project ACS by ACS-Community.
the class AlarmListenerContainerTest method testDispatchStats.
/**
* Test the dispatching of statistics
*/
public void testDispatchStats() throws Exception {
AlarmStatistics stats = new AlarmStatistics();
assertNotNull(stats);
AlrmStatListenerForTesting stat1 = new AlrmStatListenerForTesting();
assertTrue(container.addStatsListener(stat1));
AlrmStatListenerForTesting stat2 = new AlrmStatListenerForTesting();
assertTrue(container.addStatsListener(stat2));
assertEquals(2, container.getStatListenersSize());
assertEquals(0, stat1.numActivationNoifies);
assertEquals(0, stat1.numReductionNofies);
assertEquals(0, stat2.numActivationNoifies);
assertEquals(0, stat2.numReductionNofies);
final int numNotifies = 10;
for (int t = 1; t < numNotifies + 1; t++) {
container.dispatchStatistics(stats);
assertEquals(t, stat1.numActivationNoifies);
assertEquals(t, stat1.numReductionNofies);
assertEquals(t, stat2.numActivationNoifies);
assertEquals(t, stat2.numReductionNofies);
}
}
Aggregations