[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
Fri Sep 10 13:18:02 CDT 2010


branch "master" has been updated
       via  64ea1c3b4dc6d8ef0b43f1082a3bdd4a5486c05b (commit)
      from  1f827738e764ef4a09b669972bc65f4495373d20 (commit)

Summary of changes:
 slice                 |    2 +-
 test/CMakeLists.txt   |    3 +
 test/TestBridging.cpp |  200 ++++--------------------------------------------
 3 files changed, 21 insertions(+), 184 deletions(-)


- Log -----------------------------------------------------------------
commit 64ea1c3b4dc6d8ef0b43f1082a3bdd4a5486c05b
Author: Brent Eagles <beagles at digium.com>
Date:   Fri Sep 10 15:43:37 2010 -0230

    Temporarily remove tests from compilation as they are being reworked.

diff --git a/slice b/slice
index 14413db..200c642 160000
--- a/slice
+++ b/slice
@@ -1 +1 @@
-Subproject commit 14413db47bfae3d1ff57d36e80cfe700d755ae0b
+Subproject commit 200c642ce49b3daabeabe2d8ad105bfa980fec02
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
index 0e11081..651102a 100644
--- a/test/CMakeLists.txt
+++ b/test/CMakeLists.txt
@@ -10,7 +10,10 @@ hydra_component_add_file(bridging_unit_test "../src/BridgeImpl.h")
 hydra_component_add_file(bridging_unit_test "../src/BridgeManagerImpl.cpp")
 hydra_component_add_file(bridging_unit_test "../src/BridgeManagerImpl.h")
 hydra_component_add_file(bridging_unit_test "../src/MediaSplicer.cpp")
+hydra_component_add_file(bridging_unit_test "../src/BridgeListenerMgr.cpp")
+hydra_component_add_file(bridging_unit_test "../src/BridgeListenerMgr.h")
 hydra_component_add_file(bridging_unit_test "../src/MediaSplicer.h")
+hydra_component_add_ice_libraries(bridging_unit_test IceStorm)
 hydra_component_add_boost_libraries(bridging_unit_test unit_test_framework)
 hydra_component_add_boost_libraries(bridging_unit_test thread)
 hydra_component_build_standalone(bridging_unit_test)
diff --git a/test/TestBridging.cpp b/test/TestBridging.cpp
index bae3474..94a8f46 100644
--- a/test/TestBridging.cpp
+++ b/test/TestBridging.cpp
@@ -107,155 +107,56 @@ private:
     std::string mId;
 };
 
