[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
Mon Oct 11 08:07:39 CDT 2010


branch "master" has been updated
       via  d1c727c5c900c2b75c610729dd877e9b7ea90d5a (commit)
       via  7e5d5386b0bd1d3c024059417118cf9d2b242555 (commit)
      from  043a91370f522de35e0d588acc4eb9451a497100 (commit)

Summary of changes:
 src/Service.cpp                  |   20 ++++++++-
 test/BridgeListenerI.cpp         |    2 +
 test/BridgeListenerI.h           |    8 ++++
 test/BridgeManagerListenerI.cpp  |    2 +
 test/BridgeManagerListenerI.h    |    8 ++++
 test/BridgeTestChannelDriver.cpp |   11 -----
 test/BridgeTestChannelDriver.h   |   22 ----------
 test/IceStormCollocator.cpp      |   84 --------------------------------------
 test/IceStormCollocator.h        |   56 -------------------------
 test/SessionListenerI.cpp        |    2 +
 test/SessionListenerI.h          |    8 ++++
 test/TestBridging.cpp            |    6 ++-
 test/TestCommandDriver.cpp       |    2 +
 test/TestCommandDriver.h         |    8 ++++
 test/channel_driver              |    2 +-
 15 files changed, 64 insertions(+), 177 deletions(-)
 delete mode 100644 test/BridgeTestChannelDriver.cpp
 delete mode 100644 test/BridgeTestChannelDriver.h
 delete mode 100644 test/IceStormCollocator.cpp
 delete mode 100644 test/IceStormCollocator.h


- Log -----------------------------------------------------------------
commit d1c727c5c900c2b75c610729dd877e9b7ea90d5a
Author: Brent Eagles <beagles at digium.com>
Date:   Mon Oct 11 10:37:04 2010 -0230

    Some cleanups to the test suite.

diff --git a/cmake b/cmake
index e9cf9f2..17066de 160000
--- a/cmake
+++ b/cmake
@@ -1 +1 @@
-Subproject commit e9cf9f2e6dd03fe7bc39c363d72812aceed28367
+Subproject commit 17066de364794f3befcdcca030ca31d349e83eea
diff --git a/test/BridgeListenerI.cpp b/test/BridgeListenerI.cpp
index 2bc6e21..1e3cac7 100644
--- a/test/BridgeListenerI.cpp
+++ b/test/BridgeListenerI.cpp
@@ -7,6 +7,8 @@
  */
 #include "BridgeListenerI.h"
 
+using namespace AsteriskSCF::BridgingTest;
+
 BridgeListenerI::BridgeListenerI() :
     mShuttingDown(false),
     mStopped(false)
diff --git a/test/BridgeListenerI.h b/test/BridgeListenerI.h
index 136739e..7b63459 100644
--- a/test/BridgeListenerI.h
+++ b/test/BridgeListenerI.h
@@ -9,6 +9,11 @@
 
 #include <SessionCommunications/Bridging/BridgingIf.h>
 
+namespace AsteriskSCF
+{
+namespace BridgingTest
+{
+
 class BridgeListenerI : public AsteriskSCF::SessionCommunications::Bridging::V1::BridgeListener
 {
 public:
@@ -36,3 +41,6 @@ private:
     bool mSessionsAdded;
     bool mSessionsRemoved;
 };
+
+} /* end of namespace BridgingTest */
+} /* end of namespace AsteriskSCF */
diff --git a/test/BridgeManagerListenerI.cpp b/test/BridgeManagerListenerI.cpp
index 37f0781..0f2ea16 100644
--- a/test/BridgeManagerListenerI.cpp
+++ b/test/BridgeManagerListenerI.cpp
@@ -7,6 +7,8 @@
  */
 #include "BridgeManagerListenerI.h"
 
+using namespace AsteriskSCF::BridgingTest;
+
 BridgeManagerListenerI::BridgeManagerListenerI() :
     mCreated(0),
     mStopped(0),
diff --git a/test/BridgeManagerListenerI.h b/test/BridgeManagerListenerI.h
index 8541c18..1a09bb7 100644
--- a/test/BridgeManagerListenerI.h
+++ b/test/BridgeManagerListenerI.h
@@ -9,6 +9,11 @@
 
 #include <SessionCommunications/Bridging/BridgingIf.h>
 
+namespace AsteriskSCF
+{
+namespace BridgingTest
+{
+
 class BridgeManagerListenerI : public AsteriskSCF::SessionCommunications::Bridging::V1::BridgeManagerListener
 {
 public:
@@ -32,3 +37,6 @@ private:
 };
 
 typedef IceUtil::Handle<BridgeManagerListenerI> BridgeManagerListenerIPtr;
+
+} /* end of namespace BridgingTest */
+} /* end of namespace AsteriskSCF */
diff --git a/test/BridgeTestChannelDriver.cpp b/test/BridgeTestChannelDriver.cpp
deleted file mode 100644
index affd18d..0000000
--- a/test/BridgeTestChannelDriver.cpp
+++ /dev/null
@@ -1,11 +0,0 @@
-/*
- * Asterisk Scalable Communications Framework
- *
- * Copyright (C) 2010 -- Digium, Inc.
- *
- * All rights reserved.
- */
-
-BridgeTestChannelDriver::setHandler(const CommandsPtr& cmd)
-{
-}
diff --git a/test/BridgeTestChannelDriver.h b/test/BridgeTestChannelDriver.h
deleted file mode 100644
index 272ab21..0000000
--- a/test/BridgeTestChannelDriver.h
+++ /dev/null
@@ -1,22 +0,0 @@
-/*
- * Asterisk Scalable Communications Framework
- *
- * Copyright (C) 2010 -- Digium, Inc.
- *
- * All rights reserved.
- */
-#pragma once
-
-#include <Commands.h>
-
-//
-// The test endpoint.
-//
-class BridgeTestChannelDriver : public CommandDriver
-{
-public:
-    virtual void setHandler(const CommandsPtr& cmd);
-private:
-    IceUtil::Mutex mLocks;
-    CommandsPtr mCommands;
-};
diff --git a/test/IceStormCollocator.cpp b/test/IceStormCollocator.cpp
deleted file mode 100644
index 2287957..0000000
--- a/test/IceStormCollocator.cpp
+++ /dev/null
@@ -1,84 +0,0 @@
-/*
-* Asterisk Scalable Communications Framework
-*
-* Copyright (C) 2010 -- Digium, Inc.
-*
-* All rights reserved.
-*/
-#include <Ice/Ice.h>
-#include <IceStorm/IceStorm.h>
-#include <assert.h>
-#include <algorithm>
-#include "IceStormCollocator.h"
-
-//
-// The idea behind this class is that it needs to access the entry point that IceBox would
-// have used and then invoke the methods that are needed to start and stop the IceStorm
-// service.
-//
-
-IceStormInstance::IceStormInstance()
-{
-    //
-    // Intentionally left blank.
-    //
-}
-
-IceStormInstance::~IceStormInstance()
-{
-    try
-    {
-        stop();
-    }
-    catch(...)
-    {
-    }
-}
-
-typedef IceBox::Service* (*FACTORY)(Ice::CommunicatorPtr);
-
-void IceStormInstance::start(const std::string& namePrefix, const Ice::PropertiesPtr& p)
-{
-    //
-    // TODO: Configuration?
-    //
-    Ice::InitializationData initData;
-    initData.properties = p;
-    mCommunicator = Ice::initialize(initData);
-    mLibrary = new IceInternal::DynamicLibrary();
-
-    IceInternal::DynamicLibrary::symbol_type entry = mLibrary->loadEntryPoint("IceStormService:createIceStorm");
-    if(entry == 0)
-    {
-        throw mLibrary->getErrorMessage();
-    }
-    FACTORY factory = (FACTORY)entry;
-    mService = factory(mCommunicator);
-    assert(mService != 0);
-    Ice::StringSeq options;
-    mService->start(namePrefix, mCommunicator, options);
-}
-
-void IceStormInstance::stop()
-{
-    if(mService)
-    {
-        mService->stop();
-    }
-}
-
-IceUtil::Mutex IceStormInstance::mInstanceMutex;
-IceStormInstancePtr IceStormInstance::mInstance;
-
-IceStormInstancePtr IceStormInstance::getInstance()
-{
-    IceUtil::Mutex::Lock lock(mInstanceMutex);
-    if(!mInstance)
-    {
-        //
-        // Need to initialize!
-        //
-        return new IceStormInstance;
-    }
-    return mInstance;
-}
diff --git a/test/IceStormCollocator.h b/test/IceStormCollocator.h
deleted file mode 100644
index 34e030b..0000000
--- a/test/IceStormCollocator.h
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
-* Asterisk Scalable Communications Framework
-*
-* Copyright (C) 2010 -- Digium, Inc.
-*
-* All rights reserved.
-*/
-#pragma once
-
-#include <Ice/DynamicLibrary.h>
-#include <Ice/Service.h>
-#include <IceBox/IceBox.h>
-#include <Ice/Ice.h>
-#include <IceStorm/IceStorm.h>
-#include <string>
-
-/**
- * A helper class that instantiates IceStorm in-process, removing the need to launch
- * a separate process to access IceStorm services. Useful for testing!
- */
-
-class IceStormInstance;
-typedef IceUtil::Handle<IceStormInstance> IceStormInstancePtr;
-
-class IceStormInstance : public IceUtil::Shared
-{
-    IceStormInstance();
-public:
-    ~IceStormInstance();
-
-    /**
-     * start() creates a communicator and two object adapters. All are destroyed
-     * when stop is called or the object is deleted.
-     */
-    void start(const std::string&,  const Ice::PropertiesPtr&);
-
-    /**
-     * "nice" applications should explictly call stop !
-     */
-    void stop();
-
-    static IceStormInstancePtr getInstance();
-
-private:
-    static IceUtil::Mutex mInstanceMutex;
-    static IceStormInstancePtr mInstance;
-
-    IceInternal::DynamicLibraryPtr mLibrary;
-    IceBox::ServicePtr mService;
-
-    Ice::CommunicatorPtr mCommunicator;
-};
-
-typedef IceUtil::Handle<IceStormInstance> IceStormInstancePtr;
-
-
diff --git a/test/SessionListenerI.cpp b/test/SessionListenerI.cpp
index 709f8eb..6ab0ff5 100644
--- a/test/SessionListenerI.cpp
+++ b/test/SessionListenerI.cpp
@@ -9,6 +9,8 @@
 #include "SessionListenerI.h"
 #include <boost/test/unit_test.hpp>
 
+using namespace AsteriskSCF::BridgingTest;
+
 SessionListenerI::SessionListenerI() : mTerminated(0)
 {
 }
diff --git a/test/SessionListenerI.h b/test/SessionListenerI.h
index 738176a..2d82c7f 100644
--- a/test/SessionListenerI.h
+++ b/test/SessionListenerI.h
@@ -10,6 +10,11 @@
 #include <Ice/Ice.h>
 #include <SessionCommunications/SessionCommunicationsIf.h>
 
+namespace AsteriskSCF
+{
+namespace BridgingTest
+{
+
 class SessionListenerI : public AsteriskSCF::SessionCommunications::V1::SessionListener
 {
 public:
@@ -31,3 +36,6 @@ public:
 protected:
     unsigned long mTerminated;
 };
+
+} /* end of namespace BridgingTest */
+} /* end of namespace AsteriskSCF */
diff --git a/test/TestBridging.cpp b/test/TestBridging.cpp
index 633b2f7..40ddaaa 100644
--- a/test/TestBridging.cpp
+++ b/test/TestBridging.cpp
@@ -25,8 +25,11 @@
 #include <Ice/Ice.h>
 #include <IceBox/IceBox.h>
 
-/* Cache the command line arguments so that Ice can be initialized within the global fixture. */
+using namespace AsteriskSCF::BridgingTest;
 
+/* Cache the command line arguments so that Ice can be initialized within the global fixture. */
+namespace 
+{
 class TestEnvironment : public IceUtil::Shared
 {
 public:
@@ -459,6 +462,7 @@ public:
 private:
     TestRunnerPtr mRunner;
 };
+}
 
 extern "C" {
     HYDRA_ICEBOX_EXPORT ::IceBox::Service* create(Ice::CommunicatorPtr communicator)
diff --git a/test/TestCommandDriver.cpp b/test/TestCommandDriver.cpp
index d08377a..739bc7c 100644
--- a/test/TestCommandDriver.cpp
+++ b/test/TestCommandDriver.cpp
@@ -7,6 +7,8 @@
  */
 #include "TestCommandDriver.h"
 
+using namespace AsteriskSCF::BridgingTest;
+
 TestCommandDriver::TestCommandDriver()
 {
 }
diff --git a/test/TestCommandDriver.h b/test/TestCommandDriver.h
index 61d9066..0bfe3f9 100644
--- a/test/TestCommandDriver.h
+++ b/test/TestCommandDriver.h
@@ -10,6 +10,11 @@
 #include <CommandsIf.h>
 #include <IceUtil/Handle.h>
 
+namespace AsteriskSCF
+{
+namespace BridgingTest
+{
+
 class TestCommandDriver  : public IceUtil::Shared
 {
 public:
@@ -23,3 +28,6 @@ private:
 };
 
 typedef IceUtil::Handle<TestCommandDriver> TestCommandDriverPtr;
+
+} /* end of namespace BridgingTest */
+} /* end of namespace AsteriskSCF */
diff --git a/test/channel_driver b/test/channel_driver
index 6f7bcf6..3b7128d 160000
--- a/test/channel_driver
+++ b/test/channel_driver
@@ -1 +1 @@
-Subproject commit 6f7bcf618f587e939743eb987af205bb5d114835
+Subproject commit 3b7128dd68b00ac105076983517f45d383777bec

commit 7e5d5386b0bd1d3c024059417118cf9d2b242555
Author: Brent Eagles <beagles at digium.com>
Date:   Mon Oct 11 09:33:40 2010 -0230

    Add communicator cleanup code.

diff --git a/cmake b/cmake
index 17066de..e9cf9f2 160000
--- a/cmake
+++ b/cmake
@@ -1 +1 @@
-Subproject commit 17066de364794f3befcdcca030ca31d349e83eea
+Subproject commit e9cf9f2e6dd03fe7bc39c363d72812aceed28367
diff --git a/src/Service.cpp b/src/Service.cpp
index c33b979..43ac35e 100644
--- a/src/Service.cpp
+++ b/src/Service.cpp
@@ -207,8 +207,24 @@ void BridgingApp::stop()
     {
         mRegisterThread->stop();
     }
-    mLocator->unregister();
-    mAdapter->deactivate();
+    try
+    {
+        mLocator->unregister();
+    }
+    catch(const Ice::Exception&)
+    {
+    }
+    try
+    {
+        Ice::CommunicatorPtr comm = mAdapter->getCommunicator();
+        comm->shutdown();
+        mAdapter->waitForDeactivate();
+        comm->destroy();
+    }
+    catch(...)
+    {
+        // TODO: log
+    }
 }
 }
 

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


-- 
asterisk-scf/integration/bridging.git



More information about the asterisk-scf-commits mailing list