

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 |
Tests creation of notification channels and usage of the TAO notification extensions that were introduced to fix the race conditions described in COMP-2808.
| alma::acs::nc::HelperTest::HelperTest | ( | ) | throws Exception [inline] |
| void alma::acs::nc::HelperTest::assertChannel | ( | boolean | existing, | |
| String | channelName | |||
| ) | [inline, private] |
Helper method that checks (non-/)existence of a channel
| existing |
References alma::acs::nc::Helper::getNamingService(), helper, and alma::acs::component::client::ComponentClientTestCase::m_logger.
Referenced by testConcurrentChannelCreation(), testConcurrentChannelRetrieval(), and testCreateChannel().
| String alma::acs::nc::HelperTest::getStatistic | ( | String | statName | ) | throws InvalidName [inline, private] |
References gov::sandia::CosNotification::NotificationServiceMonitorControlPackage::DataType::DATA_NUMERIC, gov::sandia::CosNotification::NotificationServiceMonitorControlPackage::DataType::DATA_TEXT, gov::sandia::CosNotification::NotificationServiceMonitorControlPackage::Data::discriminator, gov::sandia::CosNotification::NotificationServiceMonitorControlOperations::get_statistic(), gov::sandia::CosNotification::NotificationServiceMonitorControlPackage::Data::list, nsmc, and gov::sandia::CosNotification::NotificationServiceMonitorControlPackage::Data::num.
Referenced by testTaoMonitorAndControlService().
| Date alma::acs::nc::HelperTest::getStatisticTime | ( | String | statName | ) | throws InvalidName [inline, private] |
References gov::sandia::CosNotification::NotificationServiceMonitorControlPackage::DataType::DATA_NUMERIC, gov::sandia::CosNotification::NotificationServiceMonitorControlPackage::Data::discriminator, gov::sandia::CosNotification::NotificationServiceMonitorControlOperations::get_statistic(), nsmc, and gov::sandia::CosNotification::NotificationServiceMonitorControlPackage::Data::num.
Referenced by testTaoMonitorAndControlService().
| 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.
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.
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] |
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.
References assertChannel(), alma::acs::nc::Helper::destroyNotificationChannel(), alma::acs::component::client::ComponentClientTestCase::getContainerServices(), alma::acs::nc::HelperTest::HelperWithChannelCreationSynch::getNotificationChannel(), alma::acs::nc::Helper::getNotificationFactoryNameForChannel(), helper, and alma::acs::component::client::ComponentClientTestCase::m_logger.
| 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.
References assertChannel(), alma::acs::nc::HelperTest::HelperWithChannelCreationSynch::createNotificationChannel(), alma::acs::nc::Helper::destroyNotificationChannel(), alma::acs::nc::HelperTest::HelperWithChannelCreationSynch::getNotificationChannel(), alma::acs::nc::Helper::getNotificationFactoryNameForChannel(), helper, and alma::acs::component::client::ComponentClientTestCase::m_logger.
| void alma::acs::nc::HelperTest::testTaoMonitorAndControlService | ( | ) | throws Exception [inline] |
: Check why we only get statistics about the alarm channel factory here!!
References gov::sandia::CosNotification::NotificationServiceMonitorControlOperations::get_statistic_names(), getStatistic(), getStatisticTime(), alma::acs::component::client::ComponentClientTestCase::m_logger, and nsmc.
Referenced by assertChannel(), setUp(), testConcurrentChannelCreation(), testConcurrentChannelRetrieval(), and testCreateChannel().
Referenced by getStatistic(), getStatisticTime(), setUp(), and testTaoMonitorAndControlService().
1.6.2