Search in sources :

Example 11 with ACSAlarmSystemInterface

use of alma.alarmsystem.source.ACSAlarmSystemInterface in project ACS by ACS-Community.

the class ProxyTest method testAlarmsCollection.

/**
	 * Test the push of a collection of alarms
	 * 
	 * @throws Exception
	 */
public void testAlarmsCollection() throws Exception {
    String FF1 = "TestFamily - 1";
    String FM1 = "TestMember - 1";
    int FC1 = 0;
    ACSFaultState fs1 = ACSAlarmSystemInterfaceFactory.createFaultState(FF1, FM1, FC1);
    assertNotNull("Error creating a FS", fs1);
    fs1.setDescriptor("Description of Al1");
    String FF2 = "TestFamily - 2";
    String FM2 = "TestMember - 2";
    int FC2 = 1;
    ACSFaultState fs2 = ACSAlarmSystemInterfaceFactory.createFaultState(FF2, FM2, FC2);
    assertNotNull("Error creating a FS", fs2);
    fs2.setDescriptor("Description of Al2");
    String FF3 = "TestFamily - 3";
    String FM3 = "TestMember - 3";
    int FC3 = 2;
    ACSFaultState fs3 = ACSAlarmSystemInterfaceFactory.createFaultState(FF3, FM3, FC3);
    assertNotNull("Error creating a FS", fs3);
    fs3.setDescriptor("Description of Al3");
    Collection alarms = new Vector();
    alarms.add(fs1);
    alarms.add(fs2);
    alarms.add(fs3);
    assertEquals("Wrong collection size", alarms.size(), 3);
    ACSAlarmSystemInterface source = ACSAlarmSystemInterfaceFactory.createSource();
    assertNotNull("Error creating the Alarm source", source);
    source.pushActiveList(alarms);
}
Also used : ACSFaultState(alma.alarmsystem.source.ACSFaultState) ACSAlarmSystemInterface(alma.alarmsystem.source.ACSAlarmSystemInterface) Collection(java.util.Collection) Vector(java.util.Vector)

Example 12 with ACSAlarmSystemInterface

use of alma.alarmsystem.source.ACSAlarmSystemInterface in project ACS by ACS-Community.

the class ProxyTest method testPushAlarm.

/**
	 * Test the push of an alarm
	 * 
	 * @throws Exception
	 */
public void testPushAlarm() throws Exception {
    String FF = "TestFamily";
    String FM = "TestMember";
    int FC = 1;
    String descriptor = "Alarm for test";
    ACSFaultState fs = ACSAlarmSystemInterfaceFactory.createFaultState(FF, FM, FC);
    assertNotNull("Error creating the FaultState", fs);
    fs.setDescriptor(descriptor);
    ACSAlarmSystemInterface source = ACSAlarmSystemInterfaceFactory.createSource();
    assertNotNull("Error creating the Alarm Source", source);
    source.push(fs);
}
Also used : ACSFaultState(alma.alarmsystem.source.ACSFaultState) ACSAlarmSystemInterface(alma.alarmsystem.source.ACSAlarmSystemInterface)

Aggregations

ACSAlarmSystemInterface (alma.alarmsystem.source.ACSAlarmSystemInterface)12 ACSFaultState (alma.alarmsystem.source.ACSFaultState)10 Timestamp (java.sql.Timestamp)6 Properties (java.util.Properties)2 AlarmSystemInterfaceProxy (cern.laser.source.alarmsysteminterface.impl.AlarmSystemInterfaceProxy)1 Collection (java.util.Collection)1 Vector (java.util.Vector)1