alma::lasersource::test::SendTest Class Reference

Inheritance diagram for alma::lasersource::test::SendTest:
Inheritance graph
[legend]
Collaboration diagram for alma::lasersource::test::SendTest:
Collaboration graph
[legend]

List of all members.

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"

Detailed Description

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


Constructor & Destructor Documentation

alma::lasersource::test::SendTest::SendTest (  )  throws Exception [inline]

Member Function Documentation

boolean alma::lasersource::test::SendTest::isValidFSMessage ( FaultStateImpl  fs,
int  num 
) [inline, private]

Check if the message is coherent with the number

Parameters:
fs The FS to check
num The number of the message
Returns:
true if the message is right

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

Parameters:
msg The message received from the NC
See also:
alma.acs.nc.Consumer

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.

See also:
junit.framework.TestCase::setUp()

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.

See also:
junit.framework.TestCase::tearDown()

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]
void alma::lasersource::test::SendTest::testStress (  )  throws Exception [inline]

Member Data Documentation

String alma::lasersource::test::SendTest::faultFamily = "AlarmSource" [private]
String alma::lasersource::test::SendTest::faultMember = "ALARM_SOURCE_ANTENNA" [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().

Referenced by setUp(), and tearDown().

Referenced by receive(), and setUp().

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().


The documentation for this class was generated from the following file:

Generated by  doxygen 1.6.2