

Classes | |
| class | MiniFaultState |
Public Member Functions | |
| StressTest () throws Exception | |
| void | alarmReceived (AlarmView alarm) |
| void | testStress () throws Exception |
Protected Member Functions | |
| void | setUp () throws Exception |
| 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 |
| ContainerServices | contSvcs |
| int | activeFS = 0 |
| HashMap< String, AlarmView > | alarms = new HashMap<String,AlarmView>() |
Static Private Attributes | |
| static final String | FF = "TEST" |
| static final String | FM = "Member" |
| static final int | NUM_ALARMS_TO_SEND = 1000 |
| static Random | rnd = new Random(System.currentTimeMillis()) |
| static int | count = 0 |
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)
| alma::acs::lasercore::test::StressTest::StressTest | ( | ) | throws Exception [inline] |
Constructor
| Exception |
| void alma::acs::lasercore::test::StressTest::alarmReceived | ( | AlarmView | alarm | ) | [inline] |
| 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.
References alarmSource, alma::alarmsystem::source::ACSAlarmSystemInterface::push(), alma::alarmsystem::source::ACSFaultState::setDescriptor(), alma::alarmsystem::source::ACSFaultState::setUserTimestamp(), and statesToPublish.
Referenced by tearDown().
| void alma::acs::lasercore::test::StressTest::send | ( | MiniFaultState | mfs | ) | throws Exception [inline, private] |
publish a FaultState
| mfs | The fault state to publish |
References alarmSource, alma::alarmsystem::source::ACSAlarmSystemInterface::push(), alma::alarmsystem::source::ACSFaultState::setDescriptor(), and alma::alarmsystem::source::ACSFaultState::setUserTimestamp().
Referenced by testStress().
| void alma::acs::lasercore::test::StressTest::setUp | ( | ) | throws Exception [inline, protected] |
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::lasercore::test::stress::CategoryClient::addAlarmListener(), alarmSource, categoryClient, alma::acs::lasercore::test::stress::CategoryClient::connect(), contSvcs, alma::acs::component::client::ComponentClientTestCase::getContainerServices(), NUM_ALARMS_TO_SEND, and statesToPublish.
| void alma::acs::lasercore::test::StressTest::tearDown | ( | ) | throws Exception [inline, protected] |
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 categoryClient, cleanActiveAlarms(), and alma::acs::lasercore::test::stress::CategoryClient::disconnect().
| 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.
References activeFS, alarms, send(), and statesToPublish.
int alma::acs::lasercore::test::StressTest::activeFS = 0 [private] |
The number of active FS published
Referenced by testStress().
HashMap<String,AlarmView> alma::acs::lasercore::test::StressTest::alarms = new HashMap<String,AlarmView>() [private] |
The vector with the alarms received from the categories. The key is the alarm ID
Referenced by alarmReceived(), and testStress().
The source
Referenced by cleanActiveAlarms(), send(), and setUp().
The category client
Referenced by setUp(), and tearDown().
Container services
Referenced by setUp().
int alma::acs::lasercore::test::StressTest::count = 0 [static, private] |
Used to generated the FM of the MiniFaultState's to send.
Referenced by alma::acs::lasercore::test::StressTest::MiniFaultState::MiniFaultState().
final String alma::acs::lasercore::test::StressTest::FF = "TEST" [static, private] |
FF of the published states
Referenced by alarmReceived().
final String alma::acs::lasercore::test::StressTest::FM = "Member" [static, private] |
FM of the published states
Referenced by alarmReceived().
final int alma::acs::lasercore::test::StressTest::NUM_ALARMS_TO_SEND = 1000 [static, private] |
The number of alarms to publish
Referenced by setUp().
Random alma::acs::lasercore::test::StressTest::rnd = new Random(System.currentTimeMillis()) [static, private] |
The random number generator to create FMs
Referenced by alma::acs::lasercore::test::StressTest::MiniFaultState::MiniFaultState().
The fault states to publish
Referenced by cleanActiveAlarms(), setUp(), and testStress().
1.6.2