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

Commits to the Asterisk SCF project code repositories asterisk-scf-commits at lists.digium.com
Mon Nov 15 14:10:53 CST 2010


branch "master" has been updated
       via  104d395b4080eb675a7846afb5cd1602349cdb01 (commit)
      from  68de66ffb4c487d2e49dbd0ea048f50a4d1b0a08 (commit)

Summary of changes:
 src/CollocatedIceStorm.h         |    2 +-
 src/ServiceLocator.cpp           |   28 +++---
 src/ServiceLocatorManagement.cpp |  188 +++++++++++++++---------------
 src/ServiceLocatorManagement.h   |    2 +-
 src/ServiceManagement.cpp        |   24 ++--
 src/ServiceManagement.h          |    2 +-
 test/TestServiceLocator.cpp      |  234 +++++++++++++++++++-------------------
 7 files changed, 240 insertions(+), 240 deletions(-)


- Log -----------------------------------------------------------------
commit 104d395b4080eb675a7846afb5cd1602349cdb01
Author: David M. Lee <dlee at digium.com>
Date:   Mon Nov 15 14:03:38 2010 -0600

    Updated indentation to match the style guide.

diff --git a/src/CollocatedIceStorm.h b/src/CollocatedIceStorm.h
index 8e6d32f..da792f2 100644
--- a/src/CollocatedIceStorm.h
+++ b/src/CollocatedIceStorm.h
@@ -28,7 +28,7 @@ namespace ServiceDiscovery
 {
 /**
  * A helper class that instantiates IceStorm in-process, removing the need to launch
- * a separate process to access IceStorm services. 
+ * a separate process to access IceStorm services.
  */
 
 class CollocatedIceStorm;
diff --git a/src/ServiceLocator.cpp b/src/ServiceLocator.cpp
index 3e2d884..b76772c 100644
--- a/src/ServiceLocator.cpp
+++ b/src/ServiceLocator.cpp
@@ -35,7 +35,7 @@ using namespace AsteriskSCF::ServiceDiscovery;
 
 namespace
 {
-   Logger const &lg = getLoggerFactory().getLogger("AsteriskSCF.System.Discovery");
+Logger const &lg = getLoggerFactory().getLogger("AsteriskSCF.System.Discovery");
 
 /**
  * Implementation of the Ice::Application class
@@ -44,8 +44,8 @@ class ServiceLocatorApp : public IceBox::Service
 {
 public:
     void start(const string& name,
-      const Ice::CommunicatorPtr& communicator,
-      const Ice::StringSeq& args);
+        const Ice::CommunicatorPtr& communicator,
+        const Ice::StringSeq& args);
     void stop();
 
 private:
@@ -61,7 +61,7 @@ private:
 class ServiceLocatorImpl : public ServiceLocator
 {
 public:
-    ServiceLocatorImpl(ServiceLocatorManagementImpl* LocatorServiceManagement) : 
+    ServiceLocatorImpl(ServiceLocatorManagementImpl* LocatorServiceManagement) :
         mLocatorServiceManagement(LocatorServiceManagement) { };
     Ice::ObjectPrx locate(const ServiceLocatorParamsPtr&, const Ice::Current&);
     Ice::ObjectProxySeq locateAll(const ServiceLocatorParamsPtr&, const Ice::Current&);
@@ -80,9 +80,9 @@ private:
  * Implementation of the locate method as defined in service_locator.ice
  */
 Ice::ObjectPrx ServiceLocatorImpl::locate(const ServiceLocatorParamsPtr& params,
-   const Ice::Current&)
+    const Ice::Current&)
 {
-    /* This API call forwards into the management implementation, it is separated to 
+    /* This API call forwards into the management implementation, it is separated to
      * provide a level of security. */
     return mLocatorServiceManagement->locate(params);
 }
@@ -91,7 +91,7 @@ Ice::ObjectPrx ServiceLocatorImpl::locate(const ServiceLocatorParamsPtr& params,
  * Implementation of the locateAll method as defined in service_locator.ice
  */
 Ice::ObjectProxySeq ServiceLocatorImpl::locateAll(const ServiceLocatorParamsPtr& params,
-   const Ice::Current&)
+    const Ice::Current&)
 {
     /* This API call forwards into the management implementation, it is separated to
      * provide a level of security. */
@@ -108,7 +108,7 @@ void ServiceLocatorApp::start(const string& name, const Ice::CommunicatorPtr& co
     /* Talk to the topic manager to either create or get the service discovery topic,
      * configured or default */
     IceStorm::TopicManagerPrx topicManager = IceStorm::TopicManagerPrx::checkedCast(
-      communicator->propertyToProxy("TopicManager.Proxy"));
+        communicator->propertyToProxy("TopicManager.Proxy"));
 
     EventsPrx serviceDiscoveryTopic;
 
@@ -153,13 +153,13 @@ void ServiceLocatorApp::start(const string& name, const Ice::CommunicatorPtr& co
      * into the infrastructure while discovery as a read only function may be allowed to all.
      */
     mManagementAdapter= communicator->createObjectAdapter(
-      "ServiceLocatorManagementAdapter");
+        "ServiceLocatorManagementAdapter");
 
     ServiceLocatorManagementImpl* locatorServiceManagement =
         new ServiceLocatorManagementImpl(mManagementAdapter, serviceDiscoveryTopic);
 
     mManagementAdapter->add(locatorServiceManagement,
-      communicator->stringToIdentity("LocatorServiceManagement"));
+        communicator->stringToIdentity("LocatorServiceManagement"));
 
     mManagementAdapter->activate();
 
@@ -206,8 +206,8 @@ void ServiceLocatorApp::stop()
 
 extern "C"
 {
-    ASTERISK_SCF_ICEBOX_EXPORT IceBox::Service* create(Ice::CommunicatorPtr communicator)
-    {
-        return new ServiceLocatorApp;
-    }
+ASTERISK_SCF_ICEBOX_EXPORT IceBox::Service* create(Ice::CommunicatorPtr communicator)
+{
+    return new ServiceLocatorApp;
+}
 }
diff --git a/src/ServiceLocatorManagement.cpp b/src/ServiceLocatorManagement.cpp
index 0a3b2c8..e48dbd7 100644
--- a/src/ServiceLocatorManagement.cpp
+++ b/src/ServiceLocatorManagement.cpp
@@ -53,8 +53,8 @@ public:
      * @param compare A proxy to the comparator service we are wrapping.
      */
     ServiceLocatorComparator(const ServiceLocatorParamsComparePrx& compare) :
-        mCompare(compare) 
-    { 
+        mCompare(compare)
+    {
     }
 
     /**
@@ -84,8 +84,8 @@ class ServiceLocatorManagementImplPriv : public Ice::Object
 {
 public:
     ServiceLocatorManagementImplPriv(const Ice::ObjectAdapterPtr& adapter, const EventsPrx& serviceDiscoveryTopic) :
-        mAdapter(adapter), mLocatorTopic(serviceDiscoveryTopic) 
-    { 
+        mAdapter(adapter), mLocatorTopic(serviceDiscoveryTopic)
+    {
     };
 
     /**
@@ -123,9 +123,9 @@ using namespace AsteriskSCF::ServiceDiscovery;
 /**
  * Implementation of a constructor for the ServiceLocatorManagementImpl class.
  */
-ServiceLocatorManagementImpl::ServiceLocatorManagementImpl(const Ice::ObjectAdapterPtr& adapter, 
-   const EventsPrx& serviceDiscoveryTopic) :
-   mImpl(new ServiceLocatorManagementImplPriv(adapter, serviceDiscoveryTopic))
+ServiceLocatorManagementImpl::ServiceLocatorManagementImpl(const Ice::ObjectAdapterPtr& adapter,
+    const EventsPrx& serviceDiscoveryTopic) :
+    mImpl(new ServiceLocatorManagementImplPriv(adapter, serviceDiscoveryTopic))
 {
 }
 
@@ -151,13 +151,13 @@ Ice::ObjectPrx ServiceLocatorManagementImpl::locate(const ServiceLocatorParamsPt
  * Implementation of the locateAll method as defined in service_locator.ice
  */
 Ice::ObjectProxySeq ServiceLocatorManagementImpl::locateAll(
-   const ServiceLocatorParamsPtr& params)
+    const ServiceLocatorParamsPtr& params)
 {
     boost::shared_lock<boost::shared_mutex> lock(mImpl->mLock);
     Ice::ObjectProxySeq applicableServices;
 
-    for (vector<ServiceManagementImplPtr>::iterator service = mImpl->mServices.begin(); 
-      service != mImpl->mServices.end(); ++service)
+    for (vector<ServiceManagementImplPtr>::iterator service = mImpl->mServices.begin();
+         service != mImpl->mServices.end(); ++service)
     {
         if ((*service)->isSupported(params) == true)
         {
@@ -180,66 +180,66 @@ Ice::ObjectProxySeq ServiceLocatorManagementImpl::locateAll(
  */
 ServiceManagementPrx ServiceLocatorManagementImpl::addService(const Ice::ObjectPrx& service, const string& guid, const Ice::Current&)
 {
-   lg(Info) << "addService " << guid << '.';
-   boost::unique_lock<boost::shared_mutex> lock(mImpl->mLock);
-   ServiceManagementImplPtr new_service = new ServiceManagementImpl(this, service,
-      mImpl->mAdapter, mImpl->mLocatorTopic, guid);
+    lg(Info) << "addService " << guid << '.';
+    boost::unique_lock<boost::shared_mutex> lock(mImpl->mLock);
+    ServiceManagementImplPtr new_service = new ServiceManagementImpl(this, service,
+        mImpl->mAdapter, mImpl->mLocatorTopic, guid);
 
-   mImpl->mServices.push_back(new_service);
+    mImpl->mServices.push_back(new_service);
 
-   return new_service->getServiceManagementPrx();
+    return new_service->getServiceManagementPrx();
 }
 
 ServiceInfoSeq ServiceLocatorManagementImpl::getServices(const ::Ice::Current&) const
 {
-   boost::unique_lock<boost::shared_mutex> lock(mImpl->mLock);
-   ServiceInfoSeq r;
-   for (std::vector<ServiceManagementImplPtr>::const_iterator i = mImpl->mServices.begin();
-        i != mImpl->mServices.end();
-        ++i)
-   {
-       ServiceInfo v = {(*i)->getGuid(), (*i)->getServiceManagementPrx(), (*i)->getStatus(), (*i)->getService()};
-      r.push_back(v);
-   }
-   return r;
+    boost::unique_lock<boost::shared_mutex> lock(mImpl->mLock);
+    ServiceInfoSeq r;
+    for (std::vector<ServiceManagementImplPtr>::const_iterator i = mImpl->mServices.begin();
+         i != mImpl->mServices.end();
+         ++i)
+    {
+        ServiceInfo v = {(*i)->getGuid(), (*i)->getServiceManagementPrx(), (*i)->getStatus(), (*i)->getService()};
+        r.push_back(v);
+    }
+    return r;
 }
 
 ServiceInfo ServiceLocatorManagementImpl::getService(const std::string &guid, const ::Ice::Current&) const
 {
-   boost::unique_lock<boost::shared_mutex> lock(mImpl->mLock);
-   for (std::vector<ServiceManagementImplPtr>::const_iterator i = mImpl->mServices.begin();
-        i != mImpl->mServices.end();
-        ++i)
-   {
-      if (guid == (*i)->getGuid()) {
-         ServiceInfo r = {(*i)->getGuid(), (*i)->getServiceManagementPrx(), (*i)->getStatus(), (*i)->getService()};
-         return r;
-      }
-   }
-   throw ServiceNotFound();
+    boost::unique_lock<boost::shared_mutex> lock(mImpl->mLock);
+    for (std::vector<ServiceManagementImplPtr>::const_iterator i = mImpl->mServices.begin();
+         i != mImpl->mServices.end();
+         ++i)
+    {
+        if (guid == (*i)->getGuid()) {
+            ServiceInfo r = {(*i)->getGuid(), (*i)->getServiceManagementPrx(), (*i)->getStatus(), (*i)->getService()};
+            return r;
+        }
+    }
+    throw ServiceNotFound();
 }
 
 /**
  * Implementation of the addCompare method as defined in service_locator.ice
  */
 void ServiceLocatorManagementImpl::addCompare(const string& guid,
-   const ServiceLocatorParamsComparePrx& service, const Ice::Current&)
+    const ServiceLocatorParamsComparePrx& service, const Ice::Current&)
 {
-   boost::unique_lock<boost::shared_mutex> lock(mImpl->mLock);
-   ServiceLocatorComparator newComparator(service);
+    boost::unique_lock<boost::shared_mutex> lock(mImpl->mLock);
+    ServiceLocatorComparator newComparator(service);
 
-   pair<map<string, ServiceLocatorComparator>::iterator, bool> insertPair = mImpl->mCompares.insert(pair<string, ServiceLocatorComparator>(guid,
-      newComparator));
+    pair<map<string, ServiceLocatorComparator>::iterator, bool> insertPair = mImpl->mCompares.insert(pair<string, ServiceLocatorComparator>(guid,
+            newComparator));
 
-   if (insertPair.second == false)
-   {
-      throw DuplicateCompare();
-   }
+    if (insertPair.second == false)
+    {
+        throw DuplicateCompare();
+    }
 
-   if (mImpl->mLocatorTopic)
-   {
-      mImpl->mLocatorTopic->comparisonRegistered(guid);
-   }
+    if (mImpl->mLocatorTopic)
+    {
+        mImpl->mLocatorTopic->comparisonRegistered(guid);
+    }
 }
 
 /**
@@ -247,45 +247,45 @@ void ServiceLocatorManagementImpl::addCompare(const string& guid,
  */
 void ServiceLocatorManagementImpl::removeCompare(const string& guid, const Ice::Current&)
 {
-   boost::unique_lock<boost::shared_mutex> lock(mImpl->mLock);
-   int erased = mImpl->mCompares.erase(guid);
-
-   if (!erased)
-   {
-      throw CompareNotFound();
-   }
-   else if (mImpl->mLocatorTopic)
-   {
-      mImpl->mLocatorTopic->comparisonUnregistered(guid);
-   }
+    boost::unique_lock<boost::shared_mutex> lock(mImpl->mLock);
+    int erased = mImpl->mCompares.erase(guid);
+
+    if (!erased)
+    {
+        throw CompareNotFound();
+    }
+    else if (mImpl->mLocatorTopic)
+    {
+        mImpl->mLocatorTopic->comparisonUnregistered(guid);
+    }
 }
 
 /**
  * Implementation of the isSupported method as defined in service_locator.ice
  */
 bool ServiceLocatorManagementImpl::isSupported(const string& compareGuid,
-   const ServiceLocatorParamsPtr& params)
+    const ServiceLocatorParamsPtr& params)
 {
-   /* You'll note there is no lock here. This is because we already have a lock in the locate or locateAll
-    * functions.
-    */
-   map<string, ServiceLocatorComparator>::iterator comparator =
-      mImpl->mCompares.find(compareGuid);
-
-   if (comparator == mImpl->mCompares.end())
-   {
-      return false;
-   }
-
-   try
-   {
-      return (comparator->second).isSupported(params);
-   }
-   catch (...)
-   {
-      lg(Error) << "An exception was raised when attempting to contact comparator " << compareGuid << ".";
-      return false;
-   }
+    /* You'll note there is no lock here. This is because we already have a lock in the locate or locateAll
+     * functions.
+     */
+    map<string, ServiceLocatorComparator>::iterator comparator =
+        mImpl->mCompares.find(compareGuid);
+
+    if (comparator == mImpl->mCompares.end())
+    {
+        return false;
+    }
+
+    try
+    {
+        return (comparator->second).isSupported(params);
+    }
+    catch (...)
+    {
+        lg(Error) << "An exception was raised when attempting to contact comparator " << compareGuid << ".";
+        return false;
+    }
 }
 
 /**
@@ -293,16 +293,16 @@ bool ServiceLocatorManagementImpl::isSupported(const string& compareGuid,
  */
 void ServiceLocatorManagementImpl::removeService(const ServiceManagementImplPtr& service)
 {
-   lg(Info) << "removeService " << service->getGuid() << '.';
-   boost::unique_lock<boost::shared_mutex> lock(mImpl->mLock);
-   for (vector<ServiceManagementImplPtr>::iterator existingService =
-        mImpl->mServices.begin();
-        existingService != mImpl->mServices.end(); ++existingService)
-   {
-      if ((*existingService) == service)
-      {
-         mImpl->mServices.erase(existingService);
-         return;
-      }
-   }
+    lg(Info) << "removeService " << service->getGuid() << '.';
+    boost::unique_lock<boost::shared_mutex> lock(mImpl->mLock);
+    for (vector<ServiceManagementImplPtr>::iterator existingService =
+             mImpl->mServices.begin();
+         existingService != mImpl->mServices.end(); ++existingService)
+    {
+        if ((*existingService) == service)
+        {
+            mImpl->mServices.erase(existingService);
+            return;
+        }
+    }
 }
diff --git a/src/ServiceLocatorManagement.h b/src/ServiceLocatorManagement.h
index 8b118df..2e6a361 100644
--- a/src/ServiceLocatorManagement.h
+++ b/src/ServiceLocatorManagement.h
@@ -44,7 +44,7 @@ class ServiceLocatorManagementImpl : public AsteriskSCF::Core::Discovery::V1::Se
 {
 public:
     ServiceLocatorManagementImpl(const Ice::ObjectAdapterPtr& adapter,
-      const AsteriskSCF::System::Discovery::EventsPrx& serviceDiscoveryTopic);
+        const AsteriskSCF::System::Discovery::EventsPrx& serviceDiscoveryTopic);
     Ice::ObjectPrx locate(const AsteriskSCF::Core::Discovery::V1::ServiceLocatorParamsPtr&);
     Ice::ObjectProxySeq locateAll(const AsteriskSCF::Core::Discovery::V1::ServiceLocatorParamsPtr&);
 
diff --git a/src/ServiceManagement.cpp b/src/ServiceManagement.cpp
index af4c873..f8ae230 100644
--- a/src/ServiceManagement.cpp
+++ b/src/ServiceManagement.cpp
@@ -43,15 +43,15 @@ namespace ServiceDiscovery
 /**
  * Small internal class which is used to store information about supported parameters.
  */
-class ServiceLocatorParamsSpec 
+class ServiceLocatorParamsSpec
 {
 public:
-    ServiceLocatorParamsSpec(const AsteriskSCF::Core::Discovery::V1::ServiceLocatorParamsPtr& params, const std::string& compareGuid, 
-      ServiceLocatorManagementImpl* management) : 
-        mParams(params), 
-        mCompareGuid(compareGuid), 
-        mManagement(management) 
-    { 
+    ServiceLocatorParamsSpec(const AsteriskSCF::Core::Discovery::V1::ServiceLocatorParamsPtr& params, const std::string& compareGuid,
+        ServiceLocatorManagementImpl* management) :
+        mParams(params),
+        mCompareGuid(compareGuid),
+        mManagement(management)
+    {
     }
 
     bool isSupported(const AsteriskSCF::Core::Discovery::V1::ServiceLocatorParamsPtr&);
@@ -81,9 +81,9 @@ class ServiceManagementImplPriv
 {
 public:
     ServiceManagementImplPriv(ServiceManagementImpl* impl, ServiceLocatorManagementImpl* management,
-      const Ice::ObjectPrx& service, const Ice::ObjectAdapterPtr& adapter, const AsteriskSCF::System::Discovery::EventsPrx& serviceDiscoveryTopic,
-      const string& guid) :
-        mSuspended(false), mManagement(management), mService(service), mAdapter(adapter), 
+        const Ice::ObjectPrx& service, const Ice::ObjectAdapterPtr& adapter, const AsteriskSCF::System::Discovery::EventsPrx& serviceDiscoveryTopic,
+        const string& guid) :
+        mSuspended(false), mManagement(management), mService(service), mAdapter(adapter),
         mLocatorTopic(serviceDiscoveryTopic), mGuid(guid)
     {
         mManagementPrx = ServiceManagementPrx::uncheckedCast(mAdapter->addWithUUID(impl));
@@ -148,8 +148,8 @@ using namespace AsteriskSCF::System::Discovery;
  * Constructor for the ServiceManagementImpl class. This adds itself to the object adapter so the service can perform some management and
  * also sends out an event for those that are listening.
  */
-ServiceManagementImpl::ServiceManagementImpl(ServiceLocatorManagementImpl* management, 
-  const Ice::ObjectPrx& service, const Ice::ObjectAdapterPtr& adapter, const EventsPrx& serviceDiscoveryTopic, const string& guid) : 
+ServiceManagementImpl::ServiceManagementImpl(ServiceLocatorManagementImpl* management,
+    const Ice::ObjectPrx& service, const Ice::ObjectAdapterPtr& adapter, const EventsPrx& serviceDiscoveryTopic, const string& guid) :
     mImpl(new ServiceManagementImplPriv(this, management, service, adapter, serviceDiscoveryTopic, guid))
 {
 }
diff --git a/src/ServiceManagement.h b/src/ServiceManagement.h
index bf4fd5f..1f30b10 100644
--- a/src/ServiceManagement.h
+++ b/src/ServiceManagement.h
@@ -34,7 +34,7 @@ class ServiceManagementImpl : public AsteriskSCF::Core::Discovery::V1::ServiceMa
 {
 public:
     ServiceManagementImpl(ServiceLocatorManagementImpl*, const Ice::ObjectPrx&, const Ice::ObjectAdapterPtr&,
-      const AsteriskSCF::System::Discovery::EventsPrx&, const std::string&);
+        const AsteriskSCF::System::Discovery::EventsPrx&, const std::string&);
 
     //
     // AsteriskSCF::Core::Discovery::V1::ServiceManagement interface.
diff --git a/test/TestServiceLocator.cpp b/test/TestServiceLocator.cpp
index 4866df8..080a822 100644
--- a/test/TestServiceLocator.cpp
+++ b/test/TestServiceLocator.cpp
@@ -92,11 +92,11 @@ public:
     ServiceLocatorParamsComparePrx foundCompare;
 
     /* Common implementation for locating a service */
-    bool findService(const string& category) 
+    bool findService(const string& category)
     {
         bool found = true;
 
-        try 
+        try
         {
             /* Setup our parameters, for now we are simply using test as the category */
             ServiceLocatorParamsPtr params = new ServiceLocatorParams;
@@ -106,12 +106,12 @@ public:
             foundCompare = ServiceLocatorParamsComparePrx::uncheckedCast(discovery->locate(params));
 
             /* If we get here we didn't get an exception back telling us no service found... which is wrong! */
-        } 
-        catch (const ServiceNotFound&) 
+        }
+        catch (const ServiceNotFound&)
         {
             found = false;
-        } 
-        catch (const Ice::Exception &e) 
+        }
+        catch (const Ice::Exception &e)
         {
             BOOST_TEST_MESSAGE(e.ice_name());
             BOOST_TEST_MESSAGE(e.what());
@@ -122,33 +122,33 @@ public:
     }
 
     /* Common implementation for finding multiple services */
-    bool findServices(const string& category, unsigned int expectedNumOfResults) 
+    bool findServices(const string& category, unsigned int expectedNumOfResults)
     {
         bool found = true;
 
-        try 
+        try
         {
             ServiceLocatorParamsPtr params = new ServiceLocatorParams;
             params->category = category;
 
             Ice::ObjectProxySeq services = discovery->locateAll(params);
 
-            if (services.size() != expectedNumOfResults) 
+            if (services.size() != expectedNumOfResults)
             {
                 found = false;
             }
-        } 
-        catch (const ServiceNotFound&) 
+        }
+        catch (const ServiceNotFound&)
         {
             found = false;
-        } 
-        catch (const Ice::Exception &e) 
+        }
+        catch (const Ice::Exception &e)
         {
             BOOST_TEST_MESSAGE(e.ice_name());
             BOOST_TEST_MESSAGE(e.what());
             found = false;
-        } 
-        catch (...) 
+        }
+        catch (...)
         {
         }
 
@@ -189,14 +189,14 @@ struct GlobalIceFixture
 
             testbed.management = ServiceLocatorManagementPrx::checkedCast(testbed.communicatorOutgoing->stringToProxy("LocatorServiceManagement:tcp -p 4422"));
 
-            if (!testbed.management) 
+            if (!testbed.management)
             {
                 throw "Invalid service discovery management proxy";
             }
 
             testbed.discovery = ServiceLocatorPrx::checkedCast(testbed.communicatorOutgoing->stringToProxy("LocatorService:tcp -p 4411"));
 
-            if (!testbed.discovery) 
+            if (!testbed.discovery)
             {
                 throw "Invalid service discovery proxy";
             }
@@ -219,12 +219,12 @@ struct GlobalIceFixture
         BOOST_TEST_MESSAGE("Tearing down service discovery test fixture");
 
 
-        if (testbed.communicatorIncoming) 
+        if (testbed.communicatorIncoming)
         {
             testbed.communicatorIncoming->shutdown();
             testbed.communicatorIncoming = 0;
         }
-        if (testbed.communicatorOutgoing) 
+        if (testbed.communicatorOutgoing)
         {
             testbed.communicatorOutgoing->shutdown();
             testbed.communicatorOutgoing = 0;
@@ -267,17 +267,17 @@ BOOST_AUTO_TEST_CASE(AddService)
      * if the same service is registered multiple times there really isn't any way for this to fail, besides something
      * outside the control of the service locator itself or I suppose if it crashes.
      */
-    try 
+    try
     {
         testbed.compareManagement = testbed.management->addService(testbed.compare, "testcompare");
         added = true;
-    } 
-    catch (const Ice::Exception &e) 
+    }
+    catch (const Ice::Exception &e)
     {
         BOOST_TEST_MESSAGE(e.ice_name());
         BOOST_TEST_MESSAGE(e.what());
-    } 
-    catch (...) 
+    }
+    catch (...)
     {
     }
 
@@ -311,7 +311,7 @@ BOOST_AUTO_TEST_CASE(AddLocatorParamsWithoutCompareService)
 {
     bool added = false;
 
-    try 
+    try
     {
         ServiceLocatorParamsPtr params = new ServiceLocatorParams;
         params->category = "test";
@@ -319,13 +319,13 @@ BOOST_AUTO_TEST_CASE(AddLocatorParamsWithoutCompareService)
         testbed.compareManagement->addLocatorParams(params, "");
 
         added = true;
-    } 
-    catch (const Ice::Exception &e) 
+    }
+    catch (const Ice::Exception &e)
     {
         BOOST_TEST_MESSAGE(e.ice_name());
         BOOST_TEST_MESSAGE(e.what());
-    } 
-    catch (...) 
+    }
+    catch (...)
     {
     }
 
@@ -359,22 +359,22 @@ BOOST_AUTO_TEST_CASE(UseServiceFoundWithoutCompareService)
 {
     bool usable = false;
 
-    try 
+    try
     {
         ServiceLocatorParamsPtr params = new ServiceLocatorParams;
         params->category = "bob";
 
-        if ((testbed.foundCompare == testbed.compare) && (testbed.foundCompare->isSupported(params) == true)) 
+        if ((testbed.foundCompare == testbed.compare) && (testbed.foundCompare->isSupported(params) == true))
         {
             usable = true;
         }
-    } 
-    catch (const Ice::Exception &e) 
+    }
+    catch (const Ice::Exception &e)
     {
         BOOST_TEST_MESSAGE(e.ice_name());
         BOOST_TEST_MESSAGE(e.what());
-    } 
-    catch (...) 
+    }
+    catch (...)
     {
     }
 
@@ -388,21 +388,21 @@ BOOST_AUTO_TEST_CASE(AddCompare)
 {
     bool added = false;
 
-    try 
+    try
     {
         testbed.management->addCompare("testcompare", testbed.compare);
 
         added = true;
-    } 
-    catch (const DuplicateCompare&) 
+    }
+    catch (const DuplicateCompare&)
     {
-    } 
-    catch (const Ice::Exception &e) 
+    }
+    catch (const Ice::Exception &e)
     {
         BOOST_TEST_MESSAGE(e.ice_name());
         BOOST_TEST_MESSAGE(e.what());
-    } 
-    catch (...) 
+    }
+    catch (...)
     {
     }
 
