Search in sources :

Example 86 with Alarm

use of cern.laser.business.data.Alarm in project ACS by ACS-Community.

the class ReductionManagerTest method testSaveToCDB.

public void testSaveToCDB() {
    boolean exception;
    _alarmSystemManager.loadFromCDB();
    //ReductionManager.getInstance(_daoManager.getAlarmDAO());
    ReductionManager rm = _alarmSystemManager.getReductionManager();
    assertNotNull(rm);
    rm.loadFromCDB();
    exception = false;
    Alarm p = new AlarmImpl();
    Triplet tr = new Triplet("A1", "B1", 1);
    p.setTriplet(tr);
    Alarm c = new AlarmImpl();
    tr = new Triplet("A2", "B2", 2);
    c.setTriplet(tr);
    try {
        rm.addNodeReductionRule(p, c);
    //rm.deleteNodeReductionRule(p, c);
    } catch (IllegalOperationException e) {
        exception = true;
        e.printStackTrace();
    }
    assertFalse(exception);
    rm.saveToCDB();
}
Also used : Triplet(cern.laser.business.data.Triplet) Alarm(cern.laser.business.data.Alarm) AlarmImpl(cern.laser.business.data.AlarmImpl)

Example 87 with Alarm

use of cern.laser.business.data.Alarm in project ACS by ACS-Community.

the class ReductionRuleTest method testGetParent.

public void testGetParent() {
    Alarm alarm = new AlarmImpl();
    ReductionRule rr = new ReductionRule(alarm);
    assertNotNull(rr);
    Alarm alarm2 = rr.getParent();
    assertNotNull(alarm2);
    assertEquals(alarm, alarm2);
}
Also used : Alarm(cern.laser.business.data.Alarm) AlarmImpl(cern.laser.business.data.AlarmImpl)

Example 88 with Alarm

use of cern.laser.business.data.Alarm in project ACS by ACS-Community.

the class ReductionRuleTest method testReductionRule.

public void testReductionRule() {
    Alarm alarm = new AlarmImpl();
    ReductionRule rr = new ReductionRule(alarm);
    assertNotNull(rr);
}
Also used : Alarm(cern.laser.business.data.Alarm) AlarmImpl(cern.laser.business.data.AlarmImpl)

Example 89 with Alarm

use of cern.laser.business.data.Alarm in project ACS by ACS-Community.

the class ReductionRuleTest method testSetIsNodeReduction.

public void testSetIsNodeReduction() {
    Alarm alarm = new AlarmImpl();
    ReductionRule rr = new ReductionRule(alarm);
    rr.setIsNodeReduction(true);
    boolean v = rr.getIsNodeReduction();
    assertEquals(v, true);
    rr.setIsNodeReduction(false);
    v = rr.getIsNodeReduction();
    assertEquals(v, false);
}
Also used : Alarm(cern.laser.business.data.Alarm) AlarmImpl(cern.laser.business.data.AlarmImpl)

Example 90 with Alarm

use of cern.laser.business.data.Alarm in project ACS by ACS-Community.

the class ReductionRuleTest method testAddGetChildren.

public void testAddGetChildren() {
    Alarm alarm = new AlarmImpl();
    ReductionRule rr = new ReductionRule(alarm);
    Alarm[] alarms = new Alarm[10];
    for (int i = 0; i != 10; i++) {
        alarms[i] = new AlarmImpl();
        rr.addChild(alarms[i]);
    }
    List<Alarm> children = rr.getChildren();
    assertEquals(children.size(), 10);
    for (int i = 0; i != 10; i++) {
        assertTrue(children.contains(alarms[i]));
    }
}
Also used : Alarm(cern.laser.business.data.Alarm) AlarmImpl(cern.laser.business.data.AlarmImpl)

Aggregations

Alarm (cern.laser.business.data.Alarm)91 AlarmCacheException (cern.laser.business.cache.AlarmCacheException)24 LaserRuntimeException (cern.laser.business.LaserRuntimeException)21 ArrayList (java.util.ArrayList)21 Category (cern.laser.business.data.Category)16 Collection (java.util.Collection)14 AlarmImpl (cern.laser.business.data.AlarmImpl)13 LaserDefinitionNotValidException (cern.laser.business.definition.LaserDefinitionNotValidException)12 AdminUser (cern.laser.business.data.AdminUser)11 AlarmDefinition (alma.alarmsystem.alarmmessage.generated.AlarmDefinition)10 LaserDefinitionDuplicationException (cern.laser.business.definition.LaserDefinitionDuplicationException)10 LaserDefinitionNotFoundException (cern.laser.business.definition.LaserDefinitionNotFoundException)10 Iterator (java.util.Iterator)10 LaserProcessingException (cern.laser.business.LaserProcessingException)9 LaserDefinitionNotAllowedException (cern.laser.business.definition.LaserDefinitionNotAllowedException)9 LaserObjectNotFoundException (cern.laser.business.LaserObjectNotFoundException)7 ReductionRule (cl.utfsm.acs.acg.core.ReductionRule)7 FaultCode (alma.acs.alarmsystem.generated.FaultCode)6 FaultFamily (alma.acs.alarmsystem.generated.FaultFamily)6 FaultMember (alma.acs.alarmsystem.generated.FaultMember)6