Search in sources :

Example 1 with LaserSelectionException

use of cern.laser.client.services.selection.LaserSelectionException in project ACS by ACS-Community.

the class AlarmListenerContainerTest method testDispatchException.

/**
	 * Test the dispatching of exception
	 * 
	 * 
	 */
public void testDispatchException() throws Exception {
    assertEquals(0, container.getAlarmListenersSize());
    AlarmListenerForTesting alarmL1 = new AlarmListenerForTesting("AlarmListenerName");
    AlarmListener listener1 = container.addAlarmListener(alarmL1);
    assertNotNull(listener1);
    assertEquals(1, container.getAlarmListenersSize());
    assertEquals(0, container.getStatListenersSize());
    int numExceptions = 25;
    for (int t = 1; t < numExceptions + 1; t++) {
        container.dispatchException(new LaserSelectionException("Code_" + t));
        assertEquals(t, alarmL1.numExceptions);
        assertEquals(0, alarmL1.numAlarms);
    }
}
Also used : LaserSelectionException(cern.laser.client.services.selection.LaserSelectionException) AlarmListenerForTesting(alma.alarmsystem.clients.test.utils.AlarmListenerForTesting) AlarmListener(alma.alarmsystem.clients.alarm.AlarmListenersContainer.AlarmListener)

Aggregations

AlarmListener (alma.alarmsystem.clients.alarm.AlarmListenersContainer.AlarmListener)1 AlarmListenerForTesting (alma.alarmsystem.clients.test.utils.AlarmListenerForTesting)1 LaserSelectionException (cern.laser.client.services.selection.LaserSelectionException)1