

Public Member Functions | |
| SendTest () throws Exception | |
| void | setUp () throws Exception |
| void | tearDown () throws Exception |
| void | testSend () throws Exception |
| void | testStress () throws Exception |
| void | receive (com.cosylab.acs.jms.ACSJMSMessageEntity msg) |
Private Member Functions | |
| boolean | isValidFSMessage (FaultStateImpl fs, int num) |
Private Attributes | |
| volatile Consumer | m_consumer |
| final int | ITERATIONS = 10 |
| int | nMsgReceived |
| volatile Object | receiverError |
| String | faultFamily = "AlarmSource" |
| String | faultMember = "ALARM_SOURCE_ANTENNA" |
Static Private Attributes | |
| static final String | m_channelName = "CMW.ALARM_SYSTEM.ALARMS.SOURCES.ALARM_SYSTEM_SOURCES" |
A class to test the sources. It is composed of 2 tests: 1- send an alarm 2- stress test that sends several alarms
Each message is checked for integrity
| alma::lasersource::test::SendTest::SendTest | ( | ) | throws Exception [inline] |
| boolean alma::lasersource::test::SendTest::isValidFSMessage | ( | FaultStateImpl | fs, | |
| int | num | |||
| ) | [inline, private] |
Check if the message is coherent with the number
| fs | The FS to check | |
| num | The number of the message |
References faultFamily, faultMember, cern::laser::source::alarmsysteminterface::impl::FaultStateImpl::getCode(), cern::laser::source::alarmsysteminterface::impl::FaultStateImpl::getFamily(), and cern::laser::source::alarmsysteminterface::impl::FaultStateImpl::getMember().
Referenced by receive().
| void alma::lasersource::test::SendTest::receive | ( | com.cosylab.acs.jms.ACSJMSMessageEntity | msg | ) | [inline] |
The method receives all the messages published in the NC For each message received it checks if its content is right i.e. the name of the class, the member and the code contains the number of the message in the sequence. In this way it also checks if the messages are received in the same order they were sent. The method also checks if all the messages have been received and prints a message if receives more messages then the messages pushed
| msg | The message received from the NC |
References isValidFSMessage(), ITERATIONS, nMsgReceived, and receiverError.
| void alma::lasersource::test::SendTest::setUp | ( | ) | throws Exception [inline] |
Starts CORBA in the client process and connects to the manager and logger.
Subclasses that override this method must call super.setUp(), likely before any other code in that method.
Reimplemented from alma::acs::component::client::ComponentClientTestCase.
References alma::acs::nc::Consumer::addSubscription(), alma::acs::nc::Consumer::consumerReady(), alma::acs::component::client::ComponentClientTestCase::getContainerServices(), m_channelName, m_consumer, alma::acs::component::client::ComponentClientTestCase::m_logger, and nMsgReceived.
| void alma::lasersource::test::SendTest::tearDown | ( | ) | throws Exception [inline] |
Releases all previously obtained components (using manager), logs out from the manager, and terminates the CORBA ORB.
Subclasses that override this method must call super.tearDown(), likely after any other code in that method.
Reimplemented from alma::acs::component::client::ComponentClientTestCase.
References alma::acs::nc::Consumer::disconnect(), m_consumer, and alma::acs::component::client::ComponentClientTestCase::m_logger.
| void alma::lasersource::test::SendTest::testSend | ( | ) | throws Exception [inline] |
References faultFamily, faultMember, alma::acs::component::client::ComponentClientTestCase::m_logger, alma::alarmsystem::source::ACSAlarmSystemInterface::push(), receiverError, alma::alarmsystem::source::ACSFaultState::setDescriptor(), alma::alarmsystem::source::ACSFaultState::setUserProperties(), and alma::alarmsystem::source::ACSFaultState::setUserTimestamp().
| void alma::lasersource::test::SendTest::testStress | ( | ) | throws Exception [inline] |
References faultFamily, faultMember, ITERATIONS, alma::acs::component::client::ComponentClientTestCase::m_logger, alma::alarmsystem::source::ACSAlarmSystemInterface::push(), receiverError, alma::alarmsystem::source::ACSFaultState::setDescriptor(), alma::alarmsystem::source::ACSFaultState::setUserProperties(), and alma::alarmsystem::source::ACSFaultState::setUserTimestamp().
String alma::lasersource::test::SendTest::faultFamily = "AlarmSource" [private] |
Referenced by isValidFSMessage(), testSend(), and testStress().
String alma::lasersource::test::SendTest::faultMember = "ALARM_SOURCE_ANTENNA" [private] |
Referenced by isValidFSMessage(), testSend(), and testStress().
final int alma::lasersource::test::SendTest::ITERATIONS = 10 [private] |
Referenced by receive(), and testStress().
final String alma::lasersource::test::SendTest::m_channelName = "CMW.ALARM_SYSTEM.ALARMS.SOURCES.ALARM_SYSTEM_SOURCES" [static, private] |
Referenced by setUp().
volatile Consumer alma::lasersource::test::SendTest::m_consumer [private] |
Referenced by setUp(), and tearDown().
int alma::lasersource::test::SendTest::nMsgReceived [private] |
volatile Object alma::lasersource::test::SendTest::receiverError [private] |
Alarm NC events are received in different threads than the tests run in. In order to let the test fail when there are receiver exceptions or validation errors, we can communicate them in this variable.
Referenced by receive(), testSend(), and testStress().
1.6.2