[asterisk-scf-commits] asterisk-scf/integration/bridging.git branch "master" updated.

Commits to the Asterisk SCF project code repositories asterisk-scf-commits at lists.digium.com
Wed Aug 25 10:56:10 CDT 2010


branch "master" has been updated
       via  5c4feb990419026d315890da246d1114334b8ba2 (commit)
      from  f8dc82ccc9f0838dfbdf9f06b55ebc7cbfe67fef (commit)

Summary of changes:
 src/BridgeImpl.cpp    |   73 +++++++++++-----
 test/TestBridging.cpp |  231 ++++++++++++++++++++++++++++++++++++++++++-------
 2 files changed, 251 insertions(+), 53 deletions(-)


- Log -----------------------------------------------------------------
commit 5c4feb990419026d315890da246d1114334b8ba2
Author: Brent Eagles <beagles at digium.com>
Date:   Wed Aug 25 13:24:57 2010 -0230

    Fixing up a potential deadlock on addEndpoint (occurs during testing)

diff --git a/src/BridgeImpl.cpp b/src/BridgeImpl.cpp
index 5c71bf5..04e10b1 100644
--- a/src/BridgeImpl.cpp
+++ b/src/BridgeImpl.cpp
@@ -302,34 +302,48 @@ void Hydra::BridgeService::BridgeImpl::addEndpoint(const Hydra::Core::Endpoint::
         mLogger.getDebugStream() << __FUNCTION__ << ": endpoint with id " << ep->id->endpointManagerId << ":" << ep->id->destinationId << " failed dynamic cast." << std::endl;
         throw Hydra::Core::Bridging::V1::UnsupportedEndpoint(ep->id);
     }
-    boost::unique_lock<boost::shared_mutex> lock(mLock);
-    statePreCheck();
-    std::vector<Hydra::BridgeService::BridgeImpl::BridgeEndpoint>::iterator  i = find(ep->id);
-    if(i != mEndpoints.end())
     {
-        mLogger.getDebugStream() << __FUNCTION__ << ": endpoint with id " << ep->id->endpointManagerId << ":" << ep->id->destinationId << " already registered." << std::endl;
-        throw Hydra::Core::Bridging::V1::EndpointAlreadyRegistered(ep->id);
-    }
+        boost::unique_lock<boost::shared_mutex> lock(mLock);
+        statePreCheck();
+        std::vector<Hydra::BridgeService::BridgeImpl::BridgeEndpoint>::iterator  i = find(ep->id);
+        if(i != mEndpoints.end())
+        {
+            mLogger.getDebugStream() << __FUNCTION__ << ": endpoint with id " << ep->id->endpointManagerId << ":" << ep->id->destinationId << " already registered." << std::endl;
+            throw Hydra::Core::Bridging::V1::EndpointAlreadyRegistered(ep->id);
+        }
 
-    if(mMonitor)
-    {
-        bool result = mMonitor->onAddEndpoint(ep);
-        mLogger.getDebugStream() << __FUNCTION__ << "onAddEndpoint() returned " << result << std::endl;
-    }
+        if(mMonitor)
+        {
+            bool result = mMonitor->onAddEndpoint(ep);
+            mLogger.getDebugStream() << __FUNCTION__ << "onAddEndpoint() returned " << result << std::endl;
+        }
 
-    if(newEndpoint->command)
-    {
-        newEndpoint->command->call(mBridgeId, newEndpoint->id, mSignalling);
-        mQueuedEndpoints.insert(std::pair<std::string, Hydra::Session::V1::SessionEndpointPtr>(endpointIdToString(newEndpoint->id), newEndpoint));
+        if(newEndpoint->command)
+        {
+            mQueuedEndpoints.insert(std::pair<std::string, Hydra::Session::V1::SessionEndpointPtr>(endpointIdToString(newEndpoint->id), newEndpoint));
+        }
+        else
+        {
+            mEndpoints.push_back(BridgeEndpoint(newEndpoint, mSplicer.connect(endpointIdToString(newEndpoint->id), newEndpoint->mediaSession)));
+        }
     }
-    else
+    //
+    // Don't perform the RPC with the lock held!
+    //
+    if(newEndpoint->command)
     {
-        mEndpoints.push_back(BridgeEndpoint(newEndpoint, mSplicer.connect(endpointIdToString(newEndpoint->id), newEndpoint->mediaSession)));
+        try
+        {
+            newEndpoint->command->call(mBridgeId, newEndpoint->id, mSignalling);
+        }
+        catch(...)
+        {
+            boost::unique_lock<boost::shared_mutex> lock(mLock);
+            mQueuedEndpoints.erase(endpointIdToString(newEndpoint->id));
+            throw;
+        }
     }
 
-    //
-    // Connect media.
-    //
     mLogger.getDebugStream() << __FUNCTION__ << ": bridge " << current.adapter->getCommunicator()->identityToString(current.id) <<
          " now has " << mEndpoints.size() << " endpoints." << std::endl;
     mEvents->endpointAdded(newEndpoint);
@@ -432,7 +446,9 @@ void Hydra::BridgeService::BridgeImpl::shutdown(const Ice::Current& current)
     // TODO: Response code for termination messages for bridges shutting down should come from configuration
     //
     Hydra::Session::V1::ResponseCodePtr response(new Hydra::Session::V1::ResponseCode(0));
+
     std::for_each(mEndpoints.begin(), mEndpoints.end(), Hydra::BridgeService::BridgeShutdownFunctor(sourceId, response));
+
     mLogger.getInfoStream() << current.adapter->getCommunicator()->identityToString(current.id) << ": is shutdown." << std::endl;
     mEvents->stopped();
     if(mMonitor)