-
-class SessionI : public AsteriskSCF::Media::V1::Session
-{
-public:
-
-    SessionI(const std::string& id, const Ice::ObjectAdapterPtr& adapter) :
-        mId(id)
-    {
-        mSources.push_back(AsteriskSCF::Media::V1::StreamSourcePrx::uncheckedCast(
-              adapter->addWithUUID(new SourceI(mId + "Source"))));
-        mSinks.push_back(AsteriskSCF::Media::V1::StreamSinkPrx::uncheckedCast(
-              adapter->addWithUUID(new SinkI(mId + "Sink"))));
-    }
-
-    AsteriskSCF::Media::V1::StreamSourceSeq getSources(const Ice::Current&)
-    {
-        return mSources;
-    }
-
-    AsteriskSCF::Media::V1::StreamSinkSeq getSinks(const Ice::Current&)
-    {
-        return mSinks;
-    }
-
-    std::string getId(const Ice::Current&)
-    {
-        return mId;
-    }
-
-private:
-    std::string mId;
-
-    AsteriskSCF::Media::V1::StreamSourceSeq mSources;
-    AsteriskSCF::Media::V1::StreamSinkSeq mSinks;
-};
-
-class CommandI : public AsteriskSCF::Session::V1::SignalCommands
+class SessionListenerI : public AsteriskSCF::SessionCommunications::V1::SessionListener
 {
 public:
-    CommandI()  :
-        mCalled(false),
-        mTerminated(false)
-    {
-    }
-
-    bool call(const AsteriskSCF::Core::Endpoint::V1::EndpointIdPtr& caller, 
-      const AsteriskSCF::Core::Endpoint::V1::EndpointIdPtr& destination,
-      const AsteriskSCF::Session::V1::SignalCallbackPrx& cb,
-      const Ice::Current&)
-    {
-        mCalled = true;
-        BOOST_TEST_MESSAGE("call request received");
-        mCallback = cb;
-        mMyId = destination;
-        mCallback->connected(destination);
-        return true;
-    }
-    
-    void terminate(const AsteriskSCF::Core::Endpoint::V1::EndpointIdPtr& caller, 
-      const Ice::Current&)
-    {
-        mTerminated = true;
-        BOOST_TEST_MESSAGE("terminate request received");
-    }
-
-    void hangup()
-    {
-        BOOST_TEST_MESSAGE("hanging up");
-        if(mMyId == 0)
-        {
-            mMyId = new AsteriskSCF::Core::Endpoint::V1::EndpointId;
-            mMyId->endpointManagerId = "dummy";
-            mMyId->destinationId = "dummy";
-        }
-        AsteriskSCF::Session::V1::ResponseCodePtr r = new AsteriskSCF::Session::V1::ResponseCode;
-        r->isdnCode = 0;
-        mCallback->terminated(mMyId, r);
-    }
 
-    bool called()
+    SessionListenerI() : mTerminated(0)
     {
-        return mCalled;
     }
 
-    bool terminated()
-    {
-        return mTerminated;
-    }
-
-private:
-    bool mCalled;
-    bool mTerminated;
-    AsteriskSCF::Core::Endpoint::V1::EndpointIdPtr mMyId;
-    AsteriskSCF::Session::V1::SignalCallbackPrx mCallback;
-};
-
-typedef IceUtil::Handle<CommandI> CommandIPtr;
-
-class CallbackI : public AsteriskSCF::Session::V1::SignalCallback
-{
-public:
-
-    CallbackI() :
-        mTerminated(0)
-    {
-    }
-
-    void ring(const AsteriskSCF::Core::Endpoint::V1::EndpointIdPtr& p, const Ice::Current&)
+    void ring(const AsteriskSCF::SessionCommunications::V1::SessionPrx& session, const Ice::Current&)
     {
         BOOST_TEST_MESSAGE(__FUNCTION__);
     }
 
-    void connected(const AsteriskSCF::Core::Endpoint::V1::EndpointIdPtr& p, const Ice::Current&)
+    void connected(const AsteriskSCF::SessionCommunications::V1::SessionPrx& session, const Ice::Current&)
     {
         BOOST_TEST_MESSAGE(__FUNCTION__);
     }
 
-    void terminated(const AsteriskSCF::Core::Endpoint::V1::EndpointIdPtr& p, const AsteriskSCF::Session::V1::ResponseCodePtr& r, const Ice::Current& current)
+    void terminated(const AsteriskSCF::SessionCommunications::V1::SessionPrx& session, const AsteriskSCF::SessionCommunications::V1::ResponseCodePtr& r, const Ice::Current& current)
     {
         ++mTerminated;
         BOOST_TEST_MESSAGE(__FUNCTION__);
     }
 
-    void busy(const AsteriskSCF::Core::Endpoint::V1::EndpointIdPtr& p, const Ice::Current&)
+    void busy(const AsteriskSCF::SessionCommunications::V1::SessionPrx& session, const Ice::Current&)
     {
         BOOST_TEST_MESSAGE(__FUNCTION__);
     }
 
-    void congestion(const AsteriskSCF::Core::Endpoint::V1::EndpointIdPtr& p, const AsteriskSCF::Session::V1::ResponseCodePtr& r, const Ice::Current&)
+    void congestion(const AsteriskSCF::SessionCommunications::V1::SessionPrx& session, const AsteriskSCF::SessionCommunications::V1::ResponseCodePtr& r, const Ice::Current&)
     {
         BOOST_TEST_MESSAGE(__FUNCTION__);
     }
 
-    void hold(const AsteriskSCF::Core::Endpoint::V1::EndpointIdPtr& p, const Ice::Current&)
+    void hold(const AsteriskSCF::SessionCommunications::V1::SessionPrx& session, const Ice::Current&)
     {
         BOOST_TEST_MESSAGE(__FUNCTION__);
     }
 
-    void unhold(const AsteriskSCF::Core::Endpoint::V1::EndpointIdPtr& p, const Ice::Current&)
+    void unhold(const AsteriskSCF::SessionCommunications::V1::SessionPrx& session, const Ice::Current&)
     {
         BOOST_TEST_MESSAGE(__FUNCTION__);
     }
 
-    void flash(const AsteriskSCF::Core::Endpoint::V1::EndpointIdPtr& p, const Ice::Current&)
+    void flash(const AsteriskSCF::SessionCommunications::V1::SessionPrx& session, const Ice::Current&)
     {
         BOOST_TEST_MESSAGE(__FUNCTION__);
     }
 
-    void progress(const AsteriskSCF::Core::Endpoint::V1::EndpointIdPtr& p, const AsteriskSCF::Session::V1::ResponseCodePtr& r, const Ice::Current&)
+    void progress(const AsteriskSCF::SessionCommunications::V1::SessionPrx& session, const AsteriskSCF::SessionCommunications::V1::ResponseCodePtr& r, const Ice::Current&)
     {
         BOOST_TEST_MESSAGE(__FUNCTION__);
     }
@@ -270,9 +171,7 @@ protected:
     unsigned long mTerminated;
 };
 
