[asterisk-scf-commits] asterisk-scf/integration/ice-util-cpp.git branch "move-bridge-util-functions" updated.

Commits to the Asterisk SCF project code repositories asterisk-scf-commits at lists.digium.com
Thu Apr 28 06:41:25 CDT 2011


branch "move-bridge-util-functions" has been updated
       via  f066b5e5e7deb9305cdcb097a76e0c6c32ba6261 (commit)
       via  badca75ce57a4a51aeb22d144d37255c5ec8c48e (commit)
       via  cb47749cc94cc225bee5367fa8ff1fc883c2b471 (commit)
       via  552eeafb0fc2bc21dc770db5a2c43be2fab42090 (commit)
       via  b9f0fd36a6be3f8ef05b25df09ea7eac3f67df2d (commit)
       via  850c9b33e481d6d879f8f26dc99971336bea3aa0 (commit)
       via  0e34466aa0f98246798941010b0d38b7648057d2 (commit)
       via  d3f0c6cb6d104404c47a498e279f35dd56e0d9c2 (commit)
      from  525cfa3d0fe82d96b735223a365519e0591156ba (commit)

Summary of changes:
 AmiCollector/CMakeLists.txt                        |   17 -----
 CMakeLists.txt                                     |    5 +-
 SmartProxy/CMakeLists.txt                          |   32 ---------
 TestFixture/CMakeLists.txt                         |   16 -----
 TestFixture/src/TestFixture.cpp                    |   19 -----
 ...t_ice_cpp_utility.conf => IceUtilCppTests.conf} |    2 +-
 .../AsteriskSCF/AmiCollector}/AmiCollector.h       |    5 +-
 .../AsteriskSCF/AmiCollector}/ResponseCollector.h  |    0
 include/AsteriskSCF/Helpers/PropertyHelper.h       |    3 +-
 include/AsteriskSCF/Helpers/ProxyHelper.h          |   70 +++++++-------------
 include/AsteriskSCF/Listener/ListenerManager.h     |    2 +-
 .../AsteriskSCF/SmartProxy}/SmartProxy.h           |   12 ++-
 .../AsteriskSCF/StateReplicator}/StateReplicator.h |    0
 .../AsteriskSCF/Testing}/IceBoxBoostTest.h         |    0
 include/AsteriskSCF/{IceUtility.h => Utilities.h}  |   11 +++-
 src/CMakeLists.txt                                 |   49 ++++++++++++++
 .../src/SmartProxy.cpp => src/IceUtilCpp.cpp       |   18 ++----
 .../test => test/AmiCollector}/CMakeLists.txt      |    0
 .../AmiCollector}/IceIntegration-test.cpp          |    4 +-
 .../AmiCollector}/ResponseCollector-test.cpp       |    2 +-
 .../test => test/AmiCollector}/TestAmiCollector.h  |    7 +--
 {AmiCollector/test => test/AmiCollector}/test.cpp  |    0
 test/CMakeLists.txt                                |   29 +++++----
 .../LocatorRegistrationTest.cpp                    |    2 -
 test/PropertyHelper/main.cpp                       |   18 -----
 test/ProxyHelper/ProxyHelperTests.cpp              |   14 ++--
 .../test => test/StateReplicator}/CMakeLists.txt   |    2 +-
 .../StateReplicator}/MockStateReplicatorListener.h |    0
 .../test => test/StateReplicator}/SharedTestData.h |    0
 .../StateReplicator}/TestStateReplicator.cpp       |    2 +-
 .../slice}/StateReplicatorTestIf.ice               |    0
 test/UtilityTests.cpp                              |   12 ++--
 32 files changed, 137 insertions(+), 216 deletions(-)
 delete mode 100644 AmiCollector/CMakeLists.txt
 delete mode 100644 SmartProxy/CMakeLists.txt
 delete mode 100644 TestFixture/CMakeLists.txt
 delete mode 100644 TestFixture/src/TestFixture.cpp
 rename config/{test_ice_cpp_utility.conf => IceUtilCppTests.conf} (91%)
 rename {AmiCollector/include/AsteriskSCF => include/AsteriskSCF/AmiCollector}/AmiCollector.h (98%)
 rename {AmiCollector/include/AsteriskSCF => include/AsteriskSCF/AmiCollector}/ResponseCollector.h (100%)
 rename {SmartProxy/include/AsteriskSCF => include/AsteriskSCF/SmartProxy}/SmartProxy.h (95%)
 rename {StateReplicator/include/AsteriskSCF => include/AsteriskSCF/StateReplicator}/StateReplicator.h (100%)
 rename {TestFixture/include/AsteriskSCF => include/AsteriskSCF/Testing}/IceBoxBoostTest.h (100%)
 rename include/AsteriskSCF/{IceUtility.h => Utilities.h} (63%)
 create mode 100644 src/CMakeLists.txt
 rename SmartProxy/src/SmartProxy.cpp => src/IceUtilCpp.cpp (77%)
 rename {AmiCollector/test => test/AmiCollector}/CMakeLists.txt (100%)
 rename {AmiCollector/test => test/AmiCollector}/IceIntegration-test.cpp (97%)
 rename {AmiCollector/test => test/AmiCollector}/ResponseCollector-test.cpp (98%)
 rename {AmiCollector/test => test/AmiCollector}/TestAmiCollector.h (92%)
 rename {AmiCollector/test => test/AmiCollector}/test.cpp (100%)
 delete mode 100644 test/PropertyHelper/main.cpp
 rename {StateReplicator/test => test/StateReplicator}/CMakeLists.txt (85%)
 rename {StateReplicator/test => test/StateReplicator}/MockStateReplicatorListener.h (100%)
 rename {StateReplicator/test => test/StateReplicator}/SharedTestData.h (100%)
 rename {StateReplicator/test => test/StateReplicator}/TestStateReplicator.cpp (99%)
 rename {StateReplicator/testslice => test/StateReplicator/slice}/StateReplicatorTestIf.ice (100%)


