alma::acs::nc::HelperTest Class Reference

Inheritance diagram for alma::acs::nc::HelperTest:
Inheritance graph
[legend]
Collaboration diagram for alma::acs::nc::HelperTest:
Collaboration graph
[legend]

List of all members.

Classes

class  HelperWithChannelCreationSynch

Public Member Functions

 HelperTest () throws Exception
void testTaoMonitorAndControlService () throws Exception
void testCreateChannel () throws Exception
void testConcurrentChannelCreation () throws Exception
void testConcurrentChannelRetrieval () throws Throwable

Protected Member Functions

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

Private Member Functions

void assertChannel (boolean existing, String channelName)
String getStatistic (String statName) throws InvalidName
Date getStatisticTime (String statName) throws InvalidName

Private Attributes

HelperWithChannelCreationSynch helper
NotificationServiceMonitorControl nsmc

Detailed Description

Tests creation of notification channels and usage of the TAO notification extensions that were introduced to fix the race conditions described in COMP-2808.

Author:
hsommer

Constructor & Destructor Documentation

alma::acs::nc::HelperTest::HelperTest (  )  throws Exception [inline]

Member Function Documentation

void alma::acs::nc::HelperTest::assertChannel ( boolean  existing,
String  channelName 
) [inline, private]
String alma::acs::nc::HelperTest::getStatistic ( String  statName  )  throws InvalidName [inline, private]
Date alma::acs::nc::HelperTest::getStatisticTime ( String  statName  )  throws InvalidName [inline, private]
void alma::acs::nc::HelperTest::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::component::client::ComponentClientTestCase::getContainerServices(), alma::acs::nc::Helper::getNamingService(), helper, and nsmc.

void alma::acs::nc::HelperTest::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::nc::HelperTest::testConcurrentChannelCreation (  )  throws Exception [inline]

Tests the collision case where many threads create the same channel concurrently.

Note that we would need to hack TAO to slow down (or otherwise synchronize with) channel creation, so that we can be sure that the second request comes in before the first request has finished. We optimize this by synchronizing the test threads right before they make the call to the channel factory, for which we overload the method HelperWithChannelCreationSynch#createNotifyChannel_internal(EventChannelFactory, Property[], Property[], String, IntHolder). This eliminates jitter from thread creation, thread starting, and contact with the naming service, all happening before actual channel creation.

References assertChannel(), alma::acs::nc::HelperTest::HelperWithChannelCreationSynch::createNotificationChannel(), alma::acs::nc::Helper::destroyNotificationChannel(), alma::acs::component::client::ComponentClientTestCase::getContainerServices(), alma::acs::nc::Helper::getNotificationFactoryNameForChannel(), helper, and alma::acs::component::client::ComponentClientTestCase::m_logger.

void alma::acs::nc::HelperTest::testConcurrentChannelRetrieval (  )  throws Throwable [inline]
void alma::acs::nc::HelperTest::testCreateChannel (  )  throws Exception [inline]
void alma::acs::nc::HelperTest::testTaoMonitorAndControlService (  )  throws Exception [inline]

Member Data Documentation


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

Generated by  doxygen 1.6.2