-typedef IceUtil::Handle<CallbackI> CallbackIPtr;
-
-class BridgeEventSubscriberI : public AsteriskSCF::Core::Bridging::V1::BridgeEvents
+class BridgeEventSubscriberI : public AsteriskSCF::SessionCommunications::Bridging::V1::BridgeListener
 {
 public:
     BridgeEventSubscriberI() :
@@ -281,17 +180,15 @@ public:
     {
     }
 
-    void endpointAdded(const AsteriskSCF::Core::Endpoint::V1::BaseEndpointPtr& ep, const Ice::Current& current)
+    void sessionsAdded(const AsteriskSCF::SessionCommunications::V1::SessionSeq& sessions, const Ice::Current& current)
     {
-        mAdded = ep;
     }
 
-    void endpointRemoved(const AsteriskSCF::Core::Endpoint::V1::BaseEndpointPtr& ep, const Ice::Current& current)
+    void sessionsRemoved(const AsteriskSCF::SessionCommunications::V1::SessionSeq& sessions, const Ice::Current& current)
     {
-        mRemoved = ep;
     }
 
-    void shuttingDown(const Ice::Current& current)
+    void stopping(const Ice::Current& current)
     {
         mShuttingDown = true;
     }
@@ -301,16 +198,6 @@ public:
         mStopped = true;
     }
 
-    const AsteriskSCF::Core::Endpoint::V1::BaseEndpointPtr& getLastAdded()
-    {
-        return mAdded;
-    }
-
-    const AsteriskSCF::Core::Endpoint::V1::BaseEndpointPtr& getLastRemoved()
-    {
-        return mRemoved;
-    }
-
     bool resetShuttingDown()
     {
         bool result = mShuttingDown;
@@ -326,65 +213,10 @@ public:
     }
 
 private:
-    AsteriskSCF::Core::Endpoint::V1::BaseEndpointPtr mAdded;
-    AsteriskSCF::Core::Endpoint::V1::BaseEndpointPtr mRemoved;
     bool mShuttingDown;
     bool mStopped;
 };
 
-typedef IceUtil::Handle<SessionI> SessionIPtr;
-
-static AsteriskSCF::Media::V1::SessionPrx createTestSession(const Ice::ObjectAdapterPtr& p, const std::string& id)
-{
-    SessionIPtr session = new SessionI(id, p);
-    return AsteriskSCF::Media::V1::SessionPrx::uncheckedCast(p->addWithUUID(session));
-}
-
-static AsteriskSCF::Session::V1::SignalCommandsPrx createTestCommand(const Ice::ObjectAdapterPtr& p)
-{
-    return AsteriskSCF::Session::V1::SignalCommandsPrx::uncheckedCast(p->addWithUUID(new CommandI));
-}
-
-typedef IceUtil::Handle<BridgeEventSubscriberI> BridgeEventSubscriberIPtr;
-
-class BridgeMonitorI : public AsteriskSCF::Core::Bridging::V1::BridgeMonitor
-{
-public:
-    bool onAddEndpoint(const AsteriskSCF::Core::Endpoint::V1::BaseEndpointPtr& e, const Ice::Current&)
-    {
-        return true;
-    }
-
-    bool onRemoveEndpoint(const AsteriskSCF::Core::Endpoint::V1::BaseEndpointPtr& e, const Ice::Current&)
-    {
-        return true;
-    }
-
-    bool onListEndpoints(const AsteriskSCF::Core::Endpoint::V1::EndpointSeq& eps, AsteriskSCF::Core::Endpoint::V1::EndpointSeq& result, const Ice::Current&)
-    {
-        result = eps;
-        result.erase(result.begin());
-        return true;
-    }
-
-    bool onShutdown(const Ice::Current&)
-    {
-        return true;
-    }
-
-    bool onShutdownComplete(const Ice::Current&)
-    {
-        return true;
-    }
-
-    bool onDestroy(const Ice::Current&)
-    {
-        return true;
-    }
-};
-typedef IceUtil::Handle<BridgeMonitorI> BridgeMonitorPtr;
-
-
 static ArgCacheType mCachedArgs;
 
 /**
@@ -421,6 +253,7 @@ int BOOST_TEST_CALL_DECL main( int argc, char* argv[] )
    return ::boost::unit_test::unit_test_main( &init_unit_test, argc, argv );
 }
 
+#if 0
 BOOST_AUTO_TEST_CASE(BridgeEndpointValidationAddInvalidType)
 {
     Ice::InitializationData initData;
@@ -2218,3 +2051,4 @@ BOOST_AUTO_TEST_CASE(BridgeTerminateCallbackFromAdminEp)
     }
     adapter->destroy();
 }
+#endif

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


-- 
asterisk-scf/integration/bridging.git



More information about the asterisk-scf-commits mailing list