- Log -----------------------------------------------------------------
commit f066b5e5e7deb9305cdcb097a76e0c6c32ba6261
Author: Brent Eagles <beagles at digium.com>
Date:   Thu Apr 28 00:20:06 2011 -0230

    * Fix template compilation errors.
    * Simplify getProxy
    * Remove IceUtil namespace from AmiCollector et al. Under some conditions,
      this causes issues as it can conflict with the actual IceUtil namespace.

diff --git a/include/AsteriskSCF/AmiCollector/AmiCollector.h b/include/AsteriskSCF/AmiCollector/AmiCollector.h
index db22be3..5cab70a 100644
--- a/include/AsteriskSCF/AmiCollector/AmiCollector.h
+++ b/include/AsteriskSCF/AmiCollector/AmiCollector.h
@@ -26,8 +26,6 @@
 
 namespace AsteriskSCF
 {
-namespace IceUtil
-{
 
 /**
  * Collects the results for multiple asynchronous responses.  While the response
@@ -122,5 +120,4 @@ private:
     }
 };
 
-} // IceUtil
 } // AsteriskSCF
diff --git a/include/AsteriskSCF/Helpers/PropertyHelper.h b/include/AsteriskSCF/Helpers/PropertyHelper.h
index 6a84e74..032602f 100644
--- a/include/AsteriskSCF/Helpers/PropertyHelper.h
+++ b/include/AsteriskSCF/Helpers/PropertyHelper.h
@@ -162,7 +162,8 @@ private:
     template <typename T>
     void copyV(const T& src, std::vector<std::string>& dest)
     {
-        for(T::const_iterator i = src.begin(); i != src.end(); ++i)
+        typedef typename T::const_iterator iter;
+        for(iter i = src.begin(); i != src.end(); ++i)
         {
             dest.push_back(convertToString(*i));
         }
diff --git a/include/AsteriskSCF/Helpers/ProxyHelper.h b/include/AsteriskSCF/Helpers/ProxyHelper.h
index 9b98032..fdca98f 100644
--- a/include/AsteriskSCF/Helpers/ProxyHelper.h
+++ b/include/AsteriskSCF/Helpers/ProxyHelper.h
@@ -29,45 +29,6 @@ namespace AsteriskSCF
 {
 /**
  *
- * Policy-enabled getProxy(): A "shorthand" mechanism for getting proxies from configuration files.  The getProxy()
- * function encapsulates the code required to retrieve a proxy from Ice Properties in one step. The Policy classes allow
- * the caller to control whether a checked or unchecked cast is performed to downcast the proxy object (remember: a
- * checked cast results in a remote procedure call in this case, the unchecked cast does not).
- *
- * Note: as function templates don't allow default template parameters, this isn't as pretty as it could be. You have
- * to specify both the type of the proxy and the casting policy either through a template type argument or through
- * a parameter.
- *
- **/
-
-/**
- * Policy for performing checked casts.
- */
-template <typename T>
-class Checked
-{
-public:
-    T cast(const Ice::ObjectPrx& proxy) const
-    {
-        return T::checkedCast(proxy);
-    }
-};
-
-/**
- * Policy for performing unchecked casts.
- */
-template <typename T>
-class Unchecked
-{
-public:
-    T cast(const Ice::ObjectPrx& proxy) const
-    {
-        return T::uncheckedCast(proxy);
-    }
-};
-
-/**
- *
  * The getProxy call. NOTE: this function does not perform and release mode parameter checking (asserts for debug mode
  * only), so the caller should do precondition validation if it at all possible for these arguments to be invalid.
  * 
@@ -75,21 +36,34 @@ public:
  * @param comm An Ice communicator instance.
  * @param property The name of the property that contains the stringified proxy.
  * @param typedParam A proxy handle of the required type.
- * @param policy A policy object instance.
  *
  * @returns An initialized proxy handle of the required type.
  *
  **/
-template <class T, template<class T> class P>
-T getProxy(const Ice::CommunicatorPtr& comm, const std::string& property, T& typedParam = T(),
-        const P<T>& policy = P<T>())
+
+template <class T>
+T getProxy(const Ice::CommunicatorPtr& comm, const std::string& propertyName, T& typedParam, bool checked)
 {
     assert(comm);
-    assert(!property.empty());
-    typedParam = policy.cast(comm->propertyToProxy(property));
+    assert(!propertyName.empty());
+    Ice::ObjectPrx obj = comm->propertyToProxy(propertyName);
+    if (checked)
+    {
+        typedParam = T::checkedCast(obj);
+    }
+    else
+    {
+        typedParam =  T::uncheckedCast(obj);
+    }
     return typedParam;
 }
 
+template <class T>
+T getProxy(const Ice::CommunicatorPtr& comm, const std::string& propertyName, T& typedParam)
+{
+    return getProxy<T>(comm, propertyName, typedParam, true);
+}
+
 /**
  *
  * The addServant helper is a little like the getProxy helper. However, instead of pulling a proxy out
@@ -98,7 +72,8 @@ T getProxy(const Ice::CommunicatorPtr& comm, const std::string& property, T& typ
  *
  **/
 template <class T>
-T addServant(const Ice::ObjectAdapterPtr& adapter, const Ice::ObjectPtr& servant, const Ice::Identity& t, T& proxy = T())
+T addServant(const Ice::ObjectAdapterPtr& adapter, const Ice::ObjectPtr& servant, const Ice::Identity& t, 
+  T& proxy)
 {
     proxy = T::uncheckedCast(adapter->add(servant, t));
     return proxy;
@@ -108,7 +83,8 @@ T addServant(const Ice::ObjectAdapterPtr& adapter, const Ice::ObjectPtr& servant
  * Overload for those folks that specify a string for an id.
  **/
 template <class T>
-T addServant(const Ice::ObjectAdapterPtr& adapter, const Ice::ObjectPtr& servant, const std::string& s, T& proxy = T())
+T addServant(const Ice::ObjectAdapterPtr& adapter, const Ice::ObjectPtr& servant, const std::string& s, 
+  T& proxy)
 {
     return addServant(adapter, servant, adapter->getCommunicator()->stringToIdentity(s), proxy);
 }
diff --git a/include/AsteriskSCF/Listener/ListenerManager.h b/include/AsteriskSCF/Listener/ListenerManager.h
index a7f1f9d..30eaa78 100644
--- a/include/AsteriskSCF/Listener/ListenerManager.h
+++ b/include/AsteriskSCF/Listener/ListenerManager.h
@@ -176,7 +176,7 @@ public:
                 }
             }
         }
-        if (proxyToUnsubscibe)
+        if (proxyToUnsubscribe)
         {
             mTopic->unsubscribe(proxyToUnsubscribe);
             return true;
diff --git a/test/AmiCollector/IceIntegration-test.cpp b/test/AmiCollector/IceIntegration-test.cpp
index c66efa8..43bfcee 100644
--- a/test/AmiCollector/IceIntegration-test.cpp
+++ b/test/AmiCollector/IceIntegration-test.cpp
@@ -22,7 +22,7 @@
 
 #include "TestAmiCollector.h"
 
-using namespace AsteriskSCF::IceUtil;
+using namespace AsteriskSCF;
 
 namespace
 {
diff --git a/test/AmiCollector/TestAmiCollector.h b/test/AmiCollector/TestAmiCollector.h
index fe0047c..e8bfd91 100644
--- a/test/AmiCollector/TestAmiCollector.h
+++ b/test/AmiCollector/TestAmiCollector.h
@@ -21,13 +21,11 @@
 
 namespace AsteriskSCF
 {
-namespace IceUtil
-{
 
 /**
  * Simple AMI collector for testing
  */
-class TestAmiCollector : public AsteriskSCF::IceUtil::AmiCollector<
+class TestAmiCollector : public AsteriskSCF::AmiCollector<
     bool,
     Ice::ObjectPrx,
     &Ice::ObjectPrx::element_type::end_ice_isA>
@@ -81,5 +79,4 @@ private:
 
 typedef ::IceUtil::Handle<TestAmiCollector> TestAmiCollectorPtr;
 
-} // IceUtil
 } // AsteriskSCF
diff --git a/test/LocatorRegistration/LocatorRegistrationTest.cpp b/test/LocatorRegistration/LocatorRegistrationTest.cpp
index 56c264e..9d84cc6 100644
--- a/test/LocatorRegistration/LocatorRegistrationTest.cpp
+++ b/test/LocatorRegistration/LocatorRegistrationTest.cpp
@@ -13,8 +13,6 @@
  * the GNU General Public License Version 2. See the LICENSE.txt file
  * at the top of the source tree.
  */
-#pragma once
-
 #include <Ice/Ice.h>
 #include <IceBox/IceBox.h>
 #include <IceUtil/Thread.h>
diff --git a/test/ProxyHelper/ProxyHelperTests.cpp b/test/ProxyHelper/ProxyHelperTests.cpp
index 3180a64..ac0000b 100644
--- a/test/ProxyHelper/ProxyHelperTests.cpp
+++ b/test/ProxyHelper/ProxyHelperTests.cpp
@@ -68,10 +68,10 @@ public:
         Ice::ObjectAdapterPtr adapter = mCommunicator->createObjectAdapter("TestAdapter");
 
         SimpleTestIntfPtr testObj(new SimpleTestObjImpl);
-        SimpleTestIntfPrx o =
-            addServant<SimpleTestIntfPrx>(adapter, testObj, mCommunicator->stringToIdentity("simpleObj"));
-        SimpleTestIntfPrx secondObj =
-            addServant<SimpleTestIntfPrx>(adapter, testObj, "anotherSimplObj");
+        SimpleTestIntfPrx o;
+        addServant(adapter, testObj, mCommunicator->stringToIdentity("simpleObj"), o);
+        SimpleTestIntfPrx secondObj;
+        addServant(adapter, testObj, "anotherSimplObj", secondObj);
         adapter->activate();
         try
         {
@@ -92,10 +92,10 @@ public:
             BOOST_CHECK(false);
         }
         
-        o = getProxy<SimpleTestIntfPrx, Checked>(mCommunicator, "TestObj.Proxy");
+        getProxy(mCommunicator, "TestObj.Proxy", o);
         BOOST_CHECK(o);
         o = 0;
-        o =  getProxy<SimpleTestIntfPrx, Unchecked>(mCommunicator, "TestObj.Proxy");
+        getProxy(mCommunicator, "TestObj.Proxy", o, false);
         try
         {
             o->hiThere();
@@ -116,7 +116,7 @@ public:
         }
         IdentityComparePredicate<SimpleTestIntfPrx> pred(o);
         BOOST_CHECK(!pred(secondObj));
-        BOOST_CHECK(pred(getProxy<SimpleTestIntfPrx, Checked>(mCommunicator, "TestObj.Proxy")));
+        BOOST_CHECK(pred(getProxy(mCommunicator, "TestObj.Proxy", secondObj, false)));
         Ice::ObjectPrx bareObj = mCommunicator->propertyToProxy("TestObj.Proxy");
         BOOST_CHECK(pred(bareObj));
     }
diff --git a/test/UtilityTests.cpp b/test/UtilityTests.cpp
index ee954c3..1ce10c8 100644
--- a/test/UtilityTests.cpp
+++ b/test/UtilityTests.cpp
@@ -47,9 +47,9 @@ namespace UtilityTests
 class TestRunner : public IceUtil::Thread
 {
 public:
-    TestRunner(const Ice::CommunicatorPtr& c, const Ice::StringSeq& args, const std::string& name):
+    TestRunner(const Ice::CommunicatorPtr& c, const Ice::StringSeq& args, const std::string& testName):
         mCommunicator(c),
-        mName(name)
+        mName(testName)
     {
         std::vector<std::string> t(args);
         t.insert(t.begin(), "ProxyHelperTests");
@@ -65,10 +65,10 @@ public:
         ProxyHelperTests::ProxyHelperTestSuite proxyHelperTests(mCommunicator);
         LocatorRegistrationTests::LocatorRegistrationTestSuite locatorWrapperTest(mCommunicator);
         
-        int result = ::boost::unit_test::unit_test_main(&init, argc, argv);
+        ::boost::unit_test::unit_test_main(&init, argc, argv);
 
-        IceBox::ServiceManagerPrx mgr =
-            getProxy<IceBox::ServiceManagerPrx, Checked>(mCommunicator, "IceBoxManager.Proxy");
+        IceBox::ServiceManagerPrx mgr; 
+        getProxy(mCommunicator, "IceBoxManager.Proxy", mgr);
         if (mgr)
         {
             try
@@ -127,7 +127,7 @@ public:
 
 extern "C"
 {
-ASTERISK_SCF_ICEBOX_EXPORT IceBox::Service* create(Ice::CommunicatorPtr communicator)
+ASTERISK_SCF_ICEBOX_EXPORT IceBox::Service* create(Ice::CommunicatorPtr)
 {
     return new AsteriskSCF::UtilityTests::TestService;
 }

commit badca75ce57a4a51aeb22d144d37255c5ec8c48e
Author: Brent Eagles <beagles at digium.com>
Date:   Wed Apr 27 23:19:53 2011 -0230

    Add missing file.

diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
new file mode 100644
index 0000000..94bcd73
--- /dev/null
+++ b/src/CMakeLists.txt
@@ -0,0 +1,49 @@
+#
+# Asterisk Scalable Communications Framework
+#
+# Copyright (C) 2010 -- Digium, Inc.
+#
+# All rights reserved.
+#
+
+# Ice Utilities for C++
+
+asterisk_scf_component_init(IceUtilCpp CXX)
+
+include_directories(../include)
+asterisk_scf_slice_include_directories(${API_SLICE_DIR})
+
+asterisk_scf_component_add_file(IceUtilCpp ../include/AsteriskSCF/SmartProxy/SmartProxy.h)
+asterisk_scf_component_add_file(IceUtilCpp ../include/AsteriskSCF/AmiCollector/AmiCollector.h)
+asterisk_scf_component_add_file(IceUtilCpp ../include/AsteriskSCF/AmiCollector/ResponseCollector.h)
+asterisk_scf_component_add_file(IceUtilCpp ../include/AsteriskSCF/Helpers/PropertyHelper.h)
+asterisk_scf_component_add_file(IceUtilCpp ../include/AsteriskSCF/Helpers/ProxyHelper.h)
+asterisk_scf_component_add_file(IceUtilCpp ../include/AsteriskSCF/Helpers/Retry.h)
+asterisk_scf_component_add_file(IceUtilCpp ../include/AsteriskSCF/Listener/ListenerManager.h)
+asterisk_scf_component_add_file(IceUtilCpp ../include/AsteriskSCF/LocatorRegistration/LocatorRegistrationWrapper.h)
+asterisk_scf_component_add_file(IceUtilCpp ../include/AsteriskSCF/StateReplicator/StateReplicator.h)
+asterisk_scf_component_add_file(IceUtilCpp ../include/AsteriskSCF/Utilities.h)
+#
+# Note, strictly speaking this isn't for component development, but as it is part of this
+# library it sort of belongs here.
+#
+asterisk_scf_component_add_file(IceUtilCpp ../include/AsteriskSCF/Testing/IceBoxBoostTest.h)
+
+asterisk_scf_component_add_file(IceUtilCpp IceUtilCpp.cpp)
+asterisk_scf_component_add_boost_libraries(IceUtilCpp core)
+
+if(NOT logger_dir)
+   message(FATAL_ERROR "The logger directory could not be found ${logger_dir}")
+endif()
+include_directories(${logger_dir}/include)
+include_directories(${API_INCLUDE_DIR})
+
+asterisk_scf_component_build_library(IceUtilCpp)
+
+include_directories(${API_INCLUDE_DIR})
+target_link_libraries(IceUtilCpp logging-client)
+target_link_libraries(IceUtilCpp asterisk-scf-api)
+
+# don't install the component.  it's just there to make Visual Studio happy
+# _do_ install the header files
+asterisk_scf_headers_install(include/)

commit cb47749cc94cc225bee5367fa8ff1fc883c2b471
Author: Brent Eagles <beagles at digium.com>
Date:   Wed Apr 27 23:16:19 2011 -0230

    Enabling include.

diff --git a/include/AsteriskSCF/Utilities.h b/include/AsteriskSCF/Utilities.h
index ac10dee..f06d8dc 100644
--- a/include/AsteriskSCF/Utilities.h
+++ b/include/AsteriskSCF/Utilities.h
@@ -21,7 +21,7 @@
 #include <AsteriskSCF/Listener/ListenerManager.h>
 #include <AsteriskSCF/AmiCollector/AmiCollector.h>
 #include <AsteriskSCF/AmiCollector/ResponseCollector.h>
-// #include <AsteriskSCF/SmartProxy/SmartProxy.h>
+#include <AsteriskSCF/SmartProxy/SmartProxy.h>
 #include <AsteriskSCF/StateReplicator/StateReplicator.h>
 
 //

commit 552eeafb0fc2bc21dc770db5a2c43be2fab42090
Author: Brent Eagles <beagles at digium.com>
Date:   Wed Apr 27 17:15:40 2011 -0230

    Update includes to match changed layout.

diff --git a/test/AmiCollector/IceIntegration-test.cpp b/test/AmiCollector/IceIntegration-test.cpp
index 3a2626a..c66efa8 100644
--- a/test/AmiCollector/IceIntegration-test.cpp
+++ b/test/AmiCollector/IceIntegration-test.cpp
@@ -18,7 +18,7 @@
 #include <Ice/Proxy.h>
 #include <boost/test/unit_test.hpp>
 
-#include <AsteriskSCF/AmiCollector.h>
+#include <AsteriskSCF/AmiCollector/AmiCollector.h>
 
 #include "TestAmiCollector.h"
 
diff --git a/test/AmiCollector/ResponseCollector-test.cpp b/test/AmiCollector/ResponseCollector-test.cpp
index af94552..8b2950c 100644
--- a/test/AmiCollector/ResponseCollector-test.cpp
+++ b/test/AmiCollector/ResponseCollector-test.cpp
@@ -16,7 +16,7 @@
 
 #include <boost/test/unit_test.hpp>
 
-#include <AsteriskSCF/ResponseCollector.h>
+#include <AsteriskSCF/AmiCollector/ResponseCollector.h>
 
 using namespace AsteriskSCF;
 
diff --git a/test/AmiCollector/TestAmiCollector.h b/test/AmiCollector/TestAmiCollector.h
index 41fae09..fe0047c 100644
--- a/test/AmiCollector/TestAmiCollector.h
+++ b/test/AmiCollector/TestAmiCollector.h
@@ -17,7 +17,7 @@
 #include <boost/thread/condition_variable.hpp>
 #include <IceUtil/Handle.h>
 
-#include <AsteriskSCF/AmiCollector.h>
+#include <AsteriskSCF/AmiCollector/AmiCollector.h>
 
 namespace AsteriskSCF
 {
diff --git a/test/StateReplicator/TestStateReplicator.cpp b/test/StateReplicator/TestStateReplicator.cpp
index 6058916..3adb9b2 100644
--- a/test/StateReplicator/TestStateReplicator.cpp
+++ b/test/StateReplicator/TestStateReplicator.cpp
@@ -21,7 +21,7 @@
 
 #include <Ice/Ice.h>
 
-#include <AsteriskSCF/StateReplicator.h>
+#include <AsteriskSCF/StateReplicator/StateReplicator.h>
 
 #include <StateReplicatorTestIf.h>
 #include "SharedTestData.h"

commit b9f0fd36a6be3f8ef05b25df09ea7eac3f67df2d
Author: Brent Eagles <beagles at digium.com>
Date:   Wed Apr 27 17:13:15 2011 -0230

    * Rename some files to be a bit more friendly.
    * Update build files.

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 7ae34a2..af24fcc 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -4,8 +4,5 @@ if (integrated_build STREQUAL "true")
 	set(utils_dir ${CMAKE_CURRENT_SOURCE_DIR} PARENT_SCOPE)
 endif()
 
-add_subdirectory(SmartProxy)
-add_subdirectory(StateReplicator)
-add_subdirectory(AmiCollector)
-add_subdirectory(TestFixture)
+add_subdirectory(src)
 add_subdirectory(test)
diff --git a/config/test_ice_cpp_utility.conf b/config/IceUtilCppTests.conf
similarity index 91%
rename from config/test_ice_cpp_utility.conf
rename to config/IceUtilCppTests.conf
index 9941899..d2f6915 100644
--- a/config/test_ice_cpp_utility.conf
+++ b/config/IceUtilCppTests.conf
@@ -17,4 +17,4 @@ IceBox.ServiceManager.Endpoints=default -p 56000
 IceBox.ServiceManager.ThreadPool.Size=4
 IceBoxManager.Proxy=IceBox/ServiceManager:default -p 56000
 
-IceBox.Service.ProxyHelper=ice_cpp_utility_tests:create
\ No newline at end of file
+IceBox.Service.ProxyHelper=IceUtilCppTests:create
diff --git a/include/AsteriskSCF/AmiCollector/AmiCollector.h b/include/AsteriskSCF/AmiCollector/AmiCollector.h
index cd703c3..db22be3 100644
--- a/include/AsteriskSCF/AmiCollector/AmiCollector.h
+++ b/include/AsteriskSCF/AmiCollector/AmiCollector.h
@@ -22,7 +22,7 @@
 #include <IceUtil/Handle.h>
 #include <IceUtil/Shared.h>
 
-#include <AsteriskSCF/ResponseCollector.h>
+#include <AsteriskSCF/AmiCollector/ResponseCollector.h>
 
 namespace AsteriskSCF
 {
diff --git a/include/AsteriskSCF/SmartProxy/SmartProxy.h b/include/AsteriskSCF/SmartProxy/SmartProxy.h
index ce59be7..a49b1c8 100644
--- a/include/AsteriskSCF/SmartProxy/SmartProxy.h
+++ b/include/AsteriskSCF/SmartProxy/SmartProxy.h
@@ -20,7 +20,6 @@
 #include <Ice/Ice.h>
 #include <IceUtil/Mutex.h>
 #include <AsteriskSCF/logger.h>
-
 #include <AsteriskSCF/Core/Discovery/ServiceLocatorIf.h>
 
 namespace AsteriskSCF
@@ -148,15 +147,20 @@ public:
                                   << ") isn't of expected type";
             }
         }
-        catch (const Ice::SyscallException& e)
+        catch (const Ice::SocketException& e)
         {
             (*mLogger)(Error) << "Exception locating "
                               << mLocatorParams->category << ": " << e.what();
             return 0;
         }
-        catch (const 
+        catch (const AsteriskSCF::Core::Discovery::V1::ServiceNotFound&)
+        {
+            //
+            // Silently ignore as a suitable error message is logged below.
+            // 
+        }
 
-        if (mProxy == 0)
+        if (!mProxy)
         {
             (*mLogger)(Error) << "Unable to locate " << mLocatorParams->category;
         }
diff --git a/include/AsteriskSCF/IceUtility.h b/include/AsteriskSCF/Utilities.h
similarity index 88%
rename from include/AsteriskSCF/IceUtility.h
rename to include/AsteriskSCF/Utilities.h
index 8e1cd83..ac10dee 100644
--- a/include/AsteriskSCF/IceUtility.h
+++ b/include/AsteriskSCF/Utilities.h
@@ -15,13 +15,13 @@
  */
 
 #pragma once
-
 #include <AsteriskSCF/Helpers/ProxyHelper.h>
 #include <AsteriskSCF/Helpers/PropertyHelper.h>
+#include <AsteriskSCF/LocatorRegistration/LocatorRegistrationWrapper.h>
 #include <AsteriskSCF/Listener/ListenerManager.h>
 #include <AsteriskSCF/AmiCollector/AmiCollector.h>
 #include <AsteriskSCF/AmiCollector/ResponseCollector.h>
-#include <AsteriskSCF/SmartProxy/SmartProxy.h>
+// #include <AsteriskSCF/SmartProxy/SmartProxy.h>
 #include <AsteriskSCF/StateReplicator/StateReplicator.h>
 
 //
diff --git a/src/IceUtilCpp.cpp b/src/IceUtilCpp.cpp
index bc6fd9d..d05edd5 100644
--- a/src/IceUtilCpp.cpp
+++ b/src/IceUtilCpp.cpp
@@ -13,8 +13,8 @@
  * the GNU General Public License Version 2. See the LICENSE.txt file
  * at the top of the source tree.
  */
-
-#include <AsteriskSCF/IceUtility.h>
+#include <Ice/Ice.h>
+#include <AsteriskSCF/Utilities.h>
 
 //
 // This .cpp is a temporary solution to get a CMakeProject that consists only of header files.
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
index 757ff94..80e831a 100644
--- a/test/CMakeLists.txt
+++ b/test/CMakeLists.txt
@@ -1,19 +1,22 @@
 asterisk_scf_slice_include_directories(${API_SLICE_DIR})
-asterisk_scf_component_init(ice_cpp_utility_tests CXX)
+asterisk_scf_component_init(IceUtilCppTests CXX)
 include_directories("../include")
-asterisk_scf_component_add_slice(ice_cpp_utility_tests ./ProxyHelper/SimpleIf.ice)
-asterisk_scf_component_add_file(ice_cpp_utility_tests ./LocatorRegistration/LocatorRegistrationTest.cpp)
-asterisk_scf_component_add_file(ice_cpp_utility_tests ./LocatorRegistration/LocatorRegistrationTest.h)
-asterisk_scf_component_add_file(ice_cpp_utility_tests ./PropertyHelper/PropertyHelperTest.cpp)
-asterisk_scf_component_add_file(ice_cpp_utility_tests ./PropertyHelper/PropertyHelperTest.h)
-asterisk_scf_component_add_file(ice_cpp_utility_tests ./ProxyHelper/ProxyHelperTests.cpp)
-asterisk_scf_component_add_file(ice_cpp_utility_tests ./ProxyHelper/ProxyHelperTests.h)
-asterisk_scf_component_add_file(ice_cpp_utility_tests UtilityTests.cpp)
+asterisk_scf_component_add_slice(IceUtilCppTests ./ProxyHelper/SimpleIf.ice)
+asterisk_scf_component_add_file(IceUtilCppTests ./LocatorRegistration/LocatorRegistrationTest.cpp)
+asterisk_scf_component_add_file(IceUtilCppTests ./LocatorRegistration/LocatorRegistrationTest.h)
+asterisk_scf_component_add_file(IceUtilCppTests ./PropertyHelper/PropertyHelperTest.cpp)
+asterisk_scf_component_add_file(IceUtilCppTests ./PropertyHelper/PropertyHelperTest.h)
+asterisk_scf_component_add_file(IceUtilCppTests ./ProxyHelper/ProxyHelperTests.cpp)
+asterisk_scf_component_add_file(IceUtilCppTests ./ProxyHelper/ProxyHelperTests.h)
+asterisk_scf_component_add_file(IceUtilCppTests UtilityTests.cpp)
 
-asterisk_scf_component_add_ice_libraries(ice_cpp_utility_tests IceBox)
-asterisk_scf_component_add_boost_libraries(ice_cpp_utility_tests unit_test_framework date_time thread)
+asterisk_scf_component_add_ice_libraries(IceUtilCppTests IceBox)
+asterisk_scf_component_add_boost_libraries(IceUtilCppTests unit_test_framework date_time thread)
 
 include_directories(${API_INCLUDE_DIR})
-asterisk_scf_component_build_icebox(ice_cpp_utility_tests)
-target_link_libraries(ice_cpp_utility_tests asterisk-scf-api)
+asterisk_scf_component_build_icebox(IceUtilCppTests)
+target_link_libraries(IceUtilCppTests asterisk-scf-api)
+
+add_subdirectory(AmiCollector)
+add_subdirectory(StateReplicator)
 

commit 850c9b33e481d6d879f8f26dc99971336bea3aa0
Author: Brent Eagles <beagles at digium.com>
Date:   Wed Apr 27 16:30:58 2011 -0230

    Altered directory structure, now to get the tests to work.

diff --git a/AmiCollector/CMakeLists.txt b/AmiCollector/CMakeLists.txt
deleted file mode 100644
index 8233f7f..0000000
--- a/AmiCollector/CMakeLists.txt
+++ /dev/null
@@ -1,17 +0,0 @@
-asterisk_scf_component_init(ami-collector CXX)
-
-include_directories(include)
-
-asterisk_scf_component_add_file(ami-collector include/AsteriskSCF/AmiCollector.h)
-asterisk_scf_component_add_file(ami-collector include/AsteriskSCF/ResponseCollector.h)
-asterisk_scf_component_add_file(ami-collector src/AmiCollector.cpp)
-
-asterisk_scf_component_add_boost_libraries(ami-collector thread)
-
-asterisk_scf_component_build_library(ami-collector)
-
-# don't install the component.  it's just there to make Visual Studio happy
-# _do_ install the header files
-asterisk_scf_headers_install(include/)
-
-add_subdirectory(test)
diff --git a/SmartProxy/CMakeLists.txt b/SmartProxy/CMakeLists.txt
deleted file mode 100644
index bdbe333..0000000
--- a/SmartProxy/CMakeLists.txt
+++ /dev/null
@@ -1,32 +0,0 @@
-#
-# Asterisk Scalable Communications Framework
-#
-# Copyright (C) 2010 -- Digium, Inc.
-#
-# All rights reserved.
-#
-
-# Smart Proxy build system
-
-asterisk_scf_component_init(SmartProxy CXX)
-
-include_directories(include)
-
-asterisk_scf_component_add_file(SmartProxy include/AsteriskSCF/SmartProxy.h)
-asterisk_scf_component_add_file(SmartProxy src/SmartProxy.cpp)
-asterisk_scf_component_add_boost_libraries(SmartProxy core)
-
-if(NOT logger_dir)
-   message(FATAL_ERROR "The logger directory could not be found ${logger_dir}")
-endif()
-include_directories(${logger_dir}/include)
-include_directories(${API_INCLUDE_DIR})
-
-asterisk_scf_component_build_library(SmartProxy)
-
-include_directories(${API_INCLUDE_DIR})
-target_link_libraries(SmartProxy logging-client)
-
-# don't install the component.  it's just there to make Visual Studio happy
-# _do_ install the header files
-asterisk_scf_headers_install(include/)
diff --git a/SmartProxy/src/SmartProxy.cpp b/SmartProxy/src/SmartProxy.cpp
deleted file mode 100644
index 2ebb5d7..0000000
--- a/SmartProxy/src/SmartProxy.cpp
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * Asterisk SCF -- An open-source communications framework.
- *
- * Copyright (C) 2010, Digium, Inc.
- *
- * See http://www.asterisk.org for more information about
- * the Asterisk SCF project. Please do not directly contact
- * any of the maintainers of this project for assistance;
- * the project provides a web site, mailing lists and IRC
- * channels for your use.
- *
- * This program is free software, distributed under the terms of
- * the GNU General Public License Version 2. See the LICENSE.txt file
- * at the top of the source tree.
- */
-
-#include <AsteriskSCF/SmartProxy.h>
-
-namespace AsteriskSCF
-{
-namespace ProxyWrapper
-{
-/*
- * This .cpp is a temporary solution to get a CMakeProject that consists only of header files.
- */
-
-};
-
-};
diff --git a/TestFixture/CMakeLists.txt b/TestFixture/CMakeLists.txt
deleted file mode 100644
index 26d5897..0000000
--- a/TestFixture/CMakeLists.txt
+++ /dev/null
@@ -1,16 +0,0 @@
-asterisk_scf_component_init(testfixture CXX)
-
-include_directories(include)
-
-asterisk_scf_component_add_file(testfixture include/AsteriskSCF/IceBoxBoostTest.h)
-asterisk_scf_component_add_file(testfixture src/TestFixture.cpp)
-
-asterisk_scf_component_add_boost_libraries(testfixture  unit_test_framework)
-
-# don't install the component.  it's just there to make Visual Studio happy
-# _do_ install the header files
-asterisk_scf_headers_install(include/)
-
-include_directories(include)
-
-asterisk_scf_component_build_icebox(testfixture)
diff --git a/TestFixture/src/TestFixture.cpp b/TestFixture/src/TestFixture.cpp
deleted file mode 100644
index 718456c..0000000
--- a/TestFixture/src/TestFixture.cpp
+++ /dev/null
@@ -1,19 +0,0 @@
-/*
- * Asterisk SCF -- An open-source communications framework.
- *
- * Copyright (C) 2010, Digium, Inc.
- *
- * See http://www.asterisk.org for more information about
- * the Asterisk SCF project. Please do not directly contact
- * any of the maintainers of this project for assistance;
- * the project provides a web site, mailing lists and IRC
- * channels for your use.
- *
- * This program is free software, distributed under the terms of
- * the GNU General Public License Version 2. See the LICENSE.txt file
- * at the top of the source tree.
- */
-
-#define BOOST_TEST_MODULE DummyTestName
-
-#include  <AsteriskSCF/IceBoxBoostTest.h>
diff --git a/AmiCollector/include/AsteriskSCF/AmiCollector.h b/include/AsteriskSCF/AmiCollector/AmiCollector.h
similarity index 100%
rename from AmiCollector/include/AsteriskSCF/AmiCollector.h
rename to include/AsteriskSCF/AmiCollector/AmiCollector.h
diff --git a/AmiCollector/include/AsteriskSCF/ResponseCollector.h b/include/AsteriskSCF/AmiCollector/ResponseCollector.h
similarity index 100%
rename from AmiCollector/include/AsteriskSCF/ResponseCollector.h
rename to include/AsteriskSCF/AmiCollector/ResponseCollector.h
diff --git a/include/AsteriskSCF/IceUtility.h b/include/AsteriskSCF/IceUtility.h
index c9e5b7b..8e1cd83 100644
--- a/include/AsteriskSCF/IceUtility.h
+++ b/include/AsteriskSCF/IceUtility.h
@@ -19,4 +19,13 @@
 #include <AsteriskSCF/Helpers/ProxyHelper.h>
 #include <AsteriskSCF/Helpers/PropertyHelper.h>
 #include <AsteriskSCF/Listener/ListenerManager.h>
+#include <AsteriskSCF/AmiCollector/AmiCollector.h>
+#include <AsteriskSCF/AmiCollector/ResponseCollector.h>
+#include <AsteriskSCF/SmartProxy/SmartProxy.h>
+#include <AsteriskSCF/StateReplicator/StateReplicator.h>
+
+//
+// The testing header file is deliberately left out as it is not intended for use in implementing components.
+//
+
 
diff --git a/SmartProxy/include/AsteriskSCF/SmartProxy.h b/include/AsteriskSCF/SmartProxy/SmartProxy.h
similarity index 100%
rename from SmartProxy/include/AsteriskSCF/SmartProxy.h
rename to include/AsteriskSCF/SmartProxy/SmartProxy.h
diff --git a/StateReplicator/include/AsteriskSCF/StateReplicator.h b/include/AsteriskSCF/StateReplicator/StateReplicator.h
similarity index 100%
rename from StateReplicator/include/AsteriskSCF/StateReplicator.h
rename to include/AsteriskSCF/StateReplicator/StateReplicator.h
diff --git a/TestFixture/include/AsteriskSCF/IceBoxBoostTest.h b/include/AsteriskSCF/Testing/IceBoxBoostTest.h
similarity index 100%
rename from TestFixture/include/AsteriskSCF/IceBoxBoostTest.h
rename to include/AsteriskSCF/Testing/IceBoxBoostTest.h
diff --git a/AmiCollector/test/CMakeLists.txt b/test/AmiCollector/CMakeLists.txt
similarity index 100%
rename from AmiCollector/test/CMakeLists.txt
rename to test/AmiCollector/CMakeLists.txt
diff --git a/AmiCollector/test/IceIntegration-test.cpp b/test/AmiCollector/IceIntegration-test.cpp
similarity index 100%
rename from AmiCollector/test/IceIntegration-test.cpp
rename to test/AmiCollector/IceIntegration-test.cpp
diff --git a/AmiCollector/test/ResponseCollector-test.cpp b/test/AmiCollector/ResponseCollector-test.cpp
similarity index 100%
rename from AmiCollector/test/ResponseCollector-test.cpp
rename to test/AmiCollector/ResponseCollector-test.cpp
diff --git a/AmiCollector/test/TestAmiCollector.h b/test/AmiCollector/TestAmiCollector.h
similarity index 100%
rename from AmiCollector/test/TestAmiCollector.h
rename to test/AmiCollector/TestAmiCollector.h
diff --git a/AmiCollector/test/test.cpp b/test/AmiCollector/test.cpp
similarity index 100%
rename from AmiCollector/test/test.cpp
rename to test/AmiCollector/test.cpp
diff --git a/StateReplicator/test/CMakeLists.txt b/test/StateReplicator/CMakeLists.txt
similarity index 85%
rename from StateReplicator/test/CMakeLists.txt
rename to test/StateReplicator/CMakeLists.txt
index 43b0f1a..44f7460 100644
--- a/StateReplicator/test/CMakeLists.txt
+++ b/test/StateReplicator/CMakeLists.txt
@@ -5,7 +5,7 @@ include_directories("../include")
 asterisk_scf_component_add_file(StateReplicatorTest TestStateReplicator.cpp)
 asterisk_scf_component_add_file(StateReplicatorTest SharedTestData.h)
 asterisk_scf_component_add_file(StateReplicatorTest MockStateReplicatorListener.h)
-asterisk_scf_component_add_slice(StateReplicatorTest ../testslice/StateReplicatorTestIf.ice)
+asterisk_scf_component_add_slice(StateReplicatorTest ./slice/StateReplicatorTestIf.ice)
 asterisk_scf_component_add_boost_libraries(StateReplicatorTest unit_test_framework thread date_time)
 
 asterisk_scf_component_build_standalone(StateReplicatorTest)
diff --git a/StateReplicator/test/MockStateReplicatorListener.h b/test/StateReplicator/MockStateReplicatorListener.h
similarity index 100%
rename from StateReplicator/test/MockStateReplicatorListener.h
rename to test/StateReplicator/MockStateReplicatorListener.h
diff --git a/StateReplicator/test/SharedTestData.h b/test/StateReplicator/SharedTestData.h
similarity index 100%
rename from StateReplicator/test/SharedTestData.h
rename to test/StateReplicator/SharedTestData.h
diff --git a/StateReplicator/test/TestStateReplicator.cpp b/test/StateReplicator/TestStateReplicator.cpp
similarity index 100%
rename from StateReplicator/test/TestStateReplicator.cpp
rename to test/StateReplicator/TestStateReplicator.cpp
diff --git a/StateReplicator/testslice/StateReplicatorTestIf.ice b/test/StateReplicator/slice/StateReplicatorTestIf.ice
similarity index 100%
rename from StateReplicator/testslice/StateReplicatorTestIf.ice
rename to test/StateReplicator/slice/StateReplicatorTestIf.ice

commit 0e34466aa0f98246798941010b0d38b7648057d2
Author: Brent Eagles <beagles at digium.com>
Date:   Wed Apr 27 16:10:42 2011 -0230

    Starting consolidating the other elements of the utility library into
    a single project structure.

diff --git a/src/IceUtilCpp.cpp b/src/IceUtilCpp.cpp
new file mode 100644
index 0000000..bc6fd9d
--- /dev/null
+++ b/src/IceUtilCpp.cpp
@@ -0,0 +1,21 @@
+/*
+ * Asterisk SCF -- An open-source communications framework.
+ *
+ * Copyright (C) 2010, Digium, Inc.
+ *
+ * See http://www.asterisk.org for more information about
+ * the Asterisk SCF project. Please do not directly contact
+ * any of the maintainers of this project for assistance;
+ * the project provides a web site, mailing lists and IRC
+ * channels for your use.
+ *
+ * This program is free software, distributed under the terms of
+ * the GNU General Public License Version 2. See the LICENSE.txt file
+ * at the top of the source tree.
+ */
+
+#include <AsteriskSCF/IceUtility.h>
+
+//
+// This .cpp is a temporary solution to get a CMakeProject that consists only of header files.
+//

commit d3f0c6cb6d104404c47a498e279f35dd56e0d9c2
Author: Brent Eagles <beagles at digium.com>
Date:   Wed Apr 27 16:07:08 2011 -0230

    Remove obsolete file.

diff --git a/test/PropertyHelper/main.cpp b/test/PropertyHelper/main.cpp
deleted file mode 100644
index f50d5ec..0000000
--- a/test/PropertyHelper/main.cpp
+++ /dev/null
@@ -1,18 +0,0 @@
-#include <iostream>
-#define BOOST_TEST_DYN_LINK
-#define BOOST_TEST_MODULE PropertyTestDriver
-#include <boost/test/unit_test.hpp>
-
-using namespace std;
-
-extern "C" void runPropertyHelperTest();
-
-//
-// Simple command line driver to run these tests with a limited amount of hassle while they are
-// being developed. (Will be removed when they tests are integrated into a proper test module.
-//
-
-BOOST_AUTO_TEST_CASE( runTest )
-{
-    runPropertyHelperTest();
-}

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


-- 
asterisk-scf/integration/ice-util-cpp.git



More information about the asterisk-scf-commits mailing list