@@ -0,0 +1,2243 @@
+package alma.alarmsystem.clients.test;%0A%0Aimport cern.laser.client.data.Alarm;%0Aimport cern.laser.client.services.selection.AlarmSelectionListener;%0Aimport cern.laser.client.services.selection.LaserSelectionException;%0Aimport alma.acs.component.client.ComponentClientTestCase;%0Aimport alma.alarmsystem.clients.CategoryClient;%0A%0Apublic class CategoryClientChildren extends ComponentClientTestCase implements AlarmSelectionListener %7B%0A%09/**%0A%09 *  The categoryClient to test%0A%09 */%0A%09private CategoryClient categoryClient;%0A%09%0A%09/**%0A%09 * Constructor%0A%09 * %0A%09 * @throws Exception%0A%09 */%0A%09public CategoryClientChildren() throws Exception %7B%0A%09%09super(CategoryClientThreshold.class.getName());%0A%09%7D%0A%09%0A%09/**%0A%09 * @see extends ComponentClientTestCase%0A%09 */%0A%09public void setUp() throws Exception %7B%0A%09%09super.setUp();%0A%09%09%0A%09%09categoryClient = new CategoryClient(getContainerServices());%0A%09%09assertNotNull(categoryClient);%0A%09%7D%0A%09%0A%09/**%0A%09 * @see extends ComponentClientTestCase%0A%09 */%0A%09public void teraDown() throws Exception %7B%0A%09%09categoryClient.close();%0A%09%09super.tearDown();%0A%09%7D%0A%0A%09/**%0A%09 * @see cern.laser.client.services.selection.AlarmSelectionListener#onAlarm(cern.laser.client.data.Alarm)%0A%09 */%0A%09@Override%0A%09public void onAlarm(Alarm alarm) %7B%09%7D%0A%0A%09/**%0A%09 * @see cern.laser.client.services.selection.AlarmSelectionListener#onException(cern.laser.client.services.selection.LaserSelectionException)%0A%09 */%0A%09@Override%0A%09public void onException(LaserSelectionException e) %7B%7D%0A%09%0A%09/**%0A%09 * Test getParents for NODE and MULTIPLICITY reduction%0A%09 * %0A%09 * @throws Exception%0A%09 */%0A%09public void testGetNodeChildren() throws Exception %7B%0A%09%09categoryClient.connect(this);%0A%09%09%0A%09%09// Multiplicity%0A%09%09alma.alarmsystem.Alarm%5B%5D alarms = categoryClient.getChildren(%22TEST:MCAUSE:1%22, false);%0A%09%09assertEquals(5, alarms.length);%0A%09%09%0A%09%09alarms = categoryClient.getChildren(%22TEST:MULTI3:2%22, false);%0A%09%09assertEquals(0, alarms.length);%0A%09%09%0A%09%09// Node%0A%09%09alarms= categoryClient.getChildren(%22TEST:NODE1:1%22, true);%0A%09%09assertEquals(1, alarms.length);%0A%09%09assertEquals(%22TEST:NODE2:1%22, alarms%5B0%5D.alarmId);%0A%09%09%0A%09%09alarms= categoryClient.getChildren(%22TEST:NODE2:1%22, true);%0A%09%09assertEquals(1, alarms.length);%0A%09%09assertEquals(%22TEST:NODE3:1%22, alarms%5B0%5D.alarmId);%0A%09%09%0A%09%09alarms= categoryClient.getChildren(%22TEST:NODE3:1%22, true);%0A%09%09assertEquals(0, alarms.length);%0A%09%7D%0A%7D%0A

Test getChildren of the CategoryClient