

Public Member Functions | |
| UserPropsTest () throws Exception | |
| void | onAlarm (Alarm alarm) |
| void | onException (LaserSelectionException e) |
| void | testProperties () throws Exception |
| void | faultStateReceived (FaultState faultState) |
| void | sourceXMLMsgReceived (String asiMessage) |
Protected Member Functions | |
| void | setUp () throws Exception |
| void | tearDown () throws Exception |
Private Member Functions | |
| int | waitForMessages (int numOfMessages) |
| void | send_alarm (String family, String member, int code, boolean active, Properties props) throws Exception |
Private Attributes | |
| CategoryClient | categoryClient |
| SourceClient | sourceClient |
| Vector< Alarm > | alarmsReceived |
Static Private Attributes | |
| static final int | MAX_TIMEOUT = 120 |
Test transmission of user defined properties from a fault state to clients.
The test is done by a couple of alarms with user properties and listening from both the sources and categories notification channels.
The checking is almost entirely delegated to tat by printing messages on the stdout.
| alma::alarmsystem::clients::test::UserPropsTest::UserPropsTest | ( | ) | throws Exception [inline] |
Constructor
| void alma::alarmsystem::clients::test::UserPropsTest::faultStateReceived | ( | FaultState | faultState | ) | [inline] |
Implements alma::alarmsystem::clients::source::SourceListener.
References cern::laser::source::alarmsysteminterface::FaultState::getCode(), cern::laser::source::alarmsysteminterface::FaultState::getDescriptor(), cern::laser::source::alarmsysteminterface::FaultState::getFamily(), cern::laser::source::alarmsysteminterface::FaultState::getMember(), and cern::laser::source::alarmsysteminterface::FaultState::getUserProperties().
| void alma::alarmsystem::clients::test::UserPropsTest::onAlarm | ( | Alarm | alarm | ) | [inline] |
Implements cern::laser::client::services::selection::AlarmSelectionListener.
References alarmsReceived, cern::laser::business::data::Triplet::getFaultCode(), cern::laser::business::data::Triplet::getFaultFamily(), cern::laser::business::data::Triplet::getFaultMember(), cern::laser::client::data::Alarm::getStatus(), and cern::laser::client::data::Alarm::getTriplet().
| void alma::alarmsystem::clients::test::UserPropsTest::onException | ( | LaserSelectionException | e | ) | [inline] |
Implements cern::laser::client::services::selection::AlarmSelectionListener.
| void alma::alarmsystem::clients::test::UserPropsTest::send_alarm | ( | String | family, | |
| String | member, | |||
| int | code, | |||
| boolean | active, | |||
| Properties | props | |||
| ) | throws Exception [inline, private] |
Push an alarm
| active | If true the alarm is active |
References alma::alarmsystem::source::ACSAlarmSystemInterface::push(), alma::alarmsystem::source::ACSFaultState::setDescriptor(), alma::alarmsystem::source::ACSFaultState::setUserProperties(), and alma::alarmsystem::source::ACSFaultState::setUserTimestamp().
Referenced by testProperties().
| void alma::alarmsystem::clients::test::UserPropsTest::setUp | ( | ) | throws Exception [inline, protected] |
Reimplemented from alma::acs::component::client::ComponentClientTestCase.
References alma::alarmsystem::clients::SourceClient::addAlarmListener(), alarmsReceived, categoryClient, alma::alarmsystem::clients::SourceClient::connect(), alma::alarmsystem::clients::CategoryClient::connect(), alma::acs::component::client::ComponentClientTestCase::getContainerServices(), and sourceClient.
| void alma::alarmsystem::clients::test::UserPropsTest::sourceXMLMsgReceived | ( | String | asiMessage | ) | [inline] |
An XML has been received from the source NC.
The XML follows the ASIMessage.xsd schema definition and therefore it might have one or more fault states.
| asiMessage | The ASIMessage received from an alarm source |
Implements alma::alarmsystem::clients::source::SourceListener.
| void alma::alarmsystem::clients::test::UserPropsTest::tearDown | ( | ) | throws Exception [inline, protected] |
Reimplemented from alma::acs::component::client::ComponentClientTestCase.
References alarmsReceived, categoryClient, alma::alarmsystem::clients::CategoryClient::close(), alma::alarmsystem::clients::SourceClient::close(), and sourceClient.
| void alma::alarmsystem::clients::test::UserPropsTest::testProperties | ( | ) | throws Exception [inline] |
Test if the properties set while sending an alarm arrive to the CategoryClient.
The test is done by sending 2 active alarms with 2 properties and one properties respectively. The triplets of the two alarms differ only for the FC that will be used to check the correctness of the received properties.
Checking is done by listening to sources and to source NCs.
| Exception |
References send_alarm(), and waitForMessages().
| int alma::alarmsystem::clients::test::UserPropsTest::waitForMessages | ( | int | numOfMessages | ) | [inline, private] |
Wait for the messages from the alarm system.
| numOfMessages | The number of messages to wait for |
References alarmsReceived, and MAX_TIMEOUT.
Referenced by testProperties().
Vector<Alarm> alma::alarmsystem::clients::test::UserPropsTest::alarmsReceived [private] |
The vector with the alarms received
Referenced by onAlarm(), setUp(), tearDown(), and waitForMessages().
The categoryClient to test
Referenced by setUp(), and tearDown().
final int alma::alarmsystem::clients::test::UserPropsTest::MAX_TIMEOUT = 120 [static, private] |
Max number of seconds to wait for the messages
Referenced by waitForMessages().
The source client
Referenced by setUp(), and tearDown().
1.6.2