@@ -416,21 +416,21 @@ BOOST_AUTO_TEST_CASE(AddDuplicateCompare)
 {
     bool added = false;
 
-    try 
+    try
     {
         testbed.management->addCompare("testcompare", testbed.compare);
 
         added = true;
-    } 
-    catch (const DuplicateCompare&) 
+    }
+    catch (const DuplicateCompare&)
     {
-    } 
-    catch (const Ice::Exception &e) 
+    }
+    catch (const Ice::Exception &e)
     {
         BOOST_TEST_MESSAGE(e.ice_name());
         BOOST_TEST_MESSAGE(e.what());
-    } 
-    catch (...) 
+    }
+    catch (...)
     {
     }
 
@@ -444,7 +444,7 @@ BOOST_AUTO_TEST_CASE(AddLocatorParamsWithCompareService)
 {
     bool added = false;
 
-    try 
+    try
     {
         ServiceLocatorParamsPtr params = new ServiceLocatorParams;
         params->category = "test2";
@@ -452,13 +452,13 @@ BOOST_AUTO_TEST_CASE(AddLocatorParamsWithCompareService)
         testbed.compareManagement->addLocatorParams(params, "testcompare");
 
         added = true;
-    } 
-    catch (const Ice::Exception &e) 
+    }
+    catch (const Ice::Exception &e)
     {
         BOOST_TEST_MESSAGE(e.ice_name());
         BOOST_TEST_MESSAGE(e.what());
-    } 
-    catch (...) 
+    }
+    catch (...)
     {
     }
 
