

Public Member Functions | |
| MasterComponentTest () throws Exception | |
| void | testInitPass1 () throws Exception |
| void | testFullLifecycle () throws Exception |
| void | testEventSyncMultipleRuns () throws Exception |
Protected Member Functions | |
| void | setUp () throws Exception |
| void | tearDown () throws Exception |
Private Member Functions | |
| void | _testEventSync (StateChangeListener listener) throws Exception |
| void | verifyCurrentState (ROstringSeq statesProperty, String[] expectedHierarchy) |
Private Attributes | |
| MasterComponent | m_masterComp |
| alma::ACS::MasterComponentImpl::MasterComponentTest::MasterComponentTest | ( | ) | throws Exception [inline] |
Constructor for MasterComponentTest.
| void alma::ACS::MasterComponentImpl::MasterComponentTest::_testEventSync | ( | StateChangeListener | listener | ) | throws Exception [inline, private] |
Uses state change notification to synchronize sending the next event, instead of stupid Thread.sleep like the above tests.
This method could be taken as an example of how subsystems can use these synchronization helper classes to write unit tests for their own master components.
References alma::ACS::MasterComponentOperations::doTransition(), m_masterComp, alma::ACS::MasterComponentImpl::StateChangeSemaphore::reset(), and alma::ACS::MasterComponentImpl::StateChangeSemaphore::waitForStateChanges().
Referenced by testEventSyncMultipleRuns().
| void alma::ACS::MasterComponentImpl::MasterComponentTest::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::container::ContainerServices::getComponent(), alma::acs::component::client::ComponentClientTestCase::getContainerServices(), and m_masterComp.
| void alma::ACS::MasterComponentImpl::MasterComponentTest::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.
| void alma::ACS::MasterComponentImpl::MasterComponentTest::testEventSyncMultipleRuns | ( | ) | throws Exception [inline] |
Test method for multiple runs of _testEventSync().
References _testEventSync(), alma::ACS::MasterComponentImpl::StateChangeListener::createMonitor(), alma::ACS::MasterComponentReadOnlyOperations::currentStateHierarchy(), alma::ACS::MasterComponentImpl::StateChangeListener::destroyMonitor(), alma::acs::component::client::ComponentClientTestCase::getContainerServices(), alma::acs::component::client::ComponentClientTestCase::m_logger, and m_masterComp.
| void alma::ACS::MasterComponentImpl::MasterComponentTest::testFullLifecycle | ( | ) | throws Exception [inline] |
| void alma::ACS::MasterComponentImpl::MasterComponentTest::testInitPass1 | ( | ) | throws Exception [inline] |
| void alma::ACS::MasterComponentImpl::MasterComponentTest::verifyCurrentState | ( | ROstringSeq | statesProperty, | |
| String[] | expectedHierarchy | |||
| ) | [inline, private] |
Helper method for the repeated task of getting the current state hierarchy and comparing it against the expected hierarchy.
This method is a replica of StateChangeListener#verifyCurrentState(String[]) which is necessary for testing w/o using the synchronization facilities offered by StateChangeListener.
References alma::ACS::PstringSeqOperations::get_sync(), alma::acs::exceptions::AcsJCompletion::getCode(), alma::acs::exceptions::AcsJCompletion::getType(), alma::acs::exceptions::AcsJCompletion::isError(), and alma::ACSErr::CompletionHolder::value.
Referenced by testFullLifecycle(), and testInitPass1().
Referenced by _testEventSync(), setUp(), testEventSyncMultipleRuns(), testFullLifecycle(), and testInitPass1().
1.6.2