@@ -481,6 +497,7 @@ bool Hydra::BridgeService::BridgeImpl::destroyed()
 
 void Hydra::BridgeService::BridgeImpl::endpointConnected(const Hydra::Core::Endpoint::V1::EndpointIdPtr& id)
 {
+    mLogger.getDebugStream() << __FUNCTION__ << ": endpoint connected " << endpointIdToString(id) << std::endl;
     boost::unique_lock<boost::shared_mutex> lock(mLock);
     std::map<std::string, Hydra::Session::V1::SessionEndpointPtr>::iterator i = mQueuedEndpoints.find(endpointIdToString(id));
     if(i != mQueuedEndpoints.end())
@@ -494,6 +511,7 @@ void Hydra::BridgeService::BridgeImpl::endpointTerminated(const Hydra::Core::End
   const Hydra::Session::V1::ResponseCodePtr& response,
   const Ice::Current& current)
 {
+    mLogger.getDebugStream() << __FUNCTION__ << ": endpoint terminated from " << endpointIdToString(id) << std::endl;
     {
         //
         // Check list of endpoints first.
@@ -503,7 +521,16 @@ void Hydra::BridgeService::BridgeImpl::endpointTerminated(const Hydra::Core::End
         if(i != mEndpoints.end())
         {
             i->endpoint->callback->terminated(id, response);
-            removeEndpoint(id, current);
+            try
+            {
+                removeEndpoint(id, current);
+            }
+            catch(Hydra::System::Component::V1::ShuttingDown&)
+            {
+            }
+            catch(const Ice::ObjectNotExistException&)
+            {
+            }
             return;
         }
     }
@@ -524,6 +551,7 @@ void Hydra::BridgeService::BridgeImpl::endpointTerminated(const Hydra::Core::End
 
 void Hydra::BridgeService::BridgeImpl::endpointRinging(const Hydra::Core::Endpoint::V1::EndpointIdPtr& id)
 {
+    mLogger.getDebugStream() << __FUNCTION__ << ": endpoint ringing from " << endpointIdToString(id) << std::endl;
     boost::unique_lock<boost::shared_mutex> lock(mLock);
     if(mAdminEndpoint.get() != 0)
     {
@@ -537,6 +565,7 @@ void Hydra::BridgeService::BridgeImpl::endpointRinging(const Hydra::Core::Endpoi
 
 void Hydra::BridgeService::BridgeImpl::endpointBusy(const Hydra::Core::Endpoint::V1::EndpointIdPtr& id)
 {
+    mLogger.getDebugStream() << __FUNCTION__ << ": busy callback from " << endpointIdToString(id) << std::endl;
     boost::unique_lock<boost::shared_mutex> lock(mLock);
     if(mAdminEndpoint.get() != 0)
     {
diff --git a/test/TestBridging.cpp b/test/TestBridging.cpp
index 1b82333..513f69d 100644
--- a/test/TestBridging.cpp
+++ b/test/TestBridging.cpp
@@ -106,6 +106,7 @@ private:
     std::string mId;
 };
 
+
 class SessionI : public Hydra::Media::V1::Session
 {
 public:
@@ -141,6 +142,38 @@ private:
     Hydra::Media::V1::StreamSinkSeq mSinks;
 };
 
+class CommandI : public Hydra::Session::V1::SignalCommands
+{
+public:
+    CommandI()  :
+        mCalled(false),
+        mTerminated(false)
+    {
+    }
+
+    bool call(const Hydra::Core::Endpoint::V1::EndpointIdPtr& caller, 
+      const Hydra::Core::Endpoint::V1::EndpointIdPtr& destination,
+      const Hydra::Session::V1::SignalCallbackPrx& cb,
+      const Ice::Current&)
+    {
+        mCalled = true;
+        BOOST_TEST_MESSAGE("call request received");
+        cb->connected(destination);
+        return true;
+    }
+    
+    void terminate(const Hydra::Core::Endpoint::V1::EndpointIdPtr& caller, 
+      const Ice::Current&)
+    {
+        mTerminated = true;
+        BOOST_TEST_MESSAGE("terminate request received");
+    }
+
+private:
+    bool mCalled;
+    bool mTerminated;
+};
+
 class BridgeEventSubscriberI : public Hydra::Core::Bridging::V1::BridgeEvents
 {
 public:
@@ -209,6 +242,11 @@ static Hydra::Media::V1::SessionPrx createTestSession(const Ice::ObjectAdapterPt
     return Hydra::Media::V1::SessionPrx::uncheckedCast(p->addWithUUID(session));
 }
 
+static Hydra::Session::V1::SignalCommandsPrx createTestCommand(const Ice::ObjectAdapterPtr& p)
+{
+    return Hydra::Session::V1::SignalCommandsPrx::uncheckedCast(p->addWithUUID(new CommandI));
+}
+
 typedef IceUtil::Handle<BridgeEventSubscriberI> BridgeEventSubscriberIPtr;
 
 class BridgeMonitorI : public Hydra::Core::Bridging::V1::BridgeMonitor
@@ -290,9 +328,12 @@ BOOST_AUTO_TEST_CASE(BridgeEndpointValidationAddInvalidType)
 {
     Ice::InitializationData initData;
     initData.properties = Ice::createProperties(0);
-    initData.properties->setProperty("TestBridging.Endpoints", "default -p 33333 -t 1000");
+    initData.properties->setProperty("TestBridging.Endpoints", "default -p 33333 -t 10000");
+    initData.properties->setProperty("Ice.ThreadPool.Server.Size", "5");
+    initData.properties->setProperty("Ice.Default.CollocationOptimized", "0");
     Ice::CommunicatorPtr comm = Ice::initialize(initData);
     Ice::ObjectAdapterPtr adapter = comm->createObjectAdapter("TestBridging");
+    adapter->activate();
     Ice::Current dummy;
     dummy.adapter = adapter;
     dummy.id = comm->stringToIdentity("testobject");
@@ -325,9 +366,12 @@ BOOST_AUTO_TEST_CASE(BridgeEndpointValidationAddInvalidValue)
 {
     Ice::InitializationData initData;
     initData.properties = Ice::createProperties(0);
-    initData.properties->setProperty("TestBridging.Endpoints", "default -p 33333 -t 1000");
+    initData.properties->setProperty("TestBridging.Endpoints", "default -p 33333 -t 10000");
+    initData.properties->setProperty("Ice.ThreadPool.Server.Size", "5");
+    initData.properties->setProperty("Ice.Default.CollocationOptimized", "0");
     Ice::CommunicatorPtr comm = Ice::initialize(initData);
     Ice::ObjectAdapterPtr adapter = comm->createObjectAdapter("TestBridging");
+    adapter->activate();
     Ice::Current dummy;
     dummy.adapter = adapter;
     dummy.id = comm->stringToIdentity("testobject");
@@ -356,9 +400,12 @@ BOOST_AUTO_TEST_CASE(BridgeEndpointValidationAddValidTypeNullId)
 {
     Ice::InitializationData initData;
     initData.properties = Ice::createProperties(0);
-    initData.properties->setProperty("TestBridging.Endpoints", "default -p 33333 -t 1000");
+    initData.properties->setProperty("TestBridging.Endpoints", "default -p 33333 -t 10000");
+    initData.properties->setProperty("Ice.ThreadPool.Server.Size", "5");
+    initData.properties->setProperty("Ice.Default.CollocationOptimized", "0");
     Ice::CommunicatorPtr comm = Ice::initialize(initData);
     Ice::ObjectAdapterPtr adapter = comm->createObjectAdapter("TestBridging");
+    adapter->activate();
     Ice::Current dummy;
     dummy.adapter = adapter;
     dummy.id = comm->stringToIdentity("testobject");
@@ -369,6 +416,7 @@ BOOST_AUTO_TEST_CASE(BridgeEndpointValidationAddValidTypeNullId)
         {
             Hydra::Session::V1::SessionEndpointPtr p(new Hydra::Session::V1::SessionEndpoint);
             p->mediaSession = createTestSession(adapter, "testsession");
+            p->command = createTestCommand(adapter);
             b->addEndpoint(p, dummy);
             BOOST_CHECK("Should not have succeeded" == 0);
         }
@@ -389,9 +437,12 @@ BOOST_AUTO_TEST_CASE(BridgeEndpointValidationAddValidTypeInvalidId)
 {
     Ice::InitializationData initData;
     initData.properties = Ice::createProperties(0);
-    initData.properties->setProperty("TestBridging.Endpoints", "default -p 33333 -t 1000");
+    initData.properties->setProperty("TestBridging.Endpoints", "default -p 33333 -t 10000");
+    initData.properties->setProperty("Ice.ThreadPool.Server.Size", "5");
+    initData.properties->setProperty("Ice.Default.CollocationOptimized", "0");
     Ice::CommunicatorPtr comm = Ice::initialize(initData);
     Ice::ObjectAdapterPtr adapter = comm->createObjectAdapter("TestBridging");
+    adapter->activate();
     Ice::Current dummy;
     dummy.adapter = adapter;
     dummy.id = comm->stringToIdentity("testobject");
@@ -405,6 +456,7 @@ BOOST_AUTO_TEST_CASE(BridgeEndpointValidationAddValidTypeInvalidId)
             p->id->endpointManagerId = "";
             p->id->destinationId = "";
             p->mediaSession = createTestSession(adapter, "testsession");
+            p->command = createTestCommand(adapter);
             b->addEndpoint(p, dummy);
             BOOST_CHECK("Should not have succeeded" == 0);
         }
@@ -426,9 +478,12 @@ BOOST_AUTO_TEST_CASE(BridgeEndpointAddValidTypeValidValue)
 {
     Ice::InitializationData initData;
     initData.properties = Ice::createProperties(0);
-    initData.properties->setProperty("TestBridging.Endpoints", "default -p 33333 -t 1000");
+    initData.properties->setProperty("TestBridging.Endpoints", "default -p 33333 -t 10000");
+    initData.properties->setProperty("Ice.ThreadPool.Server.Size", "5");
+    initData.properties->setProperty("Ice.Default.CollocationOptimized", "0");
     Ice::CommunicatorPtr comm = Ice::initialize(initData);
     Ice::ObjectAdapterPtr adapter = comm->createObjectAdapter("TestBridging");
+    adapter->activate();
     Ice::Current dummy;
     dummy.adapter = adapter;
     dummy.id = comm->stringToIdentity("testobject");
@@ -442,6 +497,7 @@ BOOST_AUTO_TEST_CASE(BridgeEndpointAddValidTypeValidValue)
             p->id->endpointManagerId = "foo";
             p->id->destinationId = "bar";
             p->mediaSession = createTestSession(adapter, "testsession");
+            p->command = createTestCommand(adapter);
             b->addEndpoint(p, dummy);
             BOOST_CHECK(true);
         }
@@ -462,9 +518,12 @@ BOOST_AUTO_TEST_CASE(BridgeEndpointListEp)
 {
     Ice::InitializationData initData;
     initData.properties = Ice::createProperties(0);
-    initData.properties->setProperty("TestBridging.Endpoints", "default -p 33333 -t 1000");
+    initData.properties->setProperty("TestBridging.Endpoints", "default -p 33333 -t 10000");
+    initData.properties->setProperty("Ice.ThreadPool.Server.Size", "5");
+    initData.properties->setProperty("Ice.Default.CollocationOptimized", "0");
     Ice::CommunicatorPtr comm = Ice::initialize(initData);
     Ice::ObjectAdapterPtr adapter = comm->createObjectAdapter("TestBridging");
+    adapter->activate();
     Ice::Current dummy;
     dummy.adapter = adapter;
     dummy.id = comm->stringToIdentity("testobject");
@@ -478,6 +537,7 @@ BOOST_AUTO_TEST_CASE(BridgeEndpointListEp)
             p->id->endpointManagerId = "foo";
             p->id->destinationId = "bar";
             p->mediaSession = createTestSession(adapter, "testsession");
+            p->command = createTestCommand(adapter);
             b->addEndpoint(p, dummy);
             Hydra::Core::Endpoint::V1::EndpointSeq endpoints = b->listEndpoints(dummy);
             BOOST_CHECK(endpoints.size() == 1);
@@ -500,9 +560,12 @@ BOOST_AUTO_TEST_CASE(BridgeFactoryCreateBridgeWithInvalidAdminEndpoint)
 {
     Ice::InitializationData initData;
     initData.properties = Ice::createProperties(0);
-    initData.properties->setProperty("TestBridging.Endpoints", "default -p 33333 -t 1000");
+    initData.properties->setProperty("TestBridging.Endpoints", "default -p 33333 -t 10000");
+    initData.properties->setProperty("Ice.ThreadPool.Server.Size", "5");
+    initData.properties->setProperty("Ice.Default.CollocationOptimized", "0");
     Ice::CommunicatorPtr comm = Ice::initialize(initData);
     Ice::ObjectAdapterPtr adapter = comm->createObjectAdapter("TestBridging");
+    adapter->activate();
     Ice::Current dummy;
     dummy.adapter = adapter;
     dummy.id = comm->stringToIdentity("testobject");
@@ -536,9 +599,12 @@ BOOST_AUTO_TEST_CASE(BridgeFactoryCreateBridgeWithInvalidAdminEndpointId)
 {
     Ice::InitializationData initData;
     initData.properties = Ice::createProperties(0);
-    initData.properties->setProperty("TestBridging.Endpoints", "default -p 33333 -t 1000");
+    initData.properties->setProperty("TestBridging.Endpoints", "default -p 33333 -t 10000");
+    initData.properties->setProperty("Ice.ThreadPool.Server.Size", "5");
+    initData.properties->setProperty("Ice.Default.CollocationOptimized", "0");
     Ice::CommunicatorPtr comm = Ice::initialize(initData);
     Ice::ObjectAdapterPtr adapter = comm->createObjectAdapter("TestBridging");
+    adapter->activate();
     Ice::Current dummy;
     dummy.adapter = adapter;
     dummy.id = comm->stringToIdentity("testobject");
@@ -554,6 +620,7 @@ BOOST_AUTO_TEST_CASE(BridgeFactoryCreateBridgeWithInvalidAdminEndpointId)
             p->id->destinationId = "";
 
             Hydra::Session::V1::SessionEndpointPtr::dynamicCast(p)->mediaSession = createTestSession(adapter, "testsession");
+            Hydra::Session::V1::SessionEndpointPtr::dynamicCast(p)->command = createTestCommand(adapter);
             Hydra::Core::Bridging::V1::BridgeMonitorPrx monitor;
             Hydra::Core::Bridging::V1::BridgePrx b = factory->createBridge(p, Hydra::Core::Endpoint::V1::EndpointSeq(), 0, dummy);
             BOOST_CHECK("Should not have succeeded" == 0);
@@ -575,9 +642,12 @@ BOOST_AUTO_TEST_CASE(BridgeFactoryCreateBridgeWithValidAdminEndpoint)
 {
     Ice::InitializationData initData;
     initData.properties = Ice::createProperties(0);
-    initData.properties->setProperty("TestBridging.Endpoints", "default -p 33333 -t 1000");
+    initData.properties->setProperty("TestBridging.Endpoints", "default -p 33333 -t 10000");
+    initData.properties->setProperty("Ice.ThreadPool.Server.Size", "5");
+    initData.properties->setProperty("Ice.Default.CollocationOptimized", "0");
     Ice::CommunicatorPtr comm = Ice::initialize(initData);
     Ice::ObjectAdapterPtr adapter = comm->createObjectAdapter("TestBridging");
+    adapter->activate();
     Ice::Current dummy;
     dummy.adapter = adapter;
     dummy.id = comm->stringToIdentity("testobject");
@@ -589,6 +659,7 @@ BOOST_AUTO_TEST_CASE(BridgeFactoryCreateBridgeWithValidAdminEndpoint)
         p->id->endpointManagerId = "foo";
         p->id->destinationId = "bar";
         Hydra::Session::V1::SessionEndpointPtr::dynamicCast(p)->mediaSession = createTestSession(adapter, "testsession");
+        Hydra::Session::V1::SessionEndpointPtr::dynamicCast(p)->command = createTestCommand(adapter);
         Hydra::Core::Bridging::V1::BridgePrx b =  factory->createBridge(p, Hydra::Core::Endpoint::V1::EndpointSeq(), 0, dummy);
         BOOST_CHECK(b);
         Hydra::Core::Endpoint::V1::EndpointSeq endpoints = b->listEndpoints();
@@ -607,9 +678,12 @@ BOOST_AUTO_TEST_CASE(BridgeFactoryEmptyBridge)
 {
     Ice::InitializationData initData;
     initData.properties = Ice::createProperties(0);
-    initData.properties->setProperty("TestBridging.Endpoints", "default -p 33333 -t 1000");
+    initData.properties->setProperty("TestBridging.Endpoints", "default -p 33333 -t 10000");
+    initData.properties->setProperty("Ice.ThreadPool.Server.Size", "5");
+    initData.properties->setProperty("Ice.Default.CollocationOptimized", "0");
     Ice::CommunicatorPtr comm = Ice::initialize(initData);
     Ice::ObjectAdapterPtr adapter = comm->createObjectAdapter("TestBridging");
+    adapter->activate();
     Ice::Current dummy;
     dummy.adapter = adapter;
     dummy.id = comm->stringToIdentity("testobject");
@@ -633,9 +707,12 @@ BOOST_AUTO_TEST_CASE(BridgeFactoryInitialEndpointInvalidType)
 {
     Ice::InitializationData initData;
     initData.properties = Ice::createProperties(0);
-    initData.properties->setProperty("TestBridging.Endpoints", "default -p 33333 -t 1000");
+    initData.properties->setProperty("TestBridging.Endpoints", "default -p 33333 -t 10000");
+    initData.properties->setProperty("Ice.ThreadPool.Server.Size", "5");
+    initData.properties->setProperty("Ice.Default.CollocationOptimized", "0");
     Ice::CommunicatorPtr comm = Ice::initialize(initData);
     Ice::ObjectAdapterPtr adapter = comm->createObjectAdapter("TestBridging");
+    adapter->activate();
     Ice::Current dummy;
     dummy.adapter = adapter;
     dummy.id = comm->stringToIdentity("testobject");
@@ -669,9 +746,12 @@ BOOST_AUTO_TEST_CASE(BridgeFactoryInitialEndpointNullId)
 {
     Ice::InitializationData initData;
     initData.properties = Ice::createProperties(0);
-    initData.properties->setProperty("TestBridging.Endpoints", "default -p 33333 -t 1000");
+    initData.properties->setProperty("TestBridging.Endpoints", "default -p 33333 -t 10000");
+    initData.properties->setProperty("Ice.ThreadPool.Server.Size", "5");
+    initData.properties->setProperty("Ice.Default.CollocationOptimized", "0");
     Ice::CommunicatorPtr comm = Ice::initialize(initData);
     Ice::ObjectAdapterPtr adapter = comm->createObjectAdapter("TestBridging");
+    adapter->activate();
     Ice::Current dummy;
     dummy.adapter = adapter;
     dummy.id = comm->stringToIdentity("testobject");
@@ -702,9 +782,12 @@ BOOST_AUTO_TEST_CASE(BridgeFactoryInitialEndpointInvalidId)
 {
     Ice::InitializationData initData;
     initData.properties = Ice::createProperties(0);
-    initData.properties->setProperty("TestBridging.Endpoints", "default -p 33333 -t 1000");
+    initData.properties->setProperty("TestBridging.Endpoints", "default -p 33333 -t 10000");
+    initData.properties->setProperty("Ice.ThreadPool.Server.Size", "5");
+    initData.properties->setProperty("Ice.Default.CollocationOptimized", "0");
     Ice::CommunicatorPtr comm = Ice::initialize(initData);
     Ice::ObjectAdapterPtr adapter = comm->createObjectAdapter("TestBridging");
+    adapter->activate();
     Ice::Current dummy;
     dummy.adapter = adapter;
     dummy.id = comm->stringToIdentity("testobject");
@@ -739,9 +822,12 @@ BOOST_AUTO_TEST_CASE(BridgeFactoryCreateBridgeWithValidEndpoint)
 {
     Ice::InitializationData initData;
     initData.properties = Ice::createProperties(0);
-    initData.properties->setProperty("TestBridging.Endpoints", "default -p 33333 -t 1000");
+    initData.properties->setProperty("TestBridging.Endpoints", "default -p 33333 -t 10000");
+    initData.properties->setProperty("Ice.ThreadPool.Server.Size", "5");
+    initData.properties->setProperty("Ice.Default.CollocationOptimized", "0");
     Ice::CommunicatorPtr comm = Ice::initialize(initData);
     Ice::ObjectAdapterPtr adapter = comm->createObjectAdapter("TestBridging");
+    adapter->activate();
     Ice::Current dummy;
     dummy.adapter = adapter;
     dummy.id = comm->stringToIdentity("testobject");
@@ -753,6 +839,7 @@ BOOST_AUTO_TEST_CASE(BridgeFactoryCreateBridgeWithValidEndpoint)
         p->id->endpointManagerId = "foo";
         p->id->destinationId = "bar";
         Hydra::Session::V1::SessionEndpointPtr::dynamicCast(p)->mediaSession = createTestSession(adapter, "testsession");
+        Hydra::Session::V1::SessionEndpointPtr::dynamicCast(p)->command = createTestCommand(adapter);
         Hydra::Core::Endpoint::V1::EndpointSeq eps;
         eps.push_back(p);
         Hydra::Core::Bridging::V1::BridgePrx b =  factory->createBridge(0, eps, 0, dummy);
@@ -773,9 +860,12 @@ BOOST_AUTO_TEST_CASE(BridgeFactoryCreateBridgeWithCollidingAdminAndInitialEndpoi
 {
     Ice::InitializationData initData;
     initData.properties = Ice::createProperties(0);
-    initData.properties->setProperty("TestBridging.Endpoints", "default -p 33333 -t 1000");
+    initData.properties->setProperty("TestBridging.Endpoints", "default -p 33333 -t 10000");
+    initData.properties->setProperty("Ice.ThreadPool.Server.Size", "5");
+    initData.properties->setProperty("Ice.Default.CollocationOptimized", "0");
     Ice::CommunicatorPtr comm = Ice::initialize(initData);
     Ice::ObjectAdapterPtr adapter = comm->createObjectAdapter("TestBridging");
+    adapter->activate();
     Ice::Current dummy;
     dummy.adapter = adapter;
     dummy.id = comm->stringToIdentity("testobject");
@@ -787,6 +877,7 @@ BOOST_AUTO_TEST_CASE(BridgeFactoryCreateBridgeWithCollidingAdminAndInitialEndpoi
         p->id->endpointManagerId = "foo";
         p->id->destinationId = "bar";
         Hydra::Session::V1::SessionEndpointPtr::dynamicCast(p)->mediaSession = createTestSession(adapter, "testsession");
+        Hydra::Session::V1::SessionEndpointPtr::dynamicCast(p)->command = createTestCommand(adapter);
         Hydra::Core::Endpoint::V1::EndpointSeq eps;
         eps.push_back(p);
         p = new Hydra::Session::V1::SessionEndpoint;
@@ -794,6 +885,7 @@ BOOST_AUTO_TEST_CASE(BridgeFactoryCreateBridgeWithCollidingAdminAndInitialEndpoi
         p->id->endpointManagerId = "foo";
         p->id->destinationId = "bar";
         Hydra::Session::V1::SessionEndpointPtr::dynamicCast(p)->mediaSession = createTestSession(adapter, "testsession1");
+        Hydra::Session::V1::SessionEndpointPtr::dynamicCast(p)->command = createTestCommand(adapter);
         Hydra::Core::Bridging::V1::BridgePrx b =  factory->createBridge(p, eps, 0, dummy);
         BOOST_CHECK("Should not have succeeded." == 0);
     }
@@ -814,9 +906,12 @@ BOOST_AUTO_TEST_CASE(BridgeFactoryCreateBridgeWithCollisions)
 {
     Ice::InitializationData initData;
     initData.properties = Ice::createProperties(0);
-    initData.properties->setProperty("TestBridging.Endpoints", "default -p 33333 -t 1000");
+    initData.properties->setProperty("TestBridging.Endpoints", "default -p 33333 -t 10000");
+    initData.properties->setProperty("Ice.ThreadPool.Server.Size", "5");
+    initData.properties->setProperty("Ice.Default.CollocationOptimized", "0");
     Ice::CommunicatorPtr comm = Ice::initialize(initData);
     Ice::ObjectAdapterPtr adapter = comm->createObjectAdapter("TestBridging");
+    adapter->activate();
     Ice::Current dummy;
     dummy.adapter = adapter;
     dummy.id = comm->stringToIdentity("testobject");
@@ -828,6 +923,7 @@ BOOST_AUTO_TEST_CASE(BridgeFactoryCreateBridgeWithCollisions)
         p->id->endpointManagerId = "foo";
         p->id->destinationId = "bar";
         Hydra::Session::V1::SessionEndpointPtr::dynamicCast(p)->mediaSession = createTestSession(adapter, "testsession");
+        Hydra::Session::V1::SessionEndpointPtr::dynamicCast(p)->command = createTestCommand(adapter);
         Hydra::Core::Endpoint::V1::EndpointSeq eps;
         eps.push_back(p);
         p = new Hydra::Session::V1::SessionEndpoint;
@@ -835,6 +931,7 @@ BOOST_AUTO_TEST_CASE(BridgeFactoryCreateBridgeWithCollisions)
         p->id->endpointManagerId = "foo";
         p->id->destinationId = "bar";
         Hydra::Session::V1::SessionEndpointPtr::dynamicCast(p)->mediaSession = createTestSession(adapter, "testsession1");
+        Hydra::Session::V1::SessionEndpointPtr::dynamicCast(p)->command = createTestCommand(adapter);
         eps.push_back(p);
         Hydra::Core::Bridging::V1::BridgePrx b =  factory->createBridge(0, eps, 0, dummy);
         BOOST_CHECK("Should not have succeeded." == 0);
@@ -856,9 +953,12 @@ BOOST_AUTO_TEST_CASE(BridgeFactoryCreateBridgeWithValidInitialSet)
 {
     Ice::InitializationData initData;
     initData.properties = Ice::createProperties(0);
-    initData.properties->setProperty("TestBridging.Endpoints", "default -p 33333 -t 1000");
+    initData.properties->setProperty("TestBridging.Endpoints", "default -p 33333 -t 10000");
+    initData.properties->setProperty("Ice.ThreadPool.Server.Size", "5");
+    initData.properties->setProperty("Ice.Default.CollocationOptimized", "0");
     Ice::CommunicatorPtr comm = Ice::initialize(initData);
     Ice::ObjectAdapterPtr adapter = comm->createObjectAdapter("TestBridging");
+    adapter->activate();
     Ice::Current dummy;
     dummy.adapter = adapter;
     dummy.id = comm->stringToIdentity("testobject");
@@ -870,6 +970,7 @@ BOOST_AUTO_TEST_CASE(BridgeFactoryCreateBridgeWithValidInitialSet)
         p->id->endpointManagerId = "foo";
         p->id->destinationId = "bar";
         Hydra::Session::V1::SessionEndpointPtr::dynamicCast(p)->mediaSession = createTestSession(adapter, "testsession");
+        Hydra::Session::V1::SessionEndpointPtr::dynamicCast(p)->command = createTestCommand(adapter);
         Hydra::Core::Endpoint::V1::EndpointSeq eps;
         eps.push_back(p);
         p = new Hydra::Session::V1::SessionEndpoint;
@@ -877,18 +978,21 @@ BOOST_AUTO_TEST_CASE(BridgeFactoryCreateBridgeWithValidInitialSet)
         p->id->endpointManagerId = "foo1";
         p->id->destinationId = "bar";
         Hydra::Session::V1::SessionEndpointPtr::dynamicCast(p)->mediaSession = createTestSession(adapter, "testsession1");
+        Hydra::Session::V1::SessionEndpointPtr::dynamicCast(p)->command = createTestCommand(adapter);
         eps.push_back(p);
         p = new Hydra::Session::V1::SessionEndpoint;
         p->id = new Hydra::Core::Endpoint::V1::EndpointId;
         p->id->endpointManagerId = "foo";
         p->id->destinationId = "bar1";
         Hydra::Session::V1::SessionEndpointPtr::dynamicCast(p)->mediaSession = createTestSession(adapter, "testsession2");
+        Hydra::Session::V1::SessionEndpointPtr::dynamicCast(p)->command = createTestCommand(adapter);
         eps.push_back(p);
         p = new Hydra::Session::V1::SessionEndpoint;
         p->id = new Hydra::Core::Endpoint::V1::EndpointId;
         p->id->endpointManagerId = "fooa";
         p->id->destinationId = "bar";
         Hydra::Session::V1::SessionEndpointPtr::dynamicCast(p)->mediaSession = createTestSession(adapter, "testsession3");
+        Hydra::Session::V1::SessionEndpointPtr::dynamicCast(p)->command = createTestCommand(adapter);
         Hydra::Core::Bridging::V1::BridgePrx b =  factory->createBridge(p, eps, 0, dummy);
         BOOST_CHECK(b);
         Hydra::Core::Endpoint::V1::EndpointSeq endpoints = b->listEndpoints();
@@ -925,9 +1029,12 @@ BOOST_AUTO_TEST_CASE(BridgeAddEndpoint)
 {
     Ice::InitializationData initData;
     initData.properties = Ice::createProperties(0);
-    initData.properties->setProperty("TestBridging.Endpoints", "default -p 33333 -t 1000");
+    initData.properties->setProperty("TestBridging.Endpoints", "default -p 33333 -t 10000");
+    initData.properties->setProperty("Ice.ThreadPool.Server.Size", "5");
+    initData.properties->setProperty("Ice.Default.CollocationOptimized", "0");
     Ice::CommunicatorPtr comm = Ice::initialize(initData);
     Ice::ObjectAdapterPtr adapter = comm->createObjectAdapter("TestBridging");
+    adapter->activate();
     Ice::Current dummy;
     dummy.adapter = adapter;
     dummy.id = comm->stringToIdentity("testobject");
@@ -938,6 +1045,7 @@ BOOST_AUTO_TEST_CASE(BridgeAddEndpoint)
         p->id->endpointManagerId = "foo";
         p->id->destinationId = "bar";
         Hydra::Session::V1::SessionEndpointPtr::dynamicCast(p)->mediaSession = createTestSession(adapter, "testsession");
+        Hydra::Session::V1::SessionEndpointPtr::dynamicCast(p)->command = createTestCommand(adapter);
         Hydra::Session::V1::SessionEndpointSeq eps;
         eps.push_back(p);
         p = new Hydra::Session::V1::SessionEndpoint;
@@ -945,18 +1053,21 @@ BOOST_AUTO_TEST_CASE(BridgeAddEndpoint)
         p->id->endpointManagerId = "foo1";
         p->id->destinationId = "bar";
         Hydra::Session::V1::SessionEndpointPtr::dynamicCast(p)->mediaSession = createTestSession(adapter, "testsession1");
+        Hydra::Session::V1::SessionEndpointPtr::dynamicCast(p)->command = createTestCommand(adapter);
         eps.push_back(p);
         p = new Hydra::Session::V1::SessionEndpoint;
         p->id = new Hydra::Core::Endpoint::V1::EndpointId;
         p->id->endpointManagerId = "foo";
         p->id->destinationId = "bar1";
         Hydra::Session::V1::SessionEndpointPtr::dynamicCast(p)->mediaSession = createTestSession(adapter, "testsession2");
+        Hydra::Session::V1::SessionEndpointPtr::dynamicCast(p)->command = createTestCommand(adapter);
         eps.push_back(p);
         p = new Hydra::Session::V1::SessionEndpoint;
         p->id = new Hydra::Core::Endpoint::V1::EndpointId;
         p->id->endpointManagerId = "fooa";
         p->id->destinationId = "bar";
         Hydra::Session::V1::SessionEndpointPtr::dynamicCast(p)->mediaSession = createTestSession(adapter, "testsession3");
+        Hydra::Session::V1::SessionEndpointPtr::dynamicCast(p)->command = createTestCommand(adapter);
         Hydra::BridgeService::BridgeImplPtr bridge(new Hydra::BridgeService::BridgeImpl(adapter, p, eps, 0, 0));
         eps.insert(eps.begin(), p);
         p = new Hydra::Session::V1::SessionEndpoint;
@@ -964,6 +1075,7 @@ BOOST_AUTO_TEST_CASE(BridgeAddEndpoint)
         p->id->endpointManagerId = "foo2";
         p->id->destinationId = "bar";
         Hydra::Session::V1::SessionEndpointPtr::dynamicCast(p)->mediaSession = createTestSession(adapter, "testsession4");
+        Hydra::Session::V1::SessionEndpointPtr::dynamicCast(p)->command = createTestCommand(adapter);
         bridge->addEndpoint(p, dummy);
         eps.push_back(p);
         Hydra::Core::Endpoint::V1::EndpointSeq endpoints = bridge->listEndpoints(dummy);
@@ -994,9 +1106,12 @@ BOOST_AUTO_TEST_CASE(BridgeAddEndpointAlreadyRegistered)
 {
     Ice::InitializationData initData;
     initData.properties = Ice::createProperties(0);
-    initData.properties->setProperty("TestBridging.Endpoints", "default -p 33333 -t 1000");
+    initData.properties->setProperty("TestBridging.Endpoints", "default -p 33333 -t 10000");
+    initData.properties->setProperty("Ice.ThreadPool.Server.Size", "5");
+    initData.properties->setProperty("Ice.Default.CollocationOptimized", "0");
     Ice::CommunicatorPtr comm = Ice::initialize(initData);
     Ice::ObjectAdapterPtr adapter = comm->createObjectAdapter("TestBridging");
+    adapter->activate();
     Ice::Current dummy;
     dummy.adapter = adapter;
     dummy.id = comm->stringToIdentity("testobject");
@@ -1007,6 +1122,7 @@ BOOST_AUTO_TEST_CASE(BridgeAddEndpointAlreadyRegistered)
         p->id->endpointManagerId = "foo";
         p->id->destinationId = "bar";
         Hydra::Session::V1::SessionEndpointPtr::dynamicCast(p)->mediaSession = createTestSession(adapter, "testsession");
+        Hydra::Session::V1::SessionEndpointPtr::dynamicCast(p)->command = createTestCommand(adapter);
         Hydra::Session::V1::SessionEndpointSeq eps;
         eps.push_back(p);
         p = new Hydra::Session::V1::SessionEndpoint;
@@ -1014,18 +1130,21 @@ BOOST_AUTO_TEST_CASE(BridgeAddEndpointAlreadyRegistered)
         p->id->endpointManagerId = "foo1";
         p->id->destinationId = "bar";
         Hydra::Session::V1::SessionEndpointPtr::dynamicCast(p)->mediaSession = createTestSession(adapter, "testsession1");
+        Hydra::Session::V1::SessionEndpointPtr::dynamicCast(p)->command = createTestCommand(adapter);
         eps.push_back(p);
         p = new Hydra::Session::V1::SessionEndpoint;
         p->id = new Hydra::Core::Endpoint::V1::EndpointId;
         p->id->endpointManagerId = "foo";
         p->id->destinationId = "bar1";
         Hydra::Session::V1::SessionEndpointPtr::dynamicCast(p)->mediaSession = createTestSession(adapter, "testsession2");
+        Hydra::Session::V1::SessionEndpointPtr::dynamicCast(p)->command = createTestCommand(adapter);
         eps.push_back(p);
         p = new Hydra::Session::V1::SessionEndpoint;
         p->id = new Hydra::Core::Endpoint::V1::EndpointId;
         p->id->endpointManagerId = "fooa";
         p->id->destinationId = "bar";
         Hydra::Session::V1::SessionEndpointPtr::dynamicCast(p)->mediaSession = createTestSession(adapter, "testsession3");
+        Hydra::Session::V1::SessionEndpointPtr::dynamicCast(p)->command = createTestCommand(adapter);
         Hydra::BridgeService::BridgeImplPtr bridge(new Hydra::BridgeService::BridgeImpl(adapter, p, eps, 0, 0));
         eps.insert(eps.begin(), p);
         p = new Hydra::Session::V1::SessionEndpoint;
@@ -1069,9 +1188,12 @@ BOOST_AUTO_TEST_CASE(BridgeAddInvalidEndpoint)
 {
     Ice::InitializationData initData;
     initData.properties = Ice::createProperties(0);
-    initData.properties->setProperty("TestBridging.Endpoints", "default -p 33333 -t 1000");
+    initData.properties->setProperty("TestBridging.Endpoints", "default -p 33333 -t 10000");
+    initData.properties->setProperty("Ice.ThreadPool.Server.Size", "5");
+    initData.properties->setProperty("Ice.Default.CollocationOptimized", "0");
     Ice::CommunicatorPtr comm = Ice::initialize(initData);
     Ice::ObjectAdapterPtr adapter = comm->createObjectAdapter("TestBridging");
+    adapter->activate();
     Ice::Current dummy;
     dummy.adapter = adapter;
     dummy.id = comm->stringToIdentity("testobject");
@@ -1102,9 +1224,12 @@ BOOST_AUTO_TEST_CASE(BridgeAddInvalidId1)
 {
     Ice::InitializationData initData;
     initData.properties = Ice::createProperties(0);
-    initData.properties->setProperty("TestBridging.Endpoints", "default -p 33333 -t 1000");
+    initData.properties->setProperty("TestBridging.Endpoints", "default -p 33333 -t 10000");
+    initData.properties->setProperty("Ice.ThreadPool.Server.Size", "5");
+    initData.properties->setProperty("Ice.Default.CollocationOptimized", "0");
     Ice::CommunicatorPtr comm = Ice::initialize(initData);
     Ice::ObjectAdapterPtr adapter = comm->createObjectAdapter("TestBridging");
+    adapter->activate();
     Ice::Current dummy;
     dummy.adapter = adapter;
     dummy.id = comm->stringToIdentity("testobject");
@@ -1117,6 +1242,7 @@ BOOST_AUTO_TEST_CASE(BridgeAddInvalidId1)
         p->id->endpointManagerId = "";
         p->id->destinationId = "";
         Hydra::Session::V1::SessionEndpointPtr::dynamicCast(p)->mediaSession = createTestSession(adapter, "testsession");
+        Hydra::Session::V1::SessionEndpointPtr::dynamicCast(p)->command = createTestCommand(adapter);
         bridge->addEndpoint(p, dummy);
         BOOST_CHECK("Should not have succeeded." == 0);
     }
@@ -1136,9 +1262,12 @@ BOOST_AUTO_TEST_CASE(BridgeAddInvalidId2)
 {
     Ice::InitializationData initData;
     initData.properties = Ice::createProperties(0);
-    initData.properties->setProperty("TestBridging.Endpoints", "default -p 33333 -t 1000");
+    initData.properties->setProperty("TestBridging.Endpoints", "default -p 33333 -t 10000");
+    initData.properties->setProperty("Ice.ThreadPool.Server.Size", "5");
+    initData.properties->setProperty("Ice.Default.CollocationOptimized", "0");
     Ice::CommunicatorPtr comm = Ice::initialize(initData);
     Ice::ObjectAdapterPtr adapter = comm->createObjectAdapter("TestBridging");
+    adapter->activate();
     Ice::Current dummy;
     dummy.adapter = adapter;
     dummy.id = comm->stringToIdentity("testobject");
@@ -1148,6 +1277,7 @@ BOOST_AUTO_TEST_CASE(BridgeAddInvalidId2)
         Hydra::BridgeService::BridgeImplPtr bridge(new Hydra::BridgeService::BridgeImpl(adapter, 0, eps, 0, 0));
         Hydra::Core::Endpoint::V1::BaseEndpointPtr p(new Hydra::Session::V1::SessionEndpoint);
         Hydra::Session::V1::SessionEndpointPtr::dynamicCast(p)->mediaSession = createTestSession(adapter, "testsession");
+        Hydra::Session::V1::SessionEndpointPtr::dynamicCast(p)->command = createTestCommand(adapter);
         bridge->addEndpoint(p, dummy);
         BOOST_CHECK("Should not have succeeded." == 0);
     }
@@ -1167,9 +1297,12 @@ BOOST_AUTO_TEST_CASE(BridgeRemoveEndpoint)
 {
     Ice::InitializationData initData;
     initData.properties = Ice::createProperties(0);
-    initData.properties->setProperty("TestBridging.Endpoints", "default -p 33333 -t 1000");
+    initData.properties->setProperty("TestBridging.Endpoints", "default -p 33333 -t 10000");
+    initData.properties->setProperty("Ice.ThreadPool.Server.Size", "5");
+    initData.properties->setProperty("Ice.Default.CollocationOptimized", "0");
     Ice::CommunicatorPtr comm = Ice::initialize(initData);
     Ice::ObjectAdapterPtr adapter = comm->createObjectAdapter("TestBridging");
+    adapter->activate();
     Ice::Current dummy;
     dummy.adapter = adapter;
     dummy.id = comm->stringToIdentity("testobject");
@@ -1180,6 +1313,7 @@ BOOST_AUTO_TEST_CASE(BridgeRemoveEndpoint)
         p->id->endpointManagerId = "foo";
         p->id->destinationId = "bar";
         Hydra::Session::V1::SessionEndpointPtr::dynamicCast(p)->mediaSession = createTestSession(adapter, "testsession");
+        Hydra::Session::V1::SessionEndpointPtr::dynamicCast(p)->command = createTestCommand(adapter);
         Hydra::Session::V1::SessionEndpointSeq eps;
         eps.push_back(p);
         p = new Hydra::Session::V1::SessionEndpoint;
@@ -1187,18 +1321,21 @@ BOOST_AUTO_TEST_CASE(BridgeRemoveEndpoint)
         p->id->endpointManagerId = "foo1";
         p->id->destinationId = "bar";
         Hydra::Session::V1::SessionEndpointPtr::dynamicCast(p)->mediaSession = createTestSession(adapter, "testsession1");
+        Hydra::Session::V1::SessionEndpointPtr::dynamicCast(p)->command = createTestCommand(adapter);
         eps.push_back(p);
         p = new Hydra::Session::V1::SessionEndpoint;
         p->id = new Hydra::Core::Endpoint::V1::EndpointId;
         p->id->endpointManagerId = "foo";
         p->id->destinationId = "bar1";
         Hydra::Session::V1::SessionEndpointPtr::dynamicCast(p)->mediaSession = createTestSession(adapter, "testsession2");
+        Hydra::Session::V1::SessionEndpointPtr::dynamicCast(p)->command = createTestCommand(adapter);
         eps.push_back(p);
         p = new Hydra::Session::V1::SessionEndpoint;
         p->id = new Hydra::Core::Endpoint::V1::EndpointId;
         p->id->endpointManagerId = "fooa";
         p->id->destinationId = "bar";
         Hydra::Session::V1::SessionEndpointPtr::dynamicCast(p)->mediaSession = createTestSession(adapter, "testsession3");
+        Hydra::Session::V1::SessionEndpointPtr::dynamicCast(p)->command = createTestCommand(adapter);
         Hydra::BridgeService::BridgeImplPtr bridge(new Hydra::BridgeService::BridgeImpl(adapter, p, eps, 0, 0));
         eps.insert(eps.begin(), p);
         Hydra::Core::Endpoint::V1::EndpointIdPtr id(new Hydra::Core::Endpoint::V1::EndpointId);
@@ -1232,9 +1369,12 @@ BOOST_AUTO_TEST_CASE(BridgeRemoveEndpointUnknownEndpoint)
 {
     Ice::InitializationData initData;
     initData.properties = Ice::createProperties(0);
-    initData.properties->setProperty("TestBridging.Endpoints", "default -p 33333 -t 1000");
+    initData.properties->setProperty("TestBridging.Endpoints", "default -p 33333 -t 10000");
+    initData.properties->setProperty("Ice.ThreadPool.Server.Size", "5");
+    initData.properties->setProperty("Ice.Default.CollocationOptimized", "0");
     Ice::CommunicatorPtr comm = Ice::initialize(initData);
     Ice::ObjectAdapterPtr adapter = comm->createObjectAdapter("TestBridging");
+    adapter->activate();
     Ice::Current dummy;
     dummy.adapter = adapter;
     dummy.id = comm->stringToIdentity("testobject");
@@ -1245,6 +1385,7 @@ BOOST_AUTO_TEST_CASE(BridgeRemoveEndpointUnknownEndpoint)
         p->id->endpointManagerId = "foo";
         p->id->destinationId = "bar";
         Hydra::Session::V1::SessionEndpointPtr::dynamicCast(p)->mediaSession = createTestSession(adapter, "testsession");
+        Hydra::Session::V1::SessionEndpointPtr::dynamicCast(p)->command = createTestCommand(adapter);
         Hydra::Session::V1::SessionEndpointSeq eps;
         eps.push_back(p);
         p = new Hydra::Session::V1::SessionEndpoint;
@@ -1252,18 +1393,21 @@ BOOST_AUTO_TEST_CASE(BridgeRemoveEndpointUnknownEndpoint)
         p->id->endpointManagerId = "foo1";
         p->id->destinationId = "bar";
         Hydra::Session::V1::SessionEndpointPtr::dynamicCast(p)->mediaSession = createTestSession(adapter, "testsession1");
+        Hydra::Session::V1::SessionEndpointPtr::dynamicCast(p)->command = createTestCommand(adapter);
         eps.push_back(p);
         p = new Hydra::Session::V1::SessionEndpoint;
         p->id = new Hydra::Core::Endpoint::V1::EndpointId;
         p->id->endpointManagerId = "foo";
         p->id->destinationId = "bar1";
         Hydra::Session::V1::SessionEndpointPtr::dynamicCast(p)->mediaSession = createTestSession(adapter, "testsession2");
+        Hydra::Session::V1::SessionEndpointPtr::dynamicCast(p)->command = createTestCommand(adapter);
         eps.push_back(p);
         p = new Hydra::Session::V1::SessionEndpoint;
         p->id = new Hydra::Core::Endpoint::V1::EndpointId;
         p->id->endpointManagerId = "fooa";
         p->id->destinationId = "bar";
         Hydra::Session::V1::SessionEndpointPtr::dynamicCast(p)->mediaSession = createTestSession(adapter, "testsession3");
+        Hydra::Session::V1::SessionEndpointPtr::dynamicCast(p)->command = createTestCommand(adapter);
         Hydra::BridgeService::BridgeImplPtr bridge(new Hydra::BridgeService::BridgeImpl(adapter, p, eps, 0, 0 ));
         Hydra::Core::Endpoint::V1::EndpointIdPtr id(new Hydra::Core::Endpoint::V1::EndpointId);
         id->endpointManagerId = "foo1";
@@ -1287,9 +1431,12 @@ BOOST_AUTO_TEST_CASE(BridgeRemoveEndpointNullId)
 {
     Ice::InitializationData initData;
     initData.properties = Ice::createProperties(0);
-    initData.properties->setProperty("TestBridging.Endpoints", "default -p 33333 -t 1000");
+    initData.properties->setProperty("TestBridging.Endpoints", "default -p 33333 -t 10000");
+    initData.properties->setProperty("Ice.ThreadPool.Server.Size", "5");
+    initData.properties->setProperty("Ice.Default.CollocationOptimized", "0");
     Ice::CommunicatorPtr comm = Ice::initialize(initData);
     Ice::ObjectAdapterPtr adapter = comm->createObjectAdapter("TestBridging");
+    adapter->activate();
     Ice::Current dummy;
     dummy.adapter = adapter;
     dummy.id = comm->stringToIdentity("testobject");
@@ -1316,9 +1463,12 @@ BOOST_AUTO_TEST_CASE(BridgeRemoveEndpointInvalidId)
 {
     Ice::InitializationData initData;
     initData.properties = Ice::createProperties(0);
-    initData.properties->setProperty("TestBridging.Endpoints", "default -p 33333 -t 1000");
+    initData.properties->setProperty("TestBridging.Endpoints", "default -p 33333 -t 10000");
+    initData.properties->setProperty("Ice.ThreadPool.Server.Size", "5");
+    initData.properties->setProperty("Ice.Default.CollocationOptimized", "0");
     Ice::CommunicatorPtr comm = Ice::initialize(initData);
     Ice::ObjectAdapterPtr adapter = comm->createObjectAdapter("TestBridging");
+    adapter->activate();
     Ice::Current dummy;
     dummy.adapter = adapter;
     dummy.id = comm->stringToIdentity("testobject");
@@ -1353,9 +1503,12 @@ BOOST_AUTO_TEST_CASE(BridgeOperationsAfterShutdown)
 {
     Ice::InitializationData initData;
     initData.properties = Ice::createProperties(0);
-    initData.properties->setProperty("TestBridging.Endpoints", "default -p 33333 -t 1000");
+    initData.properties->setProperty("TestBridging.Endpoints", "default -p 33333 -t 10000");
+    initData.properties->setProperty("Ice.ThreadPool.Server.Size", "5");
+    initData.properties->setProperty("Ice.Default.CollocationOptimized", "0");
     Ice::CommunicatorPtr comm = Ice::initialize(initData);
     Ice::ObjectAdapterPtr adapter = comm->createObjectAdapter("TestBridging");
+    adapter->activate();
     Ice::Current dummy;
     dummy.adapter = adapter;
     dummy.id = comm->stringToIdentity("testobject");
@@ -1384,6 +1537,7 @@ BOOST_AUTO_TEST_CASE(BridgeOperationsAfterShutdown)
             p->id->endpointManagerId = "foo";
             p->id->destinationId = "bar";
             Hydra::Session::V1::SessionEndpointPtr::dynamicCast(p)->mediaSession = createTestSession(adapter, "testsession");
+            Hydra::Session::V1::SessionEndpointPtr::dynamicCast(p)->command = createTestCommand(adapter);
             bridge->addEndpoint(p, dummy);
             BOOST_CHECK("should not have succeeded." == 0);
         }
@@ -1459,9 +1613,12 @@ BOOST_AUTO_TEST_CASE(BridgeOperationsAfterDestroy)
 {
     Ice::InitializationData initData;
     initData.properties = Ice::createProperties(0);
-    initData.properties->setProperty("TestBridging.Endpoints", "default -p 33333 -t 1000");
+    initData.properties->setProperty("TestBridging.Endpoints", "default -p 33333 -t 10000");
+    initData.properties->setProperty("Ice.ThreadPool.Server.Size", "5");
+    initData.properties->setProperty("Ice.Default.CollocationOptimized", "0");
     Ice::CommunicatorPtr comm = Ice::initialize(initData);
     Ice::ObjectAdapterPtr adapter = comm->createObjectAdapter("TestBridging");
+    adapter->activate();
     Ice::Current dummy;
     dummy.adapter = adapter;
     dummy.id = comm->stringToIdentity("testobject");
@@ -1495,6 +1652,7 @@ BOOST_AUTO_TEST_CASE(BridgeOperationsAfterDestroy)
             p->id->endpointManagerId = "foo";
             p->id->destinationId = "bar";
             Hydra::Session::V1::SessionEndpointPtr::dynamicCast(p)->mediaSession = createTestSession(adapter, "testsession");
+            Hydra::Session::V1::SessionEndpointPtr::dynamicCast(p)->command = createTestCommand(adapter);
             bridge->addEndpoint(p, dummy);
             BOOST_CHECK("should not have succeeded." == 0);
         }
@@ -1601,9 +1759,12 @@ BOOST_AUTO_TEST_CASE(BridgeFactorySuspendedState)
 {
     Ice::InitializationData initData;
     initData.properties = Ice::createProperties(0);
-    initData.properties->setProperty("TestBridging.Endpoints", "default -p 33333 -t 1000");
+    initData.properties->setProperty("TestBridging.Endpoints", "default -p 33333 -t 10000");
+    initData.properties->setProperty("Ice.ThreadPool.Server.Size", "5");
+    initData.properties->setProperty("Ice.Default.CollocationOptimized", "0");
     Ice::CommunicatorPtr comm = Ice::initialize(initData);
     Ice::ObjectAdapterPtr adapter = comm->createObjectAdapter("TestBridging");
+    adapter->activate();
     Ice::Current dummy;
     dummy.adapter = adapter;
     dummy.id = comm->stringToIdentity("testobject");
@@ -1684,9 +1845,12 @@ BOOST_AUTO_TEST_CASE(BridgeEvents)
 {
     Ice::InitializationData initData;
     initData.properties = Ice::createProperties(0);
-    initData.properties->setProperty("TestBridging.Endpoints", "default -p 33333 -t 1000");
+    initData.properties->setProperty("TestBridging.Endpoints", "default -p 33333 -t 10000");
+    initData.properties->setProperty("Ice.ThreadPool.Server.Size", "5");
+    initData.properties->setProperty("Ice.Default.CollocationOptimized", "0");
     Ice::CommunicatorPtr comm = Ice::initialize(initData);
     Ice::ObjectAdapterPtr adapter = comm->createObjectAdapter("TestBridging");
+    adapter->activate();
     BridgeEventSubscriberIPtr subServant(new BridgeEventSubscriberI);
     Ice::ObjectPrx obj = adapter->addWithUUID(subServant);
     Hydra::Core::Bridging::V1::BridgeEventsPrx events = Hydra::Core::Bridging::V1::BridgeEventsPrx::checkedCast(obj);
@@ -1705,6 +1869,7 @@ BOOST_AUTO_TEST_CASE(BridgeEvents)
         p->id->endpointManagerId = "foo";
         p->id->destinationId = "bar";
         Hydra::Session::V1::SessionEndpointPtr::dynamicCast(p)->mediaSession = createTestSession(adapter, "testsession");
+        Hydra::Session::V1::SessionEndpointPtr::dynamicCast(p)->command = createTestCommand(adapter);
         bridge->addEndpoint(p);
         BOOST_CHECK(subServant->getLastAdded() != 0 && subServant->getLastAdded()->id->endpointManagerId == "foo");
         bridge->removeEndpoint(p->id);
@@ -1724,9 +1889,12 @@ BOOST_AUTO_TEST_CASE(BridgeMonitor)
 {
     Ice::InitializationData initData;
     initData.properties = Ice::createProperties(0);
-    initData.properties->setProperty("TestBridging.Endpoints", "default -p 33333 -t 1000");
+    initData.properties->setProperty("TestBridging.Endpoints", "default -p 33333 -t 10000");
+    initData.properties->setProperty("Ice.ThreadPool.Server.Size", "5");
+    initData.properties->setProperty("Ice.Default.CollocationOptimized", "0");
     Ice::CommunicatorPtr comm = Ice::initialize(initData);
     Ice::ObjectAdapterPtr adapter = comm->createObjectAdapter("TestBridging");
+    adapter->activate();
     BridgeMonitorPtr monitor(new BridgeMonitorI);
     Ice::ObjectPrx obj = adapter->addWithUUID(monitor);
     Hydra::Core::Bridging::V1::BridgeMonitorPrx monitorPrx = Hydra::Core::Bridging::V1::BridgeMonitorPrx::checkedCast(obj);
@@ -1745,6 +1913,7 @@ BOOST_AUTO_TEST_CASE(BridgeMonitor)
         p->id->endpointManagerId = "foo";
         p->id->destinationId = "bar";
         Hydra::Session::V1::SessionEndpointPtr::dynamicCast(p)->mediaSession = createTestSession(adapter, "testsession");
+        Hydra::Session::V1::SessionEndpointPtr::dynamicCast(p)->command = createTestCommand(adapter);
         bridge->addEndpoint(p);
         bridge->removeEndpoint(p->id);
         bridge->shutdown();

-----------------------------------------------------------------------


-- 
asterisk-scf/integration/bridging.git



More information about the asterisk-scf-commits mailing list