@@ -482,22 +482,22 @@ BOOST_AUTO_TEST_CASE(UseServiceFoundWithCompareService)
 {
     bool usable = false;
 
-    try 
+    try
     {
         ServiceLocatorParamsPtr params = new ServiceLocatorParams;
         params->category = "bob";
 
-        if ((testbed.foundCompare == testbed.compare) && (testbed.foundCompare->isSupported(params) == true)) 
+        if ((testbed.foundCompare == testbed.compare) && (testbed.foundCompare->isSupported(params) == true))
         {
             usable = true;
         }
-    } 
-    catch (const Ice::Exception &e) 
+    }
+    catch (const Ice::Exception &e)
     {
         BOOST_TEST_MESSAGE(e.ice_name());
         BOOST_TEST_MESSAGE(e.what());
-    } 
-    catch (...) 
+    }
+    catch (...)
     {
     }
 
@@ -549,17 +549,17 @@ BOOST_AUTO_TEST_CASE(ServiceSuspend)
 {
     bool suspended = false;
 
-    try 
+    try
     {
         testbed.compareManagement->suspend();
         suspended = true;
-    } 
-    catch (const Ice::Exception &e) 
+    }
+    catch (const Ice::Exception &e)
     {
         BOOST_TEST_MESSAGE(e.ice_name());
         BOOST_TEST_MESSAGE(e.what());
-    } 
-    catch (...) 
+    }
+    catch (...)
     {
     }
 
