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

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

Collaboration diagram for alma::acs::nc::HelperTest:

Collaboration graph
[legend]
List of all members.

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]
 

Helper method that checks (non-/)existence of a channel

Parameters:
existing 

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]
 

void alma::acs::nc::HelperTest::tearDown  )  throws Exception [inline, protected]
 

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.

void alma::acs::nc::HelperTest::testConcurrentChannelRetrieval  )  throws Throwable [inline]
 

One step up from testConcurrentChannelCreation(), here we test concurrent calls to Helper#getNotificationChannel(String, String, String) which are supposed to handle the NameAlreadyUsed exception by making those later threads wait until the channel has been created for the first thread, then sharing the channel object.

void alma::acs::nc::HelperTest::testCreateChannel  )  throws Exception [inline]
 

Creates and destroys a test channel. Also tests creating a second instance of that channel after the first one has been created, to check for the NameAlreadyUsed ex.

void alma::acs::nc::HelperTest::testTaoMonitorAndControlService  )  throws Exception [inline]
 

: Check why we only get statistics about the alarm channel factory here!!


Member Data Documentation

HelperWithChannelCreationSynch alma::acs::nc::HelperTest::helper [private]
 

NotificationServiceMonitorControl alma::acs::nc::HelperTest::nsmc [private]
 


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