Search in sources :

Example 1 with SpecialAlarm

use of alma.acsplugins.alarmsystem.gui.specialalarm.SpecialAlarm in project ACS by ACS-Community.

the class SpecialAlarmTest method testSetState.

public void testSetState() throws Exception {
    SpecialAlarm alarm = new SpecialAlarm(family, member, code, true, action, description, cause, consequences, priority, url, email, props);
    alarm.setStatus(false);
    assertFalse(alarm.getStatus().isActive());
    alarm.setStatus(true);
    assertTrue(alarm.getStatus().isActive());
}
Also used : SpecialAlarm(alma.acsplugins.alarmsystem.gui.specialalarm.SpecialAlarm)

Example 2 with SpecialAlarm

use of alma.acsplugins.alarmsystem.gui.specialalarm.SpecialAlarm in project ACS by ACS-Community.

the class SpecialAlarmTest method testSpecialAlarmTest.

public void testSpecialAlarmTest() throws Exception {
    Alarm alarm = new SpecialAlarm(family, member, code, true, action, description, cause, consequences, priority, url, email, props);
    assertEquals(alarm.getTriplet().getFaultFamily(), family);
    assertEquals(alarm.getTriplet().getFaultMember(), member);
    assertEquals(alarm.getTriplet().getFaultCode(), Integer.valueOf(code));
    assertEquals(alarm.getHelpURL().toString(), url);
    assertEquals(alarm.getAction(), action);
    assertEquals(alarm.getCause(), cause);
    assertEquals(alarm.getConsequence(), consequences);
    assertEquals(alarm.getPiquetEmail(), email);
    assertEquals(alarm.getProblemDescription(), description);
    assertEquals(alarm.getPriority(), Integer.valueOf(priority));
    assertEquals(alarm.getStatus().isActive(), true);
    assertEquals(family + ":" + member + ":" + code, alarm.getAlarmId());
    Properties p = alarm.getStatus().getUserProperties();
    assertNotNull(p);
    assertTrue(p.size() == 2);
    String v1 = p.getProperty(prop1Key);
    assertEquals(prop1Val, v1);
    String v2 = p.getProperty(prop2Key);
    assertEquals(prop2Val, v2);
}
Also used : Alarm(cern.laser.client.data.Alarm) SpecialAlarm(alma.acsplugins.alarmsystem.gui.specialalarm.SpecialAlarm) SpecialAlarm(alma.acsplugins.alarmsystem.gui.specialalarm.SpecialAlarm) Properties(java.util.Properties)

Example 3 with SpecialAlarm

use of alma.acsplugins.alarmsystem.gui.specialalarm.SpecialAlarm in project ACS by ACS-Community.

the class SpecialAlarmTest method testSetProperties.

public void testSetProperties() throws Exception {
    SpecialAlarm alarm = new SpecialAlarm(family, member, code, true, action, description, cause, consequences, priority, url, email, props);
    String k = "TheKey";
    String v = "ValVal";
    Properties newP = new Properties();
    newP.put(k, v);
    alarm.setUserProperties(newP);
    Properties p = alarm.getStatus().getUserProperties();
    assertNotNull(p);
    assertTrue(p.size() == 1);
    Object val = p.get(k);
    assertNotNull(val);
    assertEquals(val.toString(), v);
}
Also used : SpecialAlarm(alma.acsplugins.alarmsystem.gui.specialalarm.SpecialAlarm) Properties(java.util.Properties)

Example 4 with SpecialAlarm

use of alma.acsplugins.alarmsystem.gui.specialalarm.SpecialAlarm in project ACS by ACS-Community.

the class SpecialAlarmTest method testCreateSpecialAlarmWronglURL.

/**
	 * Test the creation of the alarm when the URL is <code>null</code>.
	 */
public void testCreateSpecialAlarmWronglURL() throws Exception {
    Alarm alarmNull = new SpecialAlarm(family, member, code, true, action, description, cause, consequences, priority, null, email, props);
    assertNull(alarmNull.getHelpURL());
    Alarm alarmEmpty = new SpecialAlarm(family, member, code, true, action, description, cause, consequences, priority, "", email, props);
    assertNull(alarmEmpty.getHelpURL());
}
Also used : Alarm(cern.laser.client.data.Alarm) SpecialAlarm(alma.acsplugins.alarmsystem.gui.specialalarm.SpecialAlarm) SpecialAlarm(alma.acsplugins.alarmsystem.gui.specialalarm.SpecialAlarm)

Aggregations

SpecialAlarm (alma.acsplugins.alarmsystem.gui.specialalarm.SpecialAlarm)4 Alarm (cern.laser.client.data.Alarm)2 Properties (java.util.Properties)2