@@ -583,17 +583,17 @@ BOOST_AUTO_TEST_CASE(ServiceUnsuspend)
 {
     bool unsuspended = false;
 
-    try 
+    try
     {
         testbed.compareManagement->unsuspend();
         unsuspended = true;
-    } 
-    catch (const Ice::Exception &e) 
+    }
+    catch (const Ice::Exception &e)
     {
         BOOST_TEST_MESSAGE(e.ice_name());
         BOOST_TEST_MESSAGE(e.what());
-    } 
-    catch (...) 
+    }
+    catch (...)
     {
     }
 
@@ -617,20 +617,20 @@ BOOST_AUTO_TEST_CASE(RemoveNonexistentCompareService)
 {
     bool removed = false;
 
-    try 
+    try
     {
         testbed.management->removeCompare("testcompare2");
         removed = true;
-    } 
-    catch (const CompareNotFound&) 
+    }
+    catch (const CompareNotFound&)
     {
-    } 
-    catch (const Ice::Exception &e) 
+    }
+    catch (const Ice::Exception &e)
     {
         BOOST_TEST_MESSAGE(e.ice_name());
         BOOST_TEST_MESSAGE(e.what());
-    } 
-    catch (...) 
+    }
+    catch (...)
     {
     }
 
@@ -644,20 +644,20 @@ BOOST_AUTO_TEST_CASE(RemoveCompareService)
 {
     bool removed = false;
 
-    try 
+    try
     {
         testbed.management->removeCompare("testcompare");
         removed = true;
-    } 
-    catch (const CompareNotFound&) 
+    }
+    catch (const CompareNotFound&)
     {
-    } 
-    catch (const Ice::Exception &e) 
+    }
+    catch (const Ice::Exception &e)
     {
         BOOST_TEST_MESSAGE(e.ice_name());
         BOOST_TEST_MESSAGE(e.what());
-    } 
-    catch (...) 
+    }
+    catch (...)
     {
     }
 
