alma::lasersource::test::SourceStressTest Class Reference

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

List of all members.

Classes

class  FaultStateReceived
class  MiniFaultState

Public Member Functions

 SourceStressTest () throws Exception
void receive (ACSJMSMessageEntity msg) throws Exception
void testStressSameSource () throws Exception
void testStressDifferentSources () throws Exception

Protected Member Functions

void setUp () throws Exception
void tearDown () throws Exception

Private Member Functions

void send (MiniFaultState mfs, boolean sameSource) throws Exception
void checkFaultStates (MiniFaultState sent, FaultState recv) throws Exception
void buildData (int len) throws Exception
void waitForFSs () throws Exception

Private Attributes

volatile Consumer m_consumer
ACSAlarmSystemInterface alarmSource
Vector< FaultStateReceivedreceivedFS
Vector< MiniFaultStatestatesToPublish

Static Private Attributes

static final int NUM_OF_FS_TO_SEND_ONE_SOURCE = 10000
static final int NUM_OF_FS_TO_SEND_MORE_SOURCES = 1000
static final String m_channelName = "CMW.ALARM_SYSTEM.ALARMS.SOURCES.ALARM_SYSTEM_SOURCES"
static String FF = "Family"
static String FM = "Member"
static Random rnd = new Random(System.currentTimeMillis())
static int count = 0

Detailed Description

A stress test: it sends a great number of alarm sources and checks

The FaultStates are sent in the same order their are published if the sending is done with one source per each FS. If the source is only one for all the alarms, then it applies a kind of caching and the FSs do not arrive in the same order the are published. In the latter case, the FSs published and the FSs received are both sorted by FM and compared.

Author:
acaproni

Constructor & Destructor Documentation

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

Constructor

Exceptions:
Exception 

Member Function Documentation

void alma::lasersource::test::SourceStressTest::buildData ( int  len  )  throws Exception [inline, private]

Build the data to publish and check for correctness

Parameters:
len The number of items to biuld and put in the array

References statesToPublish.

Referenced by testStressDifferentSources(), and testStressSameSource().

void alma::lasersource::test::SourceStressTest::checkFaultStates ( MiniFaultState  sent,
FaultState  recv 
) throws Exception [inline, private]
void alma::lasersource::test::SourceStressTest::receive ( ACSJMSMessageEntity  msg  )  throws Exception [inline]

References receivedFS.

void alma::lasersource::test::SourceStressTest::send ( MiniFaultState  mfs,
boolean  sameSource 
) throws Exception [inline, private]

Send a fault state to the NC. It uses the global source or build a new one depending on the parameter

Parameters:
mfs The fault state to publish
sameSource If true the same source is used to send the alarm if true a new source is built and the fault state is sent using this new source

References alarmSource, alma::alarmsystem::source::ACSAlarmSystemInterface::push(), alma::alarmsystem::source::ACSFaultState::setDescriptor(), and alma::alarmsystem::source::ACSFaultState::setUserTimestamp().

Referenced by testStressDifferentSources(), and testStressSameSource().

void alma::lasersource::test::SourceStressTest::setUp (  )  throws Exception [inline, protected]
void alma::lasersource::test::SourceStressTest::tearDown (  )  throws Exception [inline, protected]
void alma::lasersource::test::SourceStressTest::testStressDifferentSources (  )  throws Exception [inline]

Test by sending all the fault states using the same source. When all the alarms have arrived it checks for their correctness

Exceptions:
Exception 

References buildData(), checkFaultStates(), NUM_OF_FS_TO_SEND_MORE_SOURCES, receivedFS, send(), statesToPublish, and waitForFSs().

void alma::lasersource::test::SourceStressTest::testStressSameSource (  )  throws Exception [inline]

Test by sending all the fault states using the same source. When all the alarms have arrived it checks for their correctness.

NOTE: when using only on source, not all the FS arrive in the same order they are submitted to the source. For this reason the collection are sorted before comparing.

Exceptions:
Exception 

References buildData(), checkFaultStates(), NUM_OF_FS_TO_SEND_ONE_SOURCE, receivedFS, send(), statesToPublish, and waitForFSs().

void alma::lasersource::test::SourceStressTest::waitForFSs (  )  throws Exception [inline, private]

Wait until all the fault states are received or a timeout happened.

Exceptions:
Exception in case of timeout

References count, receivedFS, and statesToPublish.

Referenced by testStressDifferentSources(), and testStressSameSource().


Member Data Documentation

Referenced by send(), and setUp().

String alma::lasersource::test::SourceStressTest::FF = "Family" [static, private]
String alma::lasersource::test::SourceStressTest::FM = "Member" [static, private]
final String alma::lasersource::test::SourceStressTest::m_channelName = "CMW.ALARM_SYSTEM.ALARMS.SOURCES.ALARM_SYSTEM_SOURCES" [static, private]

Referenced by setUp().

Referenced by setUp(), and tearDown().

Referenced by testStressSameSource().

Random alma::lasersource::test::SourceStressTest::rnd = new Random(System.currentTimeMillis()) [static, private]

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

Generated by  doxygen 1.6.2