[hydra-commits] hydra/bridging.git branch "master" updated.

Commits to the Hydra project code repositories hydra-commits at lists.digium.com
Tue Aug 10 08:09:59 CDT 2010


branch "master" has been updated
       via  1e9815d515ade27c93532a6f997208fe83bf252e (commit)
       via  b2cca420abfa7054a8ff6fd9cf99a8c4fbe661d6 (commit)
      from  b132a80fd47e8d7c305ce4c74eb1b2fa3f071a1f (commit)

Summary of changes:
 slice                     |    2 +-
 src/BridgeFactoryImpl.cpp |   11 ++--
 src/BridgeFactoryImpl.h   |    4 +-
 src/BridgeImpl.cpp        |   98 +++++++++++++++++++++++++--
 src/BridgeImpl.h          |    7 ++-
 src/CMakeLists.txt        |    1 +
 src/Service.cpp           |   59 +++++++++++++++-
 test/CMakeLists.txt       |    1 +
 test/TestBridging.cpp     |  166 ++++++++++++++++++++++++++++++++++++---------
 9 files changed, 301 insertions(+), 48 deletions(-)


- Log -----------------------------------------------------------------
commit 1e9815d515ade27c93532a6f997208fe83bf252e
Author: Brent Eagles <beagles at digium.com>
Date:   Tue Aug 10 10:37:59 2010 -0230

    Added some tests for the events hookup.

diff --git a/src/BridgeImpl.cpp b/src/BridgeImpl.cpp
index 5f06310..0c30c0f 100644
--- a/src/BridgeImpl.cpp
+++ b/src/BridgeImpl.cpp
@@ -123,6 +123,7 @@ Hydra::BridgeService::BridgeImpl::BridgeImpl(
   const Hydra::Core::Bridging::V1::BridgeEventsPrx& ev
 
   ) :
+    mState(Running),
     mAdminEndpoint(adminEp),
     mEndpoints(initialEndpoints),
     mManager(manager),
diff --git a/test/TestBridging.cpp b/test/TestBridging.cpp
index 674dfb8..dd61012 100644
--- a/test/TestBridging.cpp
+++ b/test/TestBridging.cpp
@@ -79,6 +79,8 @@ private:
     bool mStopped;
 };
 