@@ -671,20 +671,20 @@ BOOST_AUTO_TEST_CASE(RemoveAlreadyRemovedCompareService)
 {
     bool removed = false;
 
-    try 
+    try
     {
         testbed.management->removeCompare("testcompare");
         removed = true;
-    } 
-    catch (const CompareNotFound&) 
+    }
+    catch (const CompareNotFound&)
     {
-    } 
-    catch (const Ice::Exception &e) 
+    }
+    catch (const Ice::Exception &e)
     {
         BOOST_TEST_MESSAGE(e.ice_name());
         BOOST_TEST_MESSAGE(e.what());
-    } 
-    catch (...) 
+    }
+    catch (...)
     {
     }
 
@@ -708,17 +708,17 @@ BOOST_AUTO_TEST_CASE(ServiceUnregister)
 {
     bool unregistered = false;
 
-    try 
+    try
     {
         testbed.compareManagement->unregister();
         unregistered = true;
-    } 
-    catch (const Ice::Exception &e) 
+    }
+    catch (const Ice::Exception &e)
     {
         BOOST_TEST_MESSAGE(e.ice_name());
         BOOST_TEST_MESSAGE(e.what());
-    } 
-    catch (...) 
+    }
+    catch (...)
     {
     }
 
@@ -736,23 +736,23 @@ BOOST_AUTO_TEST_CASE(FindServiceAfterUnregister)
 }
 
 void ServiceLocatorTest::start(std::string const &name,
-                               Ice::CommunicatorPtr const &communicator,
-                               Ice::StringSeq const &args)
-{
-   std::vector<char const *> argv;
-   argv.push_back(name.c_str());
-   for (Ice::StringSeq::const_iterator i = args.begin(); i != args.end(); ++i)
-   {
-      argv.push_back(i->c_str());
-   }
-   // null terminated list
-   argv.push_back(0);
-
-   mCachedArgs.argc = argv.size() - 1;
-   mCachedArgs.argv = (char**)&argv[0];
-
-   int r = ::boost::unit_test::unit_test_main(&init_unit_test, mCachedArgs.argc, mCachedArgs.argv);
-   exit(r);
+    Ice::CommunicatorPtr const &communicator,
+    Ice::StringSeq const &args)
+{
+    std::vector<char const *> argv;
+    argv.push_back(name.c_str());
+    for (Ice::StringSeq::const_iterator i = args.begin(); i != args.end(); ++i)
+    {
+        argv.push_back(i->c_str());
+    }
+    // null terminated list
+    argv.push_back(0);
+
+    mCachedArgs.argc = argv.size() - 1;
+    mCachedArgs.argv = (char**)&argv[0];
+
+    int r = ::boost::unit_test::unit_test_main(&init_unit_test, mCachedArgs.argc, mCachedArgs.argv);
+    exit(r);
 }
 
 void ServiceLocatorTest::stop()
@@ -761,8 +761,8 @@ void ServiceLocatorTest::stop()
 
 extern "C"
 {
-   IceBox::Service* create(Ice::CommunicatorPtr communicator)
-   {
-      return new ServiceLocatorTest;
-   }
+IceBox::Service* create(Ice::CommunicatorPtr communicator)
+{
+    return new ServiceLocatorTest;
+}
 }

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


-- 
asterisk-scf/integration/servicediscovery.git



More information about the asterisk-scf-commits mailing list