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

Commits to the Asterisk SCF project code repositories asterisk-scf-commits at lists.digium.com
Wed Feb 8 18:26:46 CST 2012


branch "master" has been updated
       via  22e66682ea772f2871bf519a45b4585d45a66d06 (commit)
      from  260f2778ce9edc2f2bb046daf45720b9996028e4 (commit)

Summary of changes:
 test/TestServiceLocator.cpp |   45 ++++++++++++++----------------------------
 1 files changed, 15 insertions(+), 30 deletions(-)


- Log -----------------------------------------------------------------
commit 22e66682ea772f2871bf519a45b4585d45a66d06
Author: Ken Hunt <ken.hunt at digium.com>
Date:   Wed Feb 8 18:26:06 2012 -0600

    Cleanup unit test exception handling. Let the test framework handle exceptions.

diff --git a/test/TestServiceLocator.cpp b/test/TestServiceLocator.cpp
index ebdae5d..6c698d0 100644
--- a/test/TestServiceLocator.cpp
+++ b/test/TestServiceLocator.cpp
@@ -171,46 +171,32 @@ struct GlobalIceFixture
         ::boost::debug::detect_memory_leaks(false);
         ::boost::unit_test::unit_test_log.set_stream( std::cout );
 
-        int status = 0;
-        try
-        {
-            testbed.communicatorIncoming = Ice::initialize(mCachedArgs.argc, mCachedArgs.argv);
-
-            testbed.adapter = testbed.communicatorIncoming->createObjectAdapterWithEndpoints("CompareServiceAdapter", "default -h 127.0.0.1");
+        testbed.communicatorIncoming = Ice::initialize(mCachedArgs.argc, mCachedArgs.argv);
 
-            ServiceLocatorParamsComparePtr CompareService = new TestCompareServiceImpl();
+        testbed.adapter = testbed.communicatorIncoming->createObjectAdapterWithEndpoints("CompareServiceAdapter", "default -h 127.0.0.1");
 
-            testbed.compare = ServiceLocatorParamsComparePrx::uncheckedCast(testbed.adapter->addWithUUID(CompareService));
+        ServiceLocatorParamsComparePtr CompareService = new TestCompareServiceImpl();
 
-            testbed.adapter->activate();
+        testbed.compare = ServiceLocatorParamsComparePrx::uncheckedCast(testbed.adapter->addWithUUID(CompareService));
 
-            testbed.communicatorOutgoing = Ice::initialize(mCachedArgs.argc, mCachedArgs.argv);
+        testbed.adapter->activate();
 
-            // TODO: This should use a configuration file most likely instead of hardcoding
+        testbed.communicatorOutgoing = Ice::initialize(mCachedArgs.argc, mCachedArgs.argv);
 
-            testbed.management = ServiceLocatorManagementPrx::checkedCast(testbed.communicatorOutgoing->stringToProxy("LocatorServiceManagement:tcp -h 127.0.0.1 -p 4412"));
-
-            if (!testbed.management)
-            {
-                throw "Invalid service discovery management proxy";
-            }
+        // TODO: This should use a configuration file most likely instead of hardcoding
 
-            testbed.discovery = ServiceLocatorPrx::checkedCast(testbed.communicatorOutgoing->stringToProxy("LocatorService:tcp -h 127.0.0.1 -p 4411"));
+        testbed.management = ServiceLocatorManagementPrx::checkedCast(testbed.communicatorOutgoing->stringToProxy("LocatorServiceManagement:tcp -h 127.0.0.1 -p 4412"));
 
-            if (!testbed.discovery)
-            {
-                throw "Invalid service discovery proxy";
-            }
-        }
-        catch (const Ice::Exception& ex)
+        if (!testbed.management)
         {
-            cerr << ex << endl;
-            status = 1;
+            throw "Invalid service discovery management proxy";
         }
-        catch (const char* msg)
+
+        testbed.discovery = ServiceLocatorPrx::checkedCast(testbed.communicatorOutgoing->stringToProxy("LocatorService:tcp -h 127.0.0.1 -p 4411"));
+
+        if (!testbed.discovery)
         {
-            cerr << msg << endl;
-            status = 1;
+            throw "Invalid service discovery proxy";
         }
         
     } // end Fixture() constructor
@@ -219,7 +205,6 @@ struct GlobalIceFixture
     {
         BOOST_TEST_MESSAGE("Tearing down service discovery test fixture");
 
-
         if (testbed.communicatorIncoming)
         {
             testbed.communicatorIncoming->shutdown();

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


-- 
asterisk-scf/release/servicediscovery.git



More information about the asterisk-scf-commits mailing list