+typedef IceUtil::Handle<BridgeEventSubscriberI> BridgeEventSubscriberIPtr;
+
 static ArgCacheType mCachedArgs;
 
 /**
@@ -1438,3 +1440,43 @@ BOOST_AUTO_TEST_CASE(BridgeFactorySuspendedState)
     }
     adapter->destroy();
 }
+
+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("TestBridgeEvents.Endpoints", "default -p 33334 -t 1000");
+    Ice::CommunicatorPtr comm = Ice::initialize(initData);
+    Ice::ObjectAdapterPtr adapter = comm->createObjectAdapter("TestBridging");
+    BridgeEventSubscriberIPtr subServant(new BridgeEventSubscriberI);
+    Ice::ObjectPrx obj = adapter->addWithUUID(subServant);
+    Hydra::Core::Bridging::V1::BridgeEventsPrx events = Hydra::Core::Bridging::V1::BridgeEventsPrx::checkedCast(obj);
+   
+    Ice::Current dummy;
+    dummy.adapter = adapter;
+    dummy.id = comm->stringToIdentity("testobject");
+    try
+    {
+        Hydra::BridgeService::BridgeFactoryImplPtr factoryServant(new Hydra::BridgeService::BridgeFactoryImpl(adapter, events));
+        obj = adapter->addWithUUID(factoryServant);
+        Hydra::Core::Bridging::V1::BridgeFactoryPrx factory(Hydra::Core::Bridging::V1::BridgeFactoryPrx::checkedCast(obj));
+        Hydra::Core::Bridging::V1::BridgePrx bridge = factory->createBridge(0, Hydra::Core::Endpoint::V1::EndpointSeq(), 0);
+        Hydra::Session::V1::SessionEndpointPtr p(new Hydra::Session::V1::SessionEndpoint);
+        p->id = new Hydra::Core::Endpoint::V1::EndpointId;
+        p->id->endpointManagerId = "foo";
+        p->id->deviceId = "bar";
+        bridge->addEndpoint(p);
+        BOOST_CHECK(subServant->getLastAdded() != 0 && subServant->getLastAdded()->id->endpointManagerId == "foo");
+        bridge->removeEndpoint(p->id);
+        BOOST_CHECK(subServant->getLastRemoved() != 0 && subServant->getLastRemoved()->id->endpointManagerId == "foo");
+        bridge->shutdown();
+        BOOST_CHECK(subServant->resetShuttingDown());
+    }
+    catch(...)
+    {
+        adapter->destroy();
+        throw;
+    }
+    adapter->destroy();
+}

commit b2cca420abfa7054a8ff6fd9cf99a8c4fbe661d6
Author: Brent Eagles <beagles at digium.com>
Date:   Tue Aug 10 10:09:25 2010 -0230

    Added calls to event interface and a wrapper in the event that
    the service is configured without access to icestorm.

diff --git a/slice b/slice
index 3caf633..1d3ca2a 160000
--- a/slice
+++ b/slice
@@ -1 +1 @@
-Subproject commit 3caf6332202c33bc3d48d676260bf9a3e1edde9f
+Subproject commit 1d3ca2a8bbaa340bf32e327c0e9d6db2f5dd3c1b
diff --git a/src/BridgeFactoryImpl.cpp b/src/BridgeFactoryImpl.cpp
index 3845588..71cb584 100644
--- a/src/BridgeFactoryImpl.cpp
+++ b/src/BridgeFactoryImpl.cpp
@@ -28,10 +28,11 @@ namespace BridgeService
 } // End of namespace BridgeService
 } // End of namespace Hydra
 
-Hydra::BridgeService::BridgeFactoryImpl::BridgeFactoryImpl(Ice::ObjectAdapterPtr adapter) :
-   mShuttingDown(false),
-   mSuspended(false),
-   mAdapter(adapter)
+Hydra::BridgeService::BridgeFactoryImpl::BridgeFactoryImpl(Ice::ObjectAdapterPtr adapter, const Hydra::Core::Bridging::V1::BridgeEventsPrx& ev) :
+    mShuttingDown(false),
+    mSuspended(false),
+    mAdapter(adapter),
+    mBridgeEvents(ev)
 {
     mLogger.getInfoStream() << "Created Hydra Session-Oriented Bridge Factory." << std::endl; 
 }
@@ -137,7 +138,7 @@ Hydra::Core::Bridging::V1::BridgePrx Hydra::BridgeService::BridgeFactoryImpl::cr
     }
     reap();
 
-    Hydra::BridgeService::BridgeImplPtr bridge = new Hydra::BridgeService::BridgeImpl(adminEp, eps, mgr);
+    Hydra::BridgeService::BridgeImplPtr bridge = new Hydra::BridgeService::BridgeImpl(adminEp, eps, mgr, mBridgeEvents);
     Ice::ObjectPrx obj = mAdapter->addWithUUID(bridge);
     mBridges.push_back(bridge);
     mLogger.getInfoStream() << current.adapter->getCommunicator()->identityToString(current.id) << ": creating new bridge " << obj->ice_toString() << "." << std::endl;
diff --git a/src/BridgeFactoryImpl.h b/src/BridgeFactoryImpl.h
index d8f9f47..eeb2dea 100644
--- a/src/BridgeFactoryImpl.h
+++ b/src/BridgeFactoryImpl.h
@@ -3,6 +3,7 @@
 #define __HYDRA_BRIDGE_FACTORY_IMPL_H
 
 #include <Core/Bridging/BridgeServiceIf.h>
+#include <Core/Bridging/BridgeServiceEventsIf.h>
 #include <boost/thread/shared_mutex.hpp>
 #include <vector>
 
@@ -17,7 +18,7 @@ namespace Hydra
    {
    public:
 
-      BridgeFactoryImpl(Ice::ObjectAdapterPtr adapter);
+      BridgeFactoryImpl(Ice::ObjectAdapterPtr adapter, const Core::Bridging::V1::BridgeEventsPrx& events);
 
       //
       // Hydra::Core::Bridging::V1::BridgeFactory Interface
@@ -43,6 +44,7 @@ namespace Hydra
       bool mSuspended;
       Ice::ObjectAdapterPtr mAdapter;
       Logger mLogger;
+      Core::Bridging::V1::BridgeEventsPrx mBridgeEvents;
 
       void reap();
    };
diff --git a/src/BridgeImpl.cpp b/src/BridgeImpl.cpp
index e37b822..5f06310 100644
--- a/src/BridgeImpl.cpp
+++ b/src/BridgeImpl.cpp
@@ -1,6 +1,7 @@
 #include "BridgeImpl.h"
 #include <System/Component/ComponentServiceIf.h>
 #include <Ice/Ice.h>
+#include <memory>
 
 //
 // TODO:
@@ -10,6 +11,79 @@ namespace Hydra
 {
 namespace BridgeService
 {
+    class EventTopicWrapper
+    {
+    public:
+        EventTopicWrapper(const Core::Bridging::V1::BridgeEventsPrx& ev) :
+            mEvents(ev)
+        {
+        }
+
+        void endpointAdded(const Core::Endpoint::V1::BaseEndpointPtr& ep)
+        {
+            if(mEvents)
+            {
+                try
+                {
+                    mEvents->endpointAdded(ep);
+                }
+                catch(const Ice::Exception& ex)
+                {
+                    mLogger.getDebugStream() << __FUNCTION__ << ": publishing failed with " <<  ex << std::endl;
+                }
+            }
+        }
+
+        void endpointRemoved(const Core::Endpoint::V1::BaseEndpointPtr& ep)
+        {
+            if(mEvents)
+            {
+                try
+                {
+                    mEvents->endpointRemoved(ep);
+                }
+                catch(const Ice::Exception& ex)
+                {
+                    mLogger.getDebugStream() << __FUNCTION__ << ": publishing failed with " <<  ex << std::endl;
+                }
+            }
+        }
+
+        void shuttingDown()
+        {
+            if(mEvents)
+            {
+                try
+                {
+                    mEvents->shuttingDown();
+                }
+                catch(const Ice::Exception& ex)
+                {
+                    mLogger.getDebugStream() << __FUNCTION__ << ": publishing failed with " <<  ex << std::endl;
+                }
+            }
+        }
+
+        void stopped()
+        {
+            if(mEvents)
+            {
+                try
+                {
+                    mEvents->stopped();
+                }
+                catch(const Ice::Exception& ex)
+                {
+                    mLogger.getDebugStream() << __FUNCTION__ << ": publishing failed with " <<  ex << std::endl;
+                }
+            }
+        }
+
+    private:
+        Core::Bridging::V1::BridgeEventsPrx mEvents;
+        Logger mLogger;
+    };
+
     //
     // Functor to support using for_each on shutdown.
     //
@@ -45,12 +119,15 @@ namespace BridgeService
 Hydra::BridgeService::BridgeImpl::BridgeImpl(
   const Hydra::Session::V1::SessionEndpointPtr& adminEp,
   const Hydra::Session::V1::SessionEndpointSeq& initialEndpoints,
-  const Hydra::Core::Bridging::V1::BridgeMonitorPrx& manager
+  const Hydra::Core::Bridging::V1::BridgeMonitorPrx& manager,
+  const Hydra::Core::Bridging::V1::BridgeEventsPrx& ev
+
   ) :
-   mAdminEndpoint(adminEp),
-   mEndpoints(initialEndpoints),
-   mManager(manager),
-   mAdminEndpointInList(true)
+    mAdminEndpoint(adminEp),
+    mEndpoints(initialEndpoints),
+    mManager(manager),
+    mEvents(new Hydra::BridgeService::EventTopicWrapper(ev)),
+    mAdminEndpointInList(true)
 {
 }
 
@@ -83,9 +160,15 @@ void Hydra::BridgeService::BridgeImpl::addEndpoint(const Hydra::Core::Endpoint::
         mLogger.getDebugStream() << __FUNCTION__ << ": endpoint with id " << ep->id->endpointManagerId << ":" << ep->id->deviceId << " already registered." << std::endl;
         throw Hydra::Core::Bridging::V1::EndpointAlreadyRegistered(ep->id);
     }
+
+    //
+    // It's hear that the media operations will be calculated and the media allocator accessed for building the media operations for
+    // the bridge.
+    //
     mEndpoints.push_back(newEndpoint);
     mLogger.getDebugStream() << __FUNCTION__ << ": bridge " << current.adapter->getCommunicator()->identityToString(current.id) <<
          " now has " << mEndpoints.size() << " endpoints." << std::endl;
+    mEvents->endpointAdded(newEndpoint);
 }
 
 void Hydra::BridgeService::BridgeImpl::removeEndpoint(const Hydra::Core::Endpoint::V1::EndpointIdPtr& ep, const Ice::Current& current)
@@ -118,6 +201,7 @@ void Hydra::BridgeService::BridgeImpl::removeEndpoint(const Hydra::Core::Endpoin
         //
         return;
     }
+    mEvents->endpointRemoved(*i);
     mEndpoints.erase(i);
 
     mLogger.getDebugStream() << __FUNCTION__ << ": bridge " << current.adapter->getCommunicator()->identityToString(current.id) <<
@@ -162,6 +246,7 @@ void Hydra::BridgeService::BridgeImpl::shutdown(const Ice::Current& current)
         }
         mState = ShuttingDown;
     }
+    mEvents->shuttingDown();
 
     //
     // TODO: Source ids for bridge generated operations should come from configuration, etc.
@@ -177,6 +262,7 @@ void Hydra::BridgeService::BridgeImpl::shutdown(const Ice::Current& current)
     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();
 }
 
 void Hydra::BridgeService::BridgeImpl::destroy(const Ice::Current& current)
@@ -195,6 +281,7 @@ void Hydra::BridgeService::BridgeImpl::destroy(const Ice::Current& current)
     }
     mState = Destroyed;
     mLogger.getInfoStream() << current.adapter->getCommunicator()->identityToString(current.id) << ": is now destroyed." << std::endl;
+    mEvents->stopped();
 }
 
 bool Hydra::BridgeService::BridgeImpl::destroyed()
diff --git a/src/BridgeImpl.h b/src/BridgeImpl.h
index 59961ad..22ac5ba 100644
--- a/src/BridgeImpl.h
+++ b/src/BridgeImpl.h
@@ -3,6 +3,7 @@
 #define __HYDRA_BRIDGE_SERVICE_IMPL_H
 
 #include <Core/Bridging/BridgeServiceIf.h>
+#include <Core/Bridging/BridgeServiceEventsIf.h>
 #include <Session/SessionIf.h>
 #include <boost/thread/shared_mutex.hpp>
 #include <vector>
@@ -21,6 +22,8 @@ namespace BridgeService
         return true;
     }
 
+    class EventTopicWrapper; 
+
    //
    // BridgeImpl is a session oriented bridge. 
    //
@@ -28,7 +31,7 @@ namespace BridgeService
    {
    public:
       BridgeImpl(const Session::V1::SessionEndpointPtr& adminEp, const Session::V1::SessionEndpointSeq& initialEndpoints,
-        const Core::Bridging::V1::BridgeMonitorPrx& manager);
+        const Core::Bridging::V1::BridgeMonitorPrx& manager, const Core::Bridging::V1::BridgeEventsPrx& ev);
 
       //
       // Hydra::Core::Bridging::Bridge Interface
@@ -58,7 +61,7 @@ namespace BridgeService
       Core::Endpoint::V1::BaseEndpointPtr mAdminEndpoint;
       Session::V1::SessionEndpointSeq mEndpoints;
       Core::Bridging::V1::BridgeMonitorPrx mManager;
-      Core::Bridging::V1::BridgeEventsPrx mEvents;
+      std::auto_ptr<EventTopicWrapper> mEvents;
 
       //
       // Policy values.
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index bd446ac..bd20407 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -3,6 +3,7 @@ hydra_component_add_slice(bridgeservice EndpointIf)
 hydra_component_add_slice(bridgeservice ComponentServiceIf)
 hydra_component_add_slice(bridgeservice SessionIf)
 hydra_component_add_slice(bridgeservice BridgeServiceIf)
+hydra_component_add_slice(bridgeservice BridgeServiceEventsIf)
 hydra_component_add_file(bridgeservice Service.cpp)
 hydra_component_add_file(bridgeservice BridgeImpl.cpp)
 hydra_component_add_file(bridgeservice BridgeFactoryImpl.cpp)
diff --git a/src/Service.cpp b/src/Service.cpp
index 0e3ab33..b4844bd 100644
--- a/src/Service.cpp
+++ b/src/Service.cpp
@@ -1,5 +1,8 @@
-#include <Ice/Ice.h>
 #include "BridgeFactoryImpl.h"
+#include "Logger.h"
+
+#include <Ice/Ice.h>
+#include <IceStorm/IceStorm.h>
 
 class BridgingApp : public Ice::Application
 {
@@ -11,6 +14,7 @@ protected:
     void interruptCallback(int);
 
 private:
+    Hydra::BridgeService::Logger mLogger;
 };
 
 BridgingApp::BridgingApp()
@@ -19,8 +23,59 @@ BridgingApp::BridgingApp()
 
 int BridgingApp::run(int, char*[])
 {
+    mLogger.getTraceStream() << "Launching Hydra Session-Oriented Bridging Service." << std::endl;
+
+    IceStorm::TopicManagerPrx topicManager;
+    try
+    {
+        std::string prop = communicator()->getProperties()->getProperty("TopicManager.Proxy");
+        if(prop.size() != 0)
+        {
+            topicManager = IceStorm::TopicManagerPrx::checkedCast(communicator()->stringToProxy(prop));
+        }
+    }
+    catch(const Ice::Exception& ex)
+    {
+        mLogger.getInfoStream() << "Attempt to get topic manager failed with: " << ex << std::endl;
+    }
+    IceStorm::TopicPrx topic;
+    if(!topicManager)
+    {
+        mLogger.getInfoStream() << "No topic manager, service events will not be published." << std::endl;
+    }
+    else
+    {
+        mLogger.getDebugStream() << "Setting up the bridge events topic." << std::endl;
+        std::string t = communicator()->getProperties()->getPropertyWithDefault("BridgeService.TopicName", "BridgeEvents");
+        try
+        {
+            topic = topicManager->retrieve(t);
+            mLogger.getDebugStream() << "topic was already created." << std::endl;
+        }
+        catch(const IceStorm::NoSuchTopic&)
+        {
+            mLogger.getDebugStream() << "topic not found, creating." << std::endl;
+        }
+        if(!topic)
+        {
+            try
+            {
+                topic = topicManager->create(t);
+            }
+            catch(const IceStorm::TopicExists&)
+            {
+                mLogger.getDebugStream() << "attempted to create a topic that already existed, retrieving" << std::endl;
+                topic = topicManager->retrieve(t);
+            }
+        }
+    }
+    Hydra::Core::Bridging::V1::BridgeEventsPrx events;
+    if(topic)
+    {
+        events = Hydra::Core::Bridging::V1::BridgeEventsPrx::uncheckedCast(topic->getPublisher());
+    }
     Ice::ObjectAdapterPtr adapter = communicator()->createObjectAdapter("Hydra.BridgeService");
-    Hydra::Core::Bridging::V1::BridgeFactoryPtr f(new Hydra::BridgeService::BridgeFactoryImpl(adapter));
+    Hydra::Core::Bridging::V1::BridgeFactoryPtr f(new Hydra::BridgeService::BridgeFactoryImpl(adapter, events));
     adapter->add(f, communicator()->stringToIdentity("BridgeFactory"));
     adapter->activate();
     communicator()->waitForShutdown();
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
index 7f845c5..d98e1e1 100644
--- a/test/CMakeLists.txt
+++ b/test/CMakeLists.txt
@@ -4,6 +4,7 @@ hydra_component_add_slice(bridging_unit_test EndpointIf)
 hydra_component_add_slice(bridging_unit_test ComponentServiceIf)
 hydra_component_add_slice(bridging_unit_test SessionIf)
 hydra_component_add_slice(bridging_unit_test BridgeServiceIf)
+hydra_component_add_slice(bridging_unit_test BridgeServiceEventsIf)
 hydra_component_add_file(bridging_unit_test TestBridging.cpp)
 hydra_component_add_file(bridging_unit_test "../src/BridgeImpl.cpp")
 hydra_component_add_file(bridging_unit_test "../src/BridgeFactoryImpl.cpp")
diff --git a/test/TestBridging.cpp b/test/TestBridging.cpp
index d279959..674dfb8 100644
--- a/test/TestBridging.cpp
+++ b/test/TestBridging.cpp
@@ -18,6 +18,67 @@ public:
    int argc;
    char **argv;
 };
+
+class BridgeEventSubscriberI : public Hydra::Core::Bridging::V1::BridgeEvents
+{
+public:
+    BridgeEventSubscriberI() :
+        mShuttingDown(false),
+        mStopped(false)
+    {
+    }
+
+    void endpointAdded(const Hydra::Core::Endpoint::V1::BaseEndpointPtr& ep, const Ice::Current& current)
+    {
+        mAdded = ep;
+    }
+
+    void endpointRemoved(const Hydra::Core::Endpoint::V1::BaseEndpointPtr& ep, const Ice::Current& current)
+    {
+        mRemoved = ep;
+    }
+
+    void shuttingDown(const Ice::Current& current)
+    {
+        mShuttingDown = true;
+    }
+
+    void stopped(const Ice::Current& current)
+    {
+        mStopped = true;
+    }
+
+    const Hydra::Core::Endpoint::V1::BaseEndpointPtr& getLastAdded()
+    {
+        return mAdded;
+    }
+
+    const Hydra::Core::Endpoint::V1::BaseEndpointPtr& getLastRemoved()
+    {
+        return mRemoved;
+    }
+
+    bool resetShuttingDown()
+    {
+        bool result = mShuttingDown;
+        mShuttingDown = false;
+        return result;
+    }
+
+    bool resetStopped()
+    {
+        bool result = mStopped;
+        mStopped = false;
+        return result;
+    }
+
+private:
+    Hydra::Core::Endpoint::V1::BaseEndpointPtr mAdded;
+    Hydra::Core::Endpoint::V1::BaseEndpointPtr mRemoved;
+    bool mShuttingDown;
+    bool mStopped;
+};
+
 static ArgCacheType mCachedArgs;
 
 /**
@@ -66,7 +127,7 @@ BOOST_AUTO_TEST_CASE(BridgeEndpointValidationAddInvalidType)
     dummy.id = comm->stringToIdentity("testobject");
     try
     {
-        Hydra::BridgeService::BridgeImplPtr b(new Hydra::BridgeService::BridgeImpl(0, Hydra::Session::V1::SessionEndpointSeq(), 0));
+        Hydra::BridgeService::BridgeImplPtr b(new Hydra::BridgeService::BridgeImpl(0, Hydra::Session::V1::SessionEndpointSeq(), 0, 0));
         try
         {
             Hydra::Core::Endpoint::V1::BaseEndpointPtr p(new Hydra::Core::Endpoint::V1::BaseEndpoint);
@@ -101,7 +162,7 @@ BOOST_AUTO_TEST_CASE(BridgeEndpointValidationAddInvalidValue)
     dummy.id = comm->stringToIdentity("testobject");
     try
     {
-        Hydra::BridgeService::BridgeImplPtr b(new Hydra::BridgeService::BridgeImpl(0, Hydra::Session::V1::SessionEndpointSeq(), 0));
+        Hydra::BridgeService::BridgeImplPtr b(new Hydra::BridgeService::BridgeImpl(0, Hydra::Session::V1::SessionEndpointSeq(), 0, 0));
         try
         {
             b->addEndpoint(0, dummy);
@@ -130,7 +191,7 @@ BOOST_AUTO_TEST_CASE(BridgeEndpointValidationAddValidTypeNullId)
     Ice::Current dummy;
     dummy.adapter = adapter;
     dummy.id = comm->stringToIdentity("testobject");
-    Hydra::BridgeService::BridgeImplPtr b(new Hydra::BridgeService::BridgeImpl(0, Hydra::Session::V1::SessionEndpointSeq(), 0));
+    Hydra::BridgeService::BridgeImplPtr b(new Hydra::BridgeService::BridgeImpl(0, Hydra::Session::V1::SessionEndpointSeq(), 0, 0));
     try
     {
         try
@@ -162,7 +223,7 @@ BOOST_AUTO_TEST_CASE(BridgeEndpointValidationAddValidTypeInvalidId)
     Ice::Current dummy;
     dummy.adapter = adapter;
     dummy.id = comm->stringToIdentity("testobject");
-    Hydra::BridgeService::BridgeImplPtr b(new Hydra::BridgeService::BridgeImpl(0, Hydra::Session::V1::SessionEndpointSeq(), 0));
+    Hydra::BridgeService::BridgeImplPtr b(new Hydra::BridgeService::BridgeImpl(0, Hydra::Session::V1::SessionEndpointSeq(), 0, 0));
     try
     {
         try
@@ -198,7 +259,7 @@ BOOST_AUTO_TEST_CASE(BridgeEndpointAddValidTypeValidValue)
     Ice::Current dummy;
     dummy.adapter = adapter;
     dummy.id = comm->stringToIdentity("testobject");
-    Hydra::BridgeService::BridgeImplPtr b(new Hydra::BridgeService::BridgeImpl(0, Hydra::Session::V1::SessionEndpointSeq(), 0));
+    Hydra::BridgeService::BridgeImplPtr b(new Hydra::BridgeService::BridgeImpl(0, Hydra::Session::V1::SessionEndpointSeq(), 0, 0));
     try
     {
         try
@@ -233,7 +294,7 @@ BOOST_AUTO_TEST_CASE(BridgeEndpointListEp)
     Ice::Current dummy;
     dummy.adapter = adapter;
     dummy.id = comm->stringToIdentity("testobject");
-    Hydra::BridgeService::BridgeImplPtr b(new Hydra::BridgeService::BridgeImpl(0, Hydra::Session::V1::SessionEndpointSeq(), 0));
+    Hydra::BridgeService::BridgeImplPtr b(new Hydra::BridgeService::BridgeImpl(0, Hydra::Session::V1::SessionEndpointSeq(), 0, 0));
     try
     {
         try
@@ -272,7 +333,7 @@ BOOST_AUTO_TEST_CASE(BridgeFactoryCreateBridgeWithInvalidAdminEndpoint)
     dummy.id = comm->stringToIdentity("testobject");
     try
     {
-        Hydra::BridgeService::BridgeFactoryImplPtr factory(new Hydra::BridgeService::BridgeFactoryImpl(adapter));
+        Hydra::BridgeService::BridgeFactoryImplPtr factory(new Hydra::BridgeService::BridgeFactoryImpl(adapter, 0));
 
         try
         {
@@ -308,7 +369,7 @@ BOOST_AUTO_TEST_CASE(BridgeFactoryCreateBridgeWithInvalidAdminEndpointId)
     dummy.id = comm->stringToIdentity("testobject");
     try
     {
-        Hydra::BridgeService::BridgeFactoryImplPtr factory(new Hydra::BridgeService::BridgeFactoryImpl(adapter));
+        Hydra::BridgeService::BridgeFactoryImplPtr factory(new Hydra::BridgeService::BridgeFactoryImpl(adapter, 0));
 
         try
         {
@@ -345,13 +406,12 @@ BOOST_AUTO_TEST_CASE(BridgeFactoryCreateBridgeWithValidAdminEndpoint)
     dummy.id = comm->stringToIdentity("testobject");
     try
     {
-        Hydra::BridgeService::BridgeFactoryImplPtr factory(new Hydra::BridgeService::BridgeFactoryImpl(adapter));
+        Hydra::BridgeService::BridgeFactoryImplPtr factory(new Hydra::BridgeService::BridgeFactoryImpl(adapter, 0));
         Hydra::Core::Endpoint::V1::BaseEndpointPtr p(new Hydra::Session::V1::SessionEndpoint);
         p->id = new Hydra::Core::Endpoint::V1::EndpointId;
         p->id->endpointManagerId = "foo";
         p->id->deviceId = "bar";
-        Hydra::Core::Bridging::V1::BridgeMonitorPrx monitor;
-        Hydra::Core::Bridging::V1::BridgePrx b =  factory->createBridge(p, Hydra::Core::Endpoint::V1::EndpointSeq(), monitor, dummy);
+        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();
         BOOST_CHECK(endpoints.size() == 1);
@@ -377,7 +437,7 @@ BOOST_AUTO_TEST_CASE(BridgeFactoryEmptyBridge)
     dummy.id = comm->stringToIdentity("testobject");
     try
     {
-        Hydra::BridgeService::BridgeFactoryImplPtr factory(new Hydra::BridgeService::BridgeFactoryImpl(adapter));
+        Hydra::BridgeService::BridgeFactoryImplPtr factory(new Hydra::BridgeService::BridgeFactoryImpl(adapter, 0));
         Hydra::Core::Bridging::V1::BridgePrx b =  factory->createBridge(0, Hydra::Core::Endpoint::V1::EndpointSeq(), 0, dummy);
         BOOST_CHECK(b);
         Hydra::Core::Endpoint::V1::EndpointSeq endpoints = b->listEndpoints();
@@ -403,7 +463,7 @@ BOOST_AUTO_TEST_CASE(BridgeFactoryInitialEndpointInvalidType)
     dummy.id = comm->stringToIdentity("testobject");
     try
     {
-        Hydra::BridgeService::BridgeFactoryImplPtr factory(new Hydra::BridgeService::BridgeFactoryImpl(adapter));
+        Hydra::BridgeService::BridgeFactoryImplPtr factory(new Hydra::BridgeService::BridgeFactoryImpl(adapter, 0));
         Hydra::Core::Endpoint::V1::BaseEndpointPtr p(new Hydra::Core::Endpoint::V1::BaseEndpoint);
         p->id = new Hydra::Core::Endpoint::V1::EndpointId;
         p->id->endpointManagerId = "foo";
@@ -439,7 +499,7 @@ BOOST_AUTO_TEST_CASE(BridgeFactoryInitialEndpointNullId)
     dummy.id = comm->stringToIdentity("testobject");
     try
     {
-        Hydra::BridgeService::BridgeFactoryImplPtr factory(new Hydra::BridgeService::BridgeFactoryImpl(adapter));
+        Hydra::BridgeService::BridgeFactoryImplPtr factory(new Hydra::BridgeService::BridgeFactoryImpl(adapter, 0));
         Hydra::Core::Endpoint::V1::BaseEndpointPtr p(new Hydra::Session::V1::SessionEndpoint);
         p->id = 0;
         Hydra::Core::Endpoint::V1::EndpointSeq eps;
@@ -472,7 +532,7 @@ BOOST_AUTO_TEST_CASE(BridgeFactoryInitialEndpointInvalidId)
     dummy.id = comm->stringToIdentity("testobject");
     try
     {
-        Hydra::BridgeService::BridgeFactoryImplPtr factory(new Hydra::BridgeService::BridgeFactoryImpl(adapter));
+        Hydra::BridgeService::BridgeFactoryImplPtr factory(new Hydra::BridgeService::BridgeFactoryImpl(adapter, 0));
         Hydra::Core::Endpoint::V1::BaseEndpointPtr p(new Hydra::Session::V1::SessionEndpoint);
         p->id = new Hydra::Core::Endpoint::V1::EndpointId;
         p->id->endpointManagerId = "";
@@ -509,7 +569,7 @@ BOOST_AUTO_TEST_CASE(BridgeFactoryCreateBridgeWithValidEndpoint)
     dummy.id = comm->stringToIdentity("testobject");
     try
     {
-        Hydra::BridgeService::BridgeFactoryImplPtr factory(new Hydra::BridgeService::BridgeFactoryImpl(adapter));
+        Hydra::BridgeService::BridgeFactoryImplPtr factory(new Hydra::BridgeService::BridgeFactoryImpl(adapter, 0));
         Hydra::Core::Endpoint::V1::BaseEndpointPtr p(new Hydra::Session::V1::SessionEndpoint);
         p->id = new Hydra::Core::Endpoint::V1::EndpointId;
         p->id->endpointManagerId = "foo";
@@ -542,7 +602,7 @@ BOOST_AUTO_TEST_CASE(BridgeFactoryCreateBridgeWithCollidingAdminAndInitialEndpoi
     dummy.id = comm->stringToIdentity("testobject");
     try
     {
-        Hydra::BridgeService::BridgeFactoryImplPtr factory(new Hydra::BridgeService::BridgeFactoryImpl(adapter));
+        Hydra::BridgeService::BridgeFactoryImplPtr factory(new Hydra::BridgeService::BridgeFactoryImpl(adapter, 0));
         Hydra::Core::Endpoint::V1::BaseEndpointPtr p(new Hydra::Session::V1::SessionEndpoint);
         p->id = new Hydra::Core::Endpoint::V1::EndpointId;
         p->id->endpointManagerId = "foo";
@@ -581,7 +641,7 @@ BOOST_AUTO_TEST_CASE(BridgeFactoryCreateBridgeWithCollisions)
     dummy.id = comm->stringToIdentity("testobject");
     try
     {
-        Hydra::BridgeService::BridgeFactoryImplPtr factory(new Hydra::BridgeService::BridgeFactoryImpl(adapter));
+        Hydra::BridgeService::BridgeFactoryImplPtr factory(new Hydra::BridgeService::BridgeFactoryImpl(adapter, 0));
         Hydra::Core::Endpoint::V1::BaseEndpointPtr p(new Hydra::Session::V1::SessionEndpoint);
         p->id = new Hydra::Core::Endpoint::V1::EndpointId;
         p->id->endpointManagerId = "foo";
@@ -621,7 +681,7 @@ BOOST_AUTO_TEST_CASE(BridgeFactoryCreateBridgeWithValidInitialSet)
     dummy.id = comm->stringToIdentity("testobject");
     try
     {
-        Hydra::BridgeService::BridgeFactoryImplPtr factory(new Hydra::BridgeService::BridgeFactoryImpl(adapter));
+        Hydra::BridgeService::BridgeFactoryImplPtr factory(new Hydra::BridgeService::BridgeFactoryImpl(adapter, 0));
         Hydra::Core::Endpoint::V1::BaseEndpointPtr p(new Hydra::Session::V1::SessionEndpoint);
         p->id = new Hydra::Core::Endpoint::V1::EndpointId;
         p->id->endpointManagerId = "foo";
@@ -706,7 +766,7 @@ BOOST_AUTO_TEST_CASE(BridgeAddEndpoint)
         p->id = new Hydra::Core::Endpoint::V1::EndpointId;
         p->id->endpointManagerId = "fooa";
         p->id->deviceId = "bar";
-        Hydra::BridgeService::BridgeImplPtr bridge(new Hydra::BridgeService::BridgeImpl(p, eps, 0));
+        Hydra::BridgeService::BridgeImplPtr bridge(new Hydra::BridgeService::BridgeImpl(p, eps, 0, 0));
         eps.insert(eps.begin(), p);
         p = new Hydra::Session::V1::SessionEndpoint;
         p->id = new Hydra::Core::Endpoint::V1::EndpointId;
@@ -770,7 +830,7 @@ BOOST_AUTO_TEST_CASE(BridgeAddEndpointAlreadyRegistered)
         p->id = new Hydra::Core::Endpoint::V1::EndpointId;
         p->id->endpointManagerId = "fooa";
         p->id->deviceId = "bar";
-        Hydra::BridgeService::BridgeImplPtr bridge(new Hydra::BridgeService::BridgeImpl(p, eps, 0));
+        Hydra::BridgeService::BridgeImplPtr bridge(new Hydra::BridgeService::BridgeImpl(p, eps, 0, 0));
         eps.insert(eps.begin(), p);
         p = new Hydra::Session::V1::SessionEndpoint;
         p->id = new Hydra::Core::Endpoint::V1::EndpointId;
@@ -822,7 +882,7 @@ BOOST_AUTO_TEST_CASE(BridgeAddInvalidEndpoint)
     try
     {
         Hydra::Session::V1::SessionEndpointSeq eps;
-        Hydra::BridgeService::BridgeImplPtr bridge(new Hydra::BridgeService::BridgeImpl(0, eps, 0));
+        Hydra::BridgeService::BridgeImplPtr bridge(new Hydra::BridgeService::BridgeImpl(0, eps, 0, 0));
         Hydra::Core::Endpoint::V1::BaseEndpointPtr p(new Hydra::Core::Endpoint::V1::BaseEndpoint);
         p->id = new Hydra::Core::Endpoint::V1::EndpointId;
         p->id->endpointManagerId = "foo";
@@ -855,7 +915,7 @@ BOOST_AUTO_TEST_CASE(BridgeAddInvalidId1)
     try
     {
         Hydra::Session::V1::SessionEndpointSeq eps;
-        Hydra::BridgeService::BridgeImplPtr bridge(new Hydra::BridgeService::BridgeImpl(0, eps, 0));
+        Hydra::BridgeService::BridgeImplPtr bridge(new Hydra::BridgeService::BridgeImpl(0, eps, 0, 0));
         Hydra::Core::Endpoint::V1::BaseEndpointPtr p(new Hydra::Session::V1::SessionEndpoint);
         p->id = new Hydra::Core::Endpoint::V1::EndpointId;
         p->id->endpointManagerId = "";
@@ -888,7 +948,7 @@ BOOST_AUTO_TEST_CASE(BridgeAddInvalidId2)
     try
     {
         Hydra::Session::V1::SessionEndpointSeq eps;
-        Hydra::BridgeService::BridgeImplPtr bridge(new Hydra::BridgeService::BridgeImpl(0, eps, 0));
+        Hydra::BridgeService::BridgeImplPtr bridge(new Hydra::BridgeService::BridgeImpl(0, eps, 0, 0));
         Hydra::Core::Endpoint::V1::BaseEndpointPtr p(new Hydra::Session::V1::SessionEndpoint);
         bridge->addEndpoint(p, dummy);
         BOOST_CHECK("Should not have succeeded." == 0);
@@ -937,7 +997,7 @@ BOOST_AUTO_TEST_CASE(BridgeRemoveEndpoint)
         p->id = new Hydra::Core::Endpoint::V1::EndpointId;
         p->id->endpointManagerId = "fooa";
         p->id->deviceId = "bar";
-        Hydra::BridgeService::BridgeImplPtr bridge(new Hydra::BridgeService::BridgeImpl(p, eps, 0));
+        Hydra::BridgeService::BridgeImplPtr bridge(new Hydra::BridgeService::BridgeImpl(p, eps, 0, 0));
         eps.insert(eps.begin(), p);
         Hydra::Core::Endpoint::V1::EndpointIdPtr id(new Hydra::Core::Endpoint::V1::EndpointId);
         id->endpointManagerId = "foo1";
@@ -998,7 +1058,7 @@ BOOST_AUTO_TEST_CASE(BridgeRemoveEndpointUnknownEndpoint)
         p->id = new Hydra::Core::Endpoint::V1::EndpointId;
         p->id->endpointManagerId = "fooa";
         p->id->deviceId = "bar";
-        Hydra::BridgeService::BridgeImplPtr bridge(new Hydra::BridgeService::BridgeImpl(p, eps, 0));
+        Hydra::BridgeService::BridgeImplPtr bridge(new Hydra::BridgeService::BridgeImpl(p, eps, 0, 0 ));
         Hydra::Core::Endpoint::V1::EndpointIdPtr id(new Hydra::Core::Endpoint::V1::EndpointId);
         id->endpointManagerId = "foo1";
         id->deviceId = "unknown";
@@ -1030,7 +1090,7 @@ BOOST_AUTO_TEST_CASE(BridgeRemoveEndpointNullId)
     try
     {
         Hydra::Session::V1::SessionEndpointSeq eps;
-        Hydra::BridgeService::BridgeImplPtr bridge(new Hydra::BridgeService::BridgeImpl(0, eps, 0));
+        Hydra::BridgeService::BridgeImplPtr bridge(new Hydra::BridgeService::BridgeImpl(0, eps, 0, 0));
         bridge->removeEndpoint(0, dummy);
         BOOST_CHECK("Should not have succeeded." == 0);
     }
@@ -1059,7 +1119,7 @@ BOOST_AUTO_TEST_CASE(BridgeRemoveEndpointInvalidId)
     try
     {
         Hydra::Session::V1::SessionEndpointSeq eps;
-        Hydra::BridgeService::BridgeImplPtr bridge(new Hydra::BridgeService::BridgeImpl(0, eps, 0));
+        Hydra::BridgeService::BridgeImplPtr bridge(new Hydra::BridgeService::BridgeImpl(0, eps, 0, 0));
         Hydra::Core::Endpoint::V1::EndpointIdPtr id(new Hydra::Core::Endpoint::V1::EndpointId);
         id->endpointManagerId = "";
         id->deviceId = "";
@@ -1096,7 +1156,7 @@ BOOST_AUTO_TEST_CASE(BridgeOperationsAfterShutdown)
     try
     {
         Hydra::Session::V1::SessionEndpointSeq eps;
-        Hydra::BridgeService::BridgeImplPtr bridge(new Hydra::BridgeService::BridgeImpl(0, eps, 0));
+        Hydra::BridgeService::BridgeImplPtr bridge(new Hydra::BridgeService::BridgeImpl(0, eps, 0, 0));
         bridge->shutdown(dummy);
         //
         // Calling shutdown while in the process of shutting down is permitted but is a no-op.
@@ -1201,7 +1261,7 @@ BOOST_AUTO_TEST_CASE(BridgeOperationsAfterDestroy)
     try
     {
         Hydra::Session::V1::SessionEndpointSeq eps;
-        Hydra::BridgeService::BridgeImplPtr bridge(new Hydra::BridgeService::BridgeImpl(0, eps, 0));
+        Hydra::BridgeService::BridgeImplPtr bridge(new Hydra::BridgeService::BridgeImpl(0, eps, 0, 0));
         bridge->destroy(dummy);
         //
         // Calling shutdown while in the process of shutting down is permitted but is a no-op.
@@ -1308,7 +1368,7 @@ BOOST_AUTO_TEST_CASE(BridgeFactorySuspendedState)
     dummy.id = comm->stringToIdentity("testobject");
     try
     {
-        Hydra::BridgeService::BridgeFactoryImplPtr factory(new Hydra::BridgeService::BridgeFactoryImpl(adapter));
+        Hydra::BridgeService::BridgeFactoryImplPtr factory(new Hydra::BridgeService::BridgeFactoryImpl(adapter, 0));
 
         try
         {
@@ -1320,7 +1380,7 @@ BOOST_AUTO_TEST_CASE(BridgeFactorySuspendedState)
             factory->suspend(dummy);
             try
             {
-                Hydra::Core::Bridging::V1::BridgePrx b =  factory->createBridge(0, Hydra::Core::Endpoint::V1::EndpointSeq(), 0, dummy);
+                Hydra::Core::Bridging::V1::BridgePrx b =  factory->createBridge(0, Hydra::Core::Endpoint::V1::EndpointSeq(), 0,dummy);
                 BOOST_CHECK("Should not have succeeded" == 0);
             }
             catch(const Hydra::System::Component::V1::Suspended&)

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


-- 
hydra/bridging.git




More information about the asterisk-scf-commits mailing list