alma::ACS::MasterComponentImpl::MasterComponentTest Class Reference

Inheritance diagram for alma::ACS::MasterComponentImpl::MasterComponentTest:
Inheritance graph
[legend]
Collaboration diagram for alma::ACS::MasterComponentImpl::MasterComponentTest:
Collaboration graph
[legend]

List of all members.

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

Detailed Description

Author:
hsommer created Apr 13, 2004 4:32:51 PM

Constructor & Destructor Documentation

alma::ACS::MasterComponentImpl::MasterComponentTest::MasterComponentTest (  )  throws Exception [inline]

Constructor for MasterComponentTest.


Member Function Documentation

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.

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

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.

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

Reimplemented from alma::acs::component::client::ComponentClientTestCase.

void alma::ACS::MasterComponentImpl::MasterComponentTest::testEventSyncMultipleRuns (  )  throws Exception [inline]
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().


Member Data Documentation


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

Generated by  doxygen 1.6.2