Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

alma::acs::lasercore::test::StressTest Class Reference

Collaboration diagram for alma::acs::lasercore::test::StressTest:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 StressTest () throws Exception
Override void alarmReceived (AlarmView alarm)
void testStress () throws Exception

Protected Member Functions

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

Private Member Functions

void send (MiniFaultState mfs) throws Exception
void cleanActiveAlarms () throws Exception

Private Attributes

ACSAlarmSystemInterface alarmSource
CategoryClient categoryClient
MiniFaultState[] statesToPublish
int activeFS = 0
HashMap< String, AlarmViewalarms = new HashMap<StringAlarmView>()

Static Private Attributes

final String FF = "TEST"
final String FM = "Member"
final int NUM_ALARMS_TO_SEND = 1000
Random rnd = new Random(System.currentTimeMillis())
int count = 0

Detailed Description

This test sends a lot of fault states and check if they are published in the categories as expected. To avoid defining a great number of alarms in the CDB, a default alarm has been set in the TEST family

Sources are not tested here because they have already been tested in laser-source

NOTE: the test is performed without using the CategoryClient that at this level is not available (it requires modules compiled later in the build sequence)

Author:
acaproni


Constructor & Destructor Documentation

alma::acs::lasercore::test::StressTest::StressTest  )  throws Exception [inline]
 

Constructor

Exceptions:
Exception 


Member Function Documentation

Override void alma::acs::lasercore::test::StressTest::alarmReceived AlarmView  alarm  )  [inline]
 

See also:
CategoryListener

void alma::acs::lasercore::test::StressTest::cleanActiveAlarms  )  throws Exception [inline, private]
 

Clean all the active alarms published by the test. This method must be called in the cleanUp in order to terminate all the active alarms and be ready for a new test.

void alma::acs::lasercore::test::StressTest::send MiniFaultState  mfs  )  throws Exception [inline, private]
 

publish a FaultState

Parameters:
mfs The fault state to publish

Override void alma::acs::lasercore::test::StressTest::setUp  )  throws Exception [inline, protected]
 

Override void alma::acs::lasercore::test::StressTest::tearDown  )  throws Exception [inline, protected]
 

void alma::acs::lasercore::test::StressTest::testStress  )  throws Exception [inline]
 

Publishes all the alarms at once then wait until all of them are published by the alarm service. Finally check if the received alarms match with the published fault states.

The test is based on active alarms only and discards all the terminated ones. All the published fault states are then compared with alarms received by the alarm service

NOTE: The alarm service publishes an active alarm only if its state changes This test works only if the set of alarms it sends is not already present in the alarm service. If it is not the case, the alarm published by the AS depend on the alarms already present in the service.


Member Data Documentation

int alma::acs::lasercore::test::StressTest::activeFS = 0 [private]
 

HashMap<String,AlarmView> alma::acs::lasercore::test::StressTest::alarms = new HashMap<StringAlarmView>() [private]
 

ACSAlarmSystemInterface alma::acs::lasercore::test::StressTest::alarmSource [private]
 

CategoryClient alma::acs::lasercore::test::StressTest::categoryClient [private]
 

int alma::acs::lasercore::test::StressTest::count = 0 [static, private]
 

final String alma::acs::lasercore::test::StressTest::FF = "TEST" [static, private]
 

final String alma::acs::lasercore::test::StressTest::FM = "Member" [static, private]
 

final int alma::acs::lasercore::test::StressTest::NUM_ALARMS_TO_SEND = 1000 [static, private]
 

Random alma::acs::lasercore::test::StressTest::rnd = new Random(System.currentTimeMillis()) [static, private]
 

MiniFaultState [] alma::acs::lasercore::test::StressTest::statesToPublish [private]
 


The documentation for this class was generated from the following file:
Generated on Thu Apr 30 02:53:36 2009 for ACS Java API by doxygen 1.3.8