[asterisk-scf-commits] asterisk-scf/integration/ice-util-c++.git branch "master" updated.

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


branch "master" has been updated
       via  fedbf5bc207cfbf4b46b4a3f890793568bb07b69 (commit)
      from  ad69c4da94a39577523a162f7d6ca4b49d1b1e69 (commit)

Summary of changes:
 ProxyWrapper/src/ProxyWrapper.cpp                  |    4 +-
 ProxyWrapper/src/ProxyWrapper.h                    |  196 +++---
 StateReplicator/src/StateReplicator.cpp            |    4 +-
 StateReplicator/src/StateReplicator.h              |  434 ++++++------
 StateReplicator/test/MockStateReplicatorListener.h |   32 +-
 StateReplicator/test/SharedTestData.h              |   40 +-
 StateReplicator/test/TestStateReplicator.cpp       |  740 ++++++++++----------
 7 files changed, 725 insertions(+), 725 deletions(-)


- Log -----------------------------------------------------------------
commit fedbf5bc207cfbf4b46b4a3f890793568bb07b69
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/ProxyWrapper/src/ProxyWrapper.cpp b/ProxyWrapper/src/ProxyWrapper.cpp
index 25281d6..875d360 100644
--- a/ProxyWrapper/src/ProxyWrapper.cpp
+++ b/ProxyWrapper/src/ProxyWrapper.cpp
@@ -20,8 +20,8 @@ namespace AsteriskSCF
 {
 namespace ProxyWrapper
 {
- /*
- * This .cpp is a temporary solution to get a CMakeProject that consists only of header files. 
+/*
+ * This .cpp is a temporary solution to get a CMakeProject that consists only of header files.
  */
 
 };
diff --git a/ProxyWrapper/src/ProxyWrapper.h b/ProxyWrapper/src/ProxyWrapper.h
index 65a6f4e..3439f3f 100644
--- a/ProxyWrapper/src/ProxyWrapper.h
+++ b/ProxyWrapper/src/ProxyWrapper.h
@@ -42,106 +42,106 @@ template <class P>
 class ProxyWrapper
 {
 public:
-	ProxyWrapper() : mServiceLocator(0), mLocatorParams(0), mInitialized(false) {}
-
-	ProxyWrapper(const ProxyWrapper &pw)
-	{
-		copy(pw);
-	}
-
-	ProxyWrapper(const AsteriskSCF::Core::Discovery::V1::ServiceLocatorPrx& locator,
-			AsteriskSCF::Core::Discovery::V1::ServiceLocatorParamsPtr params)
-			:  mServiceLocator(locator), mLocatorParams(params), mInitialized(false)
-	{
-		initialize();
-	}
-
-	P& operator->()
-	{
-		assert(mServiceLocator && mLocatorParams);
-		
-		if (!verifyInitialized())
-		{
-			throw "No access to Proxy";
-		}
-
-		return mProxy;
-	}
-	
-	ProxyWrapper operator=(const ProxyWrapper &pw)
-	{
-		// Boo to self-assignment
-		if (this == &pw)
-		{
-			return *this;
-		}
-		copy(pw);
-		return *this;
-	}
-	
-	operator void*() const
-	{
-		return mProxy ? (void *)1 : 0;
-	}
-	
-	bool isInitialized()
-	{
-		return mInitialized;
-	}
+    ProxyWrapper() : mServiceLocator(0), mLocatorParams(0), mInitialized(false) {}
+
+    ProxyWrapper(const ProxyWrapper &pw)
+    {
+        copy(pw);
+    }
+
+    ProxyWrapper(const AsteriskSCF::Core::Discovery::V1::ServiceLocatorPrx& locator,
+        AsteriskSCF::Core::Discovery::V1::ServiceLocatorParamsPtr params)
+        :  mServiceLocator(locator), mLocatorParams(params), mInitialized(false)
+    {
+        initialize();
+    }
+
+    P& operator->()
+    {
+        assert(mServiceLocator && mLocatorParams);
+
+        if (!verifyInitialized())
+        {
+            throw "No access to Proxy";
+        }
+
+        return mProxy;
+    }
+
+    ProxyWrapper operator=(const ProxyWrapper &pw)
+    {
+        // Boo to self-assignment
+        if (this == &pw)
+        {
+            return *this;
+        }
+        copy(pw);
+        return *this;
+    }
+
+    operator void*() const
+    {
+        return mProxy ? (void *)1 : 0;
+    }
+
+    bool isInitialized()
+    {
+        return mInitialized;
+    }
 
 private:
-	/**
-	 * Initialization. Primarily involves acquring access to specific IceStorm topic. 
-	 */
-	void initialize()
-	{
-		try
-		{
-			// Use the locator to find the Proxy
-			Ice::ObjectPrx bridgeManagerObject = mServiceLocator->locate(mLocatorParams);
-			mProxy = P::checkedCast(bridgeManagerObject);
-		}
-		catch (const Ice::Exception &e)
-		{
-			std::cout << "Exception locating " << mLocatorParams->category << ": " << e.what() << std::endl; 
-			return;
-		}
-
-		if (mProxy == 0)
-		{
-			std::cout << "Unable to locate " << mLocatorParams->category << std::endl;
-		}
-
-		mInitialized = true;
-	}
-
-	/**
-	 * Utiltity to check for initialization state. 
-	 */
-	bool verifyInitialized()
-	{
-		if (mInitialized)
-		{
-			return true;
-		}
-
-		// Try again to initialize.
-		initialize();
-		return mInitialized;
-	}
-
-	void copy(const ProxyWrapper &pw)
-	{
-		mServiceLocator = pw.mServiceLocator;
-		mLocatorParams = pw.mLocatorParams;
-		mProxy = pw.mProxy;
-		mInitialized = pw.mInitialized;
-	}
-
-	P mProxy;
-	AsteriskSCF::Core::Discovery::V1::ServiceLocatorPrx mServiceLocator;
-	AsteriskSCF::Core::Discovery::V1::ServiceLocatorParamsPtr mLocatorParams;
-	bool mInitialized;
+    /**
+     * Initialization. Primarily involves acquring access to specific IceStorm topic.
+     */
+    void initialize()
+    {
+        try
+        {
+            // Use the locator to find the Proxy
+            Ice::ObjectPrx bridgeManagerObject = mServiceLocator->locate(mLocatorParams);
+            mProxy = P::checkedCast(bridgeManagerObject);
+        }
+        catch (const Ice::Exception &e)
+        {
+            std::cout << "Exception locating " << mLocatorParams->category << ": " << e.what() << std::endl;
+            return;
+        }
+
+        if (mProxy == 0)
+        {
+            std::cout << "Unable to locate " << mLocatorParams->category << std::endl;
+        }
+
+        mInitialized = true;
+    }
+
+    /**
+     * Utiltity to check for initialization state.
+     */
+    bool verifyInitialized()
+    {
+        if (mInitialized)
+        {
+            return true;
+        }
+
+        // Try again to initialize.
+        initialize();
+        return mInitialized;
+    }
+
+    void copy(const ProxyWrapper &pw)
+    {
+        mServiceLocator = pw.mServiceLocator;
+        mLocatorParams = pw.mLocatorParams;
+        mProxy = pw.mProxy;
+        mInitialized = pw.mInitialized;
+    }
+
+    P mProxy;
+    AsteriskSCF::Core::Discovery::V1::ServiceLocatorPrx mServiceLocator;
+    AsteriskSCF::Core::Discovery::V1::ServiceLocatorParamsPtr mLocatorParams;
+    bool mInitialized;
 };
 
 }; // end ProxyWrapper
diff --git a/StateReplicator/src/StateReplicator.cpp b/StateReplicator/src/StateReplicator.cpp
index dfd6aa0..5674a57 100644
--- a/StateReplicator/src/StateReplicator.cpp
+++ b/StateReplicator/src/StateReplicator.cpp
@@ -22,8 +22,8 @@ namespace AsteriskSCF
 {
 namespace StateReplication
 {
- /*
- * This .cpp is a temporary solution to get a CMakeProject that consists only of header files. 
+/*
+ * This .cpp is a temporary solution to get a CMakeProject that consists only of header files.
  */
 
 };
diff --git a/StateReplicator/src/StateReplicator.h b/StateReplicator/src/StateReplicator.h
index f119668..b778aeb 100644
--- a/StateReplicator/src/StateReplicator.h
+++ b/StateReplicator/src/StateReplicator.h
@@ -25,216 +25,216 @@ namespace StateReplication
 {
 
 /**
- * Templatization of a state replicator.  This particular implementation preserves the order 
- * of the fields from the order in which they were added to the collection. If an item is removed and 
- * re-added later, it goes to the back of the list. 
- *  - The state item type is assumed to have a public field named "key" which is of type "K". 
+ * Templatization of a state replicator.  This particular implementation preserves the order
+ * of the fields from the order in which they were added to the collection. If an item is removed and
+ * re-added later, it goes to the back of the list.
+ *  - The state item type is assumed to have a public field named "key" which is of type "K".
 
  The Replicator should implement (at a minimum) these operations:
-   interface FooStateReplicator
-   {
-     void addListener(TestStateReplicatorListener *listener);
-	  void removeListener(TestStateReplicatorListener *listener);
-	  void setState (FooStateItemSeq items);
-	  void removeState(FooKeySeq items);
-	  idempotent TestStateItemSeq getState(FooKeySeq itemKeys);
-	  idempotent TestStateItemSeq getAllState();
-   };
+ interface FooStateReplicator
+ {
+ void addListener(TestStateReplicatorListener *listener);
+ void removeListener(TestStateReplicatorListener *listener);
+ void setState (FooStateItemSeq items);
+ void removeState(FooKeySeq items);
+ idempotent TestStateItemSeq getState(FooKeySeq itemKeys);
+ idempotent TestStateItemSeq getAllState();
+ };
 
  The Listener should implement (at a minimum) these operations:
-   interface FooStateReplicatorListener
-   {
-     void stateRemoved(FooKeySeq itemKeys);
-	  void stateSet(FooStateItemSeq items);
-   };
-
- * NOTE: - The process should be made asynchronous.  
- * NOTE: - Should probably use IceStorm for forwarding to all listeners. 
+ interface FooStateReplicatorListener
+ {
+ void stateRemoved(FooKeySeq itemKeys);
+ void stateSet(FooStateItemSeq items);
+ };
+
+ * NOTE: - The process should be made asynchronous.
+ * NOTE: - Should probably use IceStorm for forwarding to all listeners.
  */
-template<typename R, typename S, typename K, typename L>  
+template<typename R, typename S, typename K, typename L>
 class StateReplicator : public R
 {
 // Template Types: R - Replicator, S - State item, K - Key element, L - Listener
 public:
-   /**
-    * Functor for forwarding setState() notices.
-    */
-   template<typename T, typename U> class SetStateNotice
-   {
-      // Types: T - Listener type, U - State Item seq.
-   public:
-      SetStateNotice(const U& stateSeq) : mStateSeq(stateSeq) {}
-      ~SetStateNotice() {}
-      void operator() (T x) 
-      {
-          try
-          {
-              x->stateSet(mStateSeq);
-          }
-          catch(const Ice::Exception&)
-          {
-          }
-          catch(...)
-          {
-          }
-      }
-      U mStateSeq;
-   };
-
-   /**
-    * Functor for forwarding removeState() notices.
-    */
-   template<typename T, typename V> class RemoveStateNotice
-   {
-      // Types: T - Listener type, V - Key Item seq.
-   public:
-      RemoveStateNotice(const V& keys) : mKeys(keys) {}
-      ~RemoveStateNotice() {}
-      void operator() (T x) 
-      {
-          try
-          {
-              x->stateRemoved(mKeys);
-          }
-          catch(const Ice::Exception&)
-          {
-          }
-          catch(...)
-          {
-          }
-      }
-      V mKeys;
-   };
-
-   /** 
-    * Functor to use as find_if predicate. 
-    */
-   template<typename T> class IdentifyListener
-   {
-   public: 
-      IdentifyListener(const T& listener) : mListener(listener) {}
-      ~IdentifyListener() {}
-      bool operator() (T x) {return (x->ice_getIdentity() == mListener->ice_getIdentity());}
-      T mListener;
-   };
-
-   template<typename T, typename D> class MatchItem
-   {
-   public:
-      MatchItem(const D& key) : mKey(key) {}
-      ~MatchItem() {}
-      bool operator() (T x) {return (x->key == mKey); }
-      D mKey;
-   };
+    /**
+     * Functor for forwarding setState() notices.
+     */
+    template<typename T, typename U> class SetStateNotice
+    {
+        // Types: T - Listener type, U - State Item seq.
+    public:
+        SetStateNotice(const U& stateSeq) : mStateSeq(stateSeq) {}
+        ~SetStateNotice() {}
+        void operator() (T x)
+        {
+            try
+            {
+                x->stateSet(mStateSeq);
+            }
+            catch(const Ice::Exception&)
+            {
+            }
+            catch(...)
+            {
+            }
+        }
+        U mStateSeq;
+    };
+
+    /**
+     * Functor for forwarding removeState() notices.
+     */
+    template<typename T, typename V> class RemoveStateNotice
+    {
+        // Types: T - Listener type, V - Key Item seq.
+    public:
+        RemoveStateNotice(const V& keys) : mKeys(keys) {}
+        ~RemoveStateNotice() {}
+        void operator() (T x)
+        {
+            try
+            {
+                x->stateRemoved(mKeys);
+            }
+            catch(const Ice::Exception&)
+            {
+            }
+            catch(...)
+            {
+            }
+        }
+        V mKeys;
+    };
+
+    /**
+     * Functor to use as find_if predicate.
+     */
+    template<typename T> class IdentifyListener
+    {
+    public:
+        IdentifyListener(const T& listener) : mListener(listener) {}
+        ~IdentifyListener() {}
+        bool operator() (T x) {return (x->ice_getIdentity() == mListener->ice_getIdentity());}
+        T mListener;
+    };
+
+    template<typename T, typename D> class MatchItem
+    {
+    public:
+        MatchItem(const D& key) : mKey(key) {}
+        ~MatchItem() {}
+        bool operator() (T x) {return (x->key == mKey); }
+        D mKey;
+    };
 
 public:
-   StateReplicator() {};
-   virtual ~StateReplicator() {};
-
-   /**
-    * Adds a listener of state update notices. 
-    * @Override 
-    */
-   void addListener(const L& listener, const Ice::Current& = ::Ice::Current())
-   {
-       {   // critical scope
-           boost::unique_lock<boost::shared_mutex> lock(mListenerLock); 
-           mListeners.push_back(listener);
-       }
-
-       // Give this listener the current state.
-       boost::shared_lock<boost::shared_mutex> lock(mStateLock); 
-       try
-       {
-           listener->stateSet(mStateItems);
-       }
-       catch(const Ice::Exception&)
-       {
-       }
-       catch(...)
-       {
-       }
-   }
-
-   /**
-    * Removes a listener of state update notices. 
-    * @Override 
-    */
-   void removeListener(const L& listener, const Ice::Current& = ::Ice::Current())
-   {
-       boost::unique_lock<boost::shared_mutex> lock(mListenerLock); 
-       typename std::vector<L>::iterator it = std::find_if(mListeners.begin(), mListeners.end(), IdentifyListener<L>(listener));
-
-       if (it != mListeners.end())
-       {
-           mListeners.erase(it);
-       }
-   }
-
-   /**
-    * Drops all listeners of state update notices.
-    */
-   void clearListeners()
-   {
-       boost::unique_lock<boost::shared_mutex> lock(mListenerLock); 
-       mListeners.clear();
-   }
-
-   /**
-    * Drops all state that has previously been set. Notifies listeners. 
-    */
-   void clearState()
-   {
-       std::vector<K> allIds;
-
-       {   // critical scope
-           boost::unique_lock<boost::shared_mutex> lock(mStateLock);
-           for(typename std::vector<S>::const_iterator it = mStateItems.begin(); it != mStateItems.end(); ++it)
-           {
-               allIds.push_back((*it)->key);
-           }
-           mStateItems.clear();
-       }
-
-       boost::shared_lock<boost::shared_mutex> lock(mListenerLock); 
-       for_each(mListeners.begin(), mListeners.end(), RemoveStateNotice<L,std::vector<K> >(allIds));
-   }
-
-   /**
-    * Add or update the specified state variables, and notify listeners. 
-    * @Override
-    */
-   void setState(const std::vector<S>& items, const Ice::Current& = ::Ice::Current())
-   {
-       {    // critical scope
+    StateReplicator() {};
+    virtual ~StateReplicator() {};
+
+    /**
+     * Adds a listener of state update notices.
+     * @Override
+     */
+    void addListener(const L& listener, const Ice::Current& = ::Ice::Current())
+    {
+        {   // critical scope
+            boost::unique_lock<boost::shared_mutex> lock(mListenerLock);
+            mListeners.push_back(listener);
+        }
+
+        // Give this listener the current state.
+        boost::shared_lock<boost::shared_mutex> lock(mStateLock);
+        try
+        {
+            listener->stateSet(mStateItems);
+        }
+        catch(const Ice::Exception&)
+        {
+        }
+        catch(...)
+        {
+        }
+    }
+
+    /**
+     * Removes a listener of state update notices.
+     * @Override
+     */
+    void removeListener(const L& listener, const Ice::Current& = ::Ice::Current())
+    {
+        boost::unique_lock<boost::shared_mutex> lock(mListenerLock);
+        typename std::vector<L>::iterator it = std::find_if(mListeners.begin(), mListeners.end(), IdentifyListener<L>(listener));
+
+        if (it != mListeners.end())
+        {
+            mListeners.erase(it);
+        }
+    }
+
+    /**
+     * Drops all listeners of state update notices.
+     */
+    void clearListeners()
+    {
+        boost::unique_lock<boost::shared_mutex> lock(mListenerLock);
+        mListeners.clear();
+    }
+
+    /**
+     * Drops all state that has previously been set. Notifies listeners.
+     */
+    void clearState()
+    {
+        std::vector<K> allIds;
+
+        {   // critical scope
+            boost::unique_lock<boost::shared_mutex> lock(mStateLock);
+            for(typename std::vector<S>::const_iterator it = mStateItems.begin(); it != mStateItems.end(); ++it)
+            {
+                allIds.push_back((*it)->key);
+            }
+            mStateItems.clear();
+        }
+
+        boost::shared_lock<boost::shared_mutex> lock(mListenerLock);
+        for_each(mListeners.begin(), mListeners.end(), RemoveStateNotice<L,std::vector<K> >(allIds));
+    }
+
+    /**
+     * Add or update the specified state variables, and notify listeners.
+     * @Override
+     */
+    void setState(const std::vector<S>& items, const Ice::Current& = ::Ice::Current())
+    {
+        {    // critical scope
             boost::unique_lock<boost::shared_mutex> lock(mStateLock);
 
             for (typename std::vector<S>::const_iterator iter = items.begin();
-                iter != items.end(); ++iter)
+                 iter != items.end(); ++iter)
             {
-                 typename std::vector<S>::iterator it = std::find_if(mStateItems.begin(), mStateItems.end(), MatchItem<S,K >((*iter)->key));
+                typename std::vector<S>::iterator it = std::find_if(mStateItems.begin(), mStateItems.end(), MatchItem<S,K >((*iter)->key));
 
-                 if (it != mStateItems.end())
-                 { 
+                if (it != mStateItems.end())
+                {
                     (*it) = (*iter);
-                 }
-                 else
-                 {
+                }
+                else
+                {
                     mStateItems.push_back(*iter);
-                 }
+                }
             }
         }
 
-       boost::shared_lock<boost::shared_mutex> lock(mListenerLock); 
-       for_each( mListeners.begin(), mListeners.end(), SetStateNotice<L,std::vector<S> >(items) );
-   }
+        boost::shared_lock<boost::shared_mutex> lock(mListenerLock);
+        for_each( mListeners.begin(), mListeners.end(), SetStateNotice<L,std::vector<S> >(items) );
+    }
 
-   /**
-    * Remove the specified state variables, and notify listeners. 
-    * @Override
-    */
-   void removeState(const std::vector<K>& ids, const Ice::Current& = ::Ice::Current())
-   {
+    /**
+     * Remove the specified state variables, and notify listeners.
+     * @Override
+     */
+    void removeState(const std::vector<K>& ids, const Ice::Current& = ::Ice::Current())
+    {
         {   // critical scope
             boost::unique_lock<boost::shared_mutex> lock(mStateLock);
 
@@ -248,17 +248,17 @@ public:
                 }
             }
         }
-        
+
         boost::shared_lock<boost::shared_mutex> lock(mListenerLock);
         for_each(mListeners.begin(), mListeners.end(), RemoveStateNotice<L,std::vector<K> >(ids));
-   }
+    }
 
     /**
-    * Retrieve the state variables identifed by the key collection.  
-    * @Override
-    */
+     * Retrieve the state variables identifed by the key collection.
+     * @Override
+     */
     std::vector<S> getState(const std::vector<K>& itemKeys, const Ice::Current& = ::Ice::Current())
-    { 
+    {
         std::vector<S> results;
 
         {   // critical scope
@@ -270,38 +270,38 @@ public:
 
                 if (locateIt != mStateItems.end())
                 {
-                   results.push_back(*locateIt);
+                    results.push_back(*locateIt);
                 }
             }
         }
         return results;
     }
 
-   /**
-    * Retrieve all the state variables currently known to this replicator. 
-    * @Override
-    */
-   std::vector<S> getAllState(const Ice::Current& = ::Ice::Current())
-   {
-       boost::shared_lock<boost::shared_mutex> lock(mStateLock);
-       return mStateItems;
-   }
-
-   /**
-    * Returns the number of listeners currently registered with this replicator. 
-    */
-   int getListenerCount()
-   {
-       boost::shared_lock<boost::shared_mutex> lock(mListenerLock);
-       return mListeners.size();
-   }
+    /**
+     * Retrieve all the state variables currently known to this replicator.
+     * @Override
+     */
+    std::vector<S> getAllState(const Ice::Current& = ::Ice::Current())
+    {
+        boost::shared_lock<boost::shared_mutex> lock(mStateLock);
+        return mStateItems;
+    }
+
+    /**
+     * Returns the number of listeners currently registered with this replicator.
+     */
+    int getListenerCount()
+    {
+        boost::shared_lock<boost::shared_mutex> lock(mListenerLock);
+        return mListeners.size();
+    }
 
 private:
-   std::vector<L> mListeners;
-   std::vector<S> mStateItems;
+    std::vector<L> mListeners;
+    std::vector<S> mStateItems;
 
-   boost::shared_mutex mListenerLock;
-   boost::shared_mutex mStateLock;
+    boost::shared_mutex mListenerLock;
+    boost::shared_mutex mStateLock;
 };
 
 } // end namespace StateReplication
diff --git a/StateReplicator/test/MockStateReplicatorListener.h b/StateReplicator/test/MockStateReplicatorListener.h
index f9901a9..bb76ec0 100644
--- a/StateReplicator/test/MockStateReplicatorListener.h
+++ b/StateReplicator/test/MockStateReplicatorListener.h
@@ -26,35 +26,35 @@ namespace StateReplicatorTest
 class MockStateReplicatorListenerImpl : public AsteriskSCF::StateReplicatorTest::V1::TestStateReplicatorListener
 {
 public:
-   MockStateReplicatorListenerImpl() : mRemoveStateCalled(false), mSetStateCalled(true)
-   {
-   }
+    MockStateReplicatorListenerImpl() : mRemoveStateCalled(false), mSetStateCalled(true)
+    {
+    }
 
     void stateRemoved(const ::Ice::StringSeq& itemKeys, const ::Ice::Current& )
     {
-       mItemKeys = itemKeys;
-       mRemoveStateCalled = true;
+        mItemKeys = itemKeys;
+        mRemoveStateCalled = true;
     }
 
     void stateSet(const ::AsteriskSCF::StateReplicatorTest::V1::TestStateItemSeq& items, const ::Ice::Current& )
     {
-       mStateItems = items;
-       mSetStateCalled = true;
+        mStateItems = items;
+        mSetStateCalled = true;
     }
 
-     void reset()
+    void reset()
     {
-       mRemoveStateCalled = false;
-       mSetStateCalled = false;
-       mStateItems.clear();
-       mItemKeys.clear();
+        mRemoveStateCalled = false;
+        mSetStateCalled = false;
+        mStateItems.clear();
+        mItemKeys.clear();
     }
 
 public:
-   bool mRemoveStateCalled;
-   bool mSetStateCalled;
-   AsteriskSCF::StateReplicatorTest::V1::TestStateItemSeq mStateItems;
-   Ice::StringSeq mItemKeys;
+    bool mRemoveStateCalled;
+    bool mSetStateCalled;
+    AsteriskSCF::StateReplicatorTest::V1::TestStateItemSeq mStateItems;
+    Ice::StringSeq mItemKeys;
 };
 typedef ::IceInternal::ProxyHandle<MockStateReplicatorListenerImpl> MockStateReplicatorListenerImplPrx;
 typedef ::IceInternal::Handle<MockStateReplicatorListenerImpl> MockStateReplicatorListenerImplPtr;
diff --git a/StateReplicator/test/SharedTestData.h b/StateReplicator/test/SharedTestData.h
index 5655049..4632e9a 100644
--- a/StateReplicator/test/SharedTestData.h
+++ b/StateReplicator/test/SharedTestData.h
@@ -23,37 +23,37 @@ namespace AsteriskSCF
 {
 namespace StateReplicatorTest
 {
- // typedef AsteriskSCF::StateReplication::StateReplicator<AsteriskSCF::StateReplicatorTest::V1::TestStateReplicator, AsteriskSCF::StateReplicatorTest::V1::TestStateItemSeq, AsteriskSCF::StateReplicatorTest::V1::TestStateItemPtr, Ice::StringSeq, std::string, AsteriskSCF::StateReplicatorTest::V1::TestStateReplicatorListenerPrx> TestReplicatorImpl;
- typedef AsteriskSCF::StateReplication::StateReplicator<AsteriskSCF::StateReplicatorTest::V1::TestStateReplicator, AsteriskSCF::StateReplicatorTest::V1::TestStateItemPtr, std::string, AsteriskSCF::StateReplicatorTest::V1::TestStateReplicatorListenerPrx> TestReplicatorImpl;
- typedef IceUtil::Handle<TestReplicatorImpl> TestReplicatorImplPtr;
+// typedef AsteriskSCF::StateReplication::StateReplicator<AsteriskSCF::StateReplicatorTest::V1::TestStateReplicator, AsteriskSCF::StateReplicatorTest::V1::TestStateItemSeq, AsteriskSCF::StateReplicatorTest::V1::TestStateItemPtr, Ice::StringSeq, std::string, AsteriskSCF::StateReplicatorTest::V1::TestStateReplicatorListenerPrx> TestReplicatorImpl;
+typedef AsteriskSCF::StateReplication::StateReplicator<AsteriskSCF::StateReplicatorTest::V1::TestStateReplicator, AsteriskSCF::StateReplicatorTest::V1::TestStateItemPtr, std::string, AsteriskSCF::StateReplicatorTest::V1::TestStateReplicatorListenerPrx> TestReplicatorImpl;
+typedef IceUtil::Handle<TestReplicatorImpl> TestReplicatorImplPtr;
 
-/** 
+/**
  * Pseudo singleton for sharing data among test artifacts.
  */
 class SharedTestData
 {
 public:
-   static SharedTestData instance; 
+    static SharedTestData instance;
 
-	// Communicator for outgoing stuff. 
-	Ice::CommunicatorPtr communicator_out;
+    // Communicator for outgoing stuff.
+    Ice::CommunicatorPtr communicator_out;
 
-	// Communicator for incoming stuff. This is where we add the test servants.
-	Ice::CommunicatorPtr communicator_in;
+    // Communicator for incoming stuff. This is where we add the test servants.
+    Ice::CommunicatorPtr communicator_in;
 
-	Ice::ObjectAdapterPtr adapter_in;
-	Ice::ObjectAdapterPtr adapter_out;
+    Ice::ObjectAdapterPtr adapter_in;
+    Ice::ObjectAdapterPtr adapter_out;
 
-   TestReplicatorImplPtr mTestReplicatorImplPtr;
-   AsteriskSCF::StateReplicatorTest::V1::TestStateReplicatorPrx mTestStateReplicatorPrx;
+    TestReplicatorImplPtr mTestReplicatorImplPtr;
+    AsteriskSCF::StateReplicatorTest::V1::TestStateReplicatorPrx mTestStateReplicatorPrx;
 
-   MockStateReplicatorListenerImplPtr mMockStateListener1Ptr;
-   MockStateReplicatorListenerImplPtr mMockStateListener2Ptr;
-   MockStateReplicatorListenerImplPtr mMockStateListener3Ptr;
-   
-   AsteriskSCF::StateReplicatorTest::V1::TestStateReplicatorListenerPrx mTestStateListener1Prx;
-   AsteriskSCF::StateReplicatorTest::V1::TestStateReplicatorListenerPrx mTestStateListener2Prx;
-   AsteriskSCF::StateReplicatorTest::V1::TestStateReplicatorListenerPrx mTestStateListener3Prx;
+    MockStateReplicatorListenerImplPtr mMockStateListener1Ptr;
+    MockStateReplicatorListenerImplPtr mMockStateListener2Ptr;
+    MockStateReplicatorListenerImplPtr mMockStateListener3Ptr;
+
+    AsteriskSCF::StateReplicatorTest::V1::TestStateReplicatorListenerPrx mTestStateListener1Prx;
+    AsteriskSCF::StateReplicatorTest::V1::TestStateReplicatorListenerPrx mTestStateListener2Prx;
+    AsteriskSCF::StateReplicatorTest::V1::TestStateReplicatorListenerPrx mTestStateListener3Prx;
 };
 
 }; // StateReplicatorTest
diff --git a/StateReplicator/test/TestStateReplicator.cpp b/StateReplicator/test/TestStateReplicator.cpp
index 8a8e5f4..5cc81a8 100644
--- a/StateReplicator/test/TestStateReplicator.cpp
+++ b/StateReplicator/test/TestStateReplicator.cpp
@@ -40,8 +40,8 @@ SharedTestData SharedTestData::instance;
 struct ArgCacheType
 {
 public:
-	int argc;
-	char **argv;
+    int argc;
+    char **argv;
 };
 static ArgCacheType mCachedArgs;
 
@@ -51,88 +51,88 @@ static ArgCacheType mCachedArgs;
  */
 struct GlobalIceFixture
 {
-	GlobalIceFixture()
-   {
-      BOOST_TEST_MESSAGE("Setting up State Replicator test fixture");
-
-      ::boost::debug::detect_memory_leaks(false);
-      ::boost::unit_test::unit_test_log.set_stream( std::cout );
-
-      int status = 0;
-      try
-      {
-         Ice::PropertiesPtr props = Ice::createProperties(mCachedArgs.argc, mCachedArgs.argv);
-         Ice::InitializationData initData;
-         initData.properties = props;
-
-         // NOTE: See the typedef at top of ShareTestData.h to see how the StateReplicator template is invoked. 
-
-         // Set up incoming adapter. This is where we'll publish our proxies.
-         SharedTestData::instance.communicator_in = Ice::initialize(initData);
-
-	      SharedTestData::instance.adapter_in = SharedTestData::instance.communicator_in->createObjectAdapterWithEndpoints("TestReplicatorAdapterIn", "default -p 10070");
-
-         string replicatorId("TestReplicator");
-         SharedTestData::instance.mTestReplicatorImplPtr = new TestReplicatorImpl();
-         SharedTestData::instance.adapter_in->add(SharedTestData::instance.mTestReplicatorImplPtr, SharedTestData::instance.communicator_in->stringToIdentity(replicatorId));
-
-         string listenerId1("Listener1");
-         SharedTestData::instance.mMockStateListener1Ptr = new MockStateReplicatorListenerImpl();
-         SharedTestData::instance.adapter_in->add(SharedTestData::instance.mMockStateListener1Ptr, SharedTestData::instance.communicator_in->stringToIdentity(listenerId1));
-
-         string listenerId2("Listener2");
-         SharedTestData::instance.mMockStateListener2Ptr = new MockStateReplicatorListenerImpl();
-         SharedTestData::instance.adapter_in->add(SharedTestData::instance.mMockStateListener2Ptr, SharedTestData::instance.communicator_in->stringToIdentity(listenerId2));
-
-         string listenerId3("Listener3");
-         SharedTestData::instance.mMockStateListener3Ptr = new MockStateReplicatorListenerImpl();
-         SharedTestData::instance.adapter_in->add(SharedTestData::instance.mMockStateListener3Ptr, SharedTestData::instance.communicator_in->stringToIdentity(listenerId3));
-
-         SharedTestData::instance.adapter_in->activate();
-
-         // Now that the adapter has been activated, get a local proxy to the replicator. 
-         Ice::ObjectPrx replicatorObjectPrx = SharedTestData::instance.adapter_in->createDirectProxy(SharedTestData::instance.communicator_in->stringToIdentity(replicatorId));
-         SharedTestData::instance.mTestStateReplicatorPrx = TestStateReplicatorPrx::checkedCast(replicatorObjectPrx);
-
-         Ice::ObjectPrx listener1ObjectPrx = SharedTestData::instance.adapter_in->createDirectProxy(SharedTestData::instance.communicator_in->stringToIdentity(listenerId1));
-         SharedTestData::instance.mTestStateListener1Prx = TestStateReplicatorListenerPrx::checkedCast(listener1ObjectPrx);
-
-         Ice::ObjectPrx listener2ObjectPrx = SharedTestData::instance.adapter_in->createDirectProxy(SharedTestData::instance.communicator_in->stringToIdentity(listenerId2));
-         SharedTestData::instance.mTestStateListener2Prx = TestStateReplicatorListenerPrx::checkedCast(listener2ObjectPrx);
-
-         Ice::ObjectPrx listener3ObjectPrx = SharedTestData::instance.adapter_in->createDirectProxy(SharedTestData::instance.communicator_in->stringToIdentity(listenerId3));
-         SharedTestData::instance.mTestStateListener3Prx = TestStateReplicatorListenerPrx::checkedCast(listener3ObjectPrx);
-
-      }
-      catch (const Ice::Exception& ex)
-      {
-	      cerr << ex << endl;
-	      status = 1;
-      }
-      catch (const char* msg)
-      {
-	      cerr << msg << endl;
-	      status = 1;
-      }
-   } // end Fixture() constructor
-
-
-	~GlobalIceFixture()
-   {
-		BOOST_TEST_MESSAGE("Tearing down service discovery test fixture");
-
-
-		if (SharedTestData::instance.communicator_in) 
-      {
-			SharedTestData::instance.communicator_in->shutdown();
-			SharedTestData::instance.communicator_in = 0;
-		}
-		if (SharedTestData::instance.communicator_out) 
-      {
-			SharedTestData::instance.communicator_out->shutdown();
-			SharedTestData::instance.communicator_out = 0;
-		}
-		}
+    GlobalIceFixture()
+    {
+        BOOST_TEST_MESSAGE("Setting up State Replicator test fixture");
+
+        ::boost::debug::detect_memory_leaks(false);
+        ::boost::unit_test::unit_test_log.set_stream( std::cout );
+
+        int status = 0;
+        try
+        {
+            Ice::PropertiesPtr props = Ice::createProperties(mCachedArgs.argc, mCachedArgs.argv);
+            Ice::InitializationData initData;
+            initData.properties = props;
+
+            // NOTE: See the typedef at top of ShareTestData.h to see how the StateReplicator template is invoked.
+
+            // Set up incoming adapter. This is where we'll publish our proxies.
+            SharedTestData::instance.communicator_in = Ice::initialize(initData);
+
+            SharedTestData::instance.adapter_in = SharedTestData::instance.communicator_in->createObjectAdapterWithEndpoints("TestReplicatorAdapterIn", "default -p 10070");
+
+            string replicatorId("TestReplicator");
+            SharedTestData::instance.mTestReplicatorImplPtr = new TestReplicatorImpl();
+            SharedTestData::instance.adapter_in->add(SharedTestData::instance.mTestReplicatorImplPtr, SharedTestData::instance.communicator_in->stringToIdentity(replicatorId));
+
+            string listenerId1("Listener1");
+            SharedTestData::instance.mMockStateListener1Ptr = new MockStateReplicatorListenerImpl();
+            SharedTestData::instance.adapter_in->add(SharedTestData::instance.mMockStateListener1Ptr, SharedTestData::instance.communicator_in->stringToIdentity(listenerId1));
+
+            string listenerId2("Listener2");
+            SharedTestData::instance.mMockStateListener2Ptr = new MockStateReplicatorListenerImpl();
+            SharedTestData::instance.adapter_in->add(SharedTestData::instance.mMockStateListener2Ptr, SharedTestData::instance.communicator_in->stringToIdentity(listenerId2));
+
+            string listenerId3("Listener3");
+            SharedTestData::instance.mMockStateListener3Ptr = new MockStateReplicatorListenerImpl();
+            SharedTestData::instance.adapter_in->add(SharedTestData::instance.mMockStateListener3Ptr, SharedTestData::instance.communicator_in->stringToIdentity(listenerId3));
+
+            SharedTestData::instance.adapter_in->activate();
+
+            // Now that the adapter has been activated, get a local proxy to the replicator.
+            Ice::ObjectPrx replicatorObjectPrx = SharedTestData::instance.adapter_in->createDirectProxy(SharedTestData::instance.communicator_in->stringToIdentity(replicatorId));
+            SharedTestData::instance.mTestStateReplicatorPrx = TestStateReplicatorPrx::checkedCast(replicatorObjectPrx);
+
+            Ice::ObjectPrx listener1ObjectPrx = SharedTestData::instance.adapter_in->createDirectProxy(SharedTestData::instance.communicator_in->stringToIdentity(listenerId1));
+            SharedTestData::instance.mTestStateListener1Prx = TestStateReplicatorListenerPrx::checkedCast(listener1ObjectPrx);
+
+            Ice::ObjectPrx listener2ObjectPrx = SharedTestData::instance.adapter_in->createDirectProxy(SharedTestData::instance.communicator_in->stringToIdentity(listenerId2));
+            SharedTestData::instance.mTestStateListener2Prx = TestStateReplicatorListenerPrx::checkedCast(listener2ObjectPrx);
+
+            Ice::ObjectPrx listener3ObjectPrx = SharedTestData::instance.adapter_in->createDirectProxy(SharedTestData::instance.communicator_in->stringToIdentity(listenerId3));
+            SharedTestData::instance.mTestStateListener3Prx = TestStateReplicatorListenerPrx::checkedCast(listener3ObjectPrx);
+
+        }
+        catch (const Ice::Exception& ex)
+        {
+            cerr << ex << endl;
+            status = 1;
+        }
+        catch (const char* msg)
+        {
+            cerr << msg << endl;
+            status = 1;
+        }
+    } // end Fixture() constructor
+
+
+    ~GlobalIceFixture()
+    {
+        BOOST_TEST_MESSAGE("Tearing down service discovery test fixture");
+
+
+        if (SharedTestData::instance.communicator_in)
+        {
+            SharedTestData::instance.communicator_in->shutdown();
+            SharedTestData::instance.communicator_in = 0;
+        }
+        if (SharedTestData::instance.communicator_out)
+        {
+            SharedTestData::instance.communicator_out->shutdown();
+            SharedTestData::instance.communicator_out = 0;
+        }
+    }
 private:
     int mGlob;
 };
@@ -146,68 +146,68 @@ BOOST_GLOBAL_FIXTURE(GlobalIceFixture);
  */
 int BOOST_TEST_CALL_DECL main( int argc, char* argv[] )
 {
-	mCachedArgs.argc = argc;
-	mCachedArgs.argv = argv;
-	return ::boost::unit_test::unit_test_main( &init_unit_test, argc, argv );
+    mCachedArgs.argc = argc;
+    mCachedArgs.argv = argv;
+    return ::boost::unit_test::unit_test_main( &init_unit_test, argc, argv );
 }
 
 struct PerTestFixture
 {
-public: 
-   PerTestFixture() 
-   {
-	   try
-      {
-         SharedTestData::instance.mMockStateListener1Ptr->reset();
-         SharedTestData::instance.mMockStateListener2Ptr->reset();
-
-         SharedTestData::instance.mTestStateReplicatorPrx->addListener(SharedTestData::instance.mTestStateListener1Prx);
-         SharedTestData::instance.mTestStateReplicatorPrx->addListener(SharedTestData::instance.mTestStateListener2Prx);
-
-         mTestValues.clear();
-
-         TestStateItemFooPtr item1 = new TestStateItemFoo();
-         item1->key = "FooBabar";
-         item1->mFooCount = 12;
-         item1->mFooString = "Baileys";
-         mTestValues.push_back(item1);
-
-         TestStateItemBarPtr item2 = new TestStateItemBar();
-         item2->key = "BarMouse";
-         item2->mBarString = "Ringling";
-         mTestValues.push_back(item2);
-
-         TestStateItemFooPtr item3 = new TestStateItemFoo();
-         item3->key = "FooDumbo";
-         item3->mFooCount = 7;
-         item3->mFooString = "Barnum";
-         mTestValues.push_back(item3);
-
-      }
-      catch (...)
-      {
-         BOOST_TEST_MESSAGE("PerTestFixture failed to initialize.");
-
-         SharedTestData::instance.mTestReplicatorImplPtr->clearListeners();
-         SharedTestData::instance.mTestReplicatorImplPtr->clearState();
-       }
-   }
-
-   ~PerTestFixture()
-   {
-	   try
-      {
-         SharedTestData::instance.mTestReplicatorImplPtr->clearListeners();
-         SharedTestData::instance.mTestReplicatorImplPtr->clearState();
-      }
-      catch (...)
-      {
-         BOOST_TEST_MESSAGE("PerTestFixture failed in shutdown.");
-      }
-   }
+public:
+    PerTestFixture()
+    {
+        try
+        {
+            SharedTestData::instance.mMockStateListener1Ptr->reset();
+            SharedTestData::instance.mMockStateListener2Ptr->reset();
+
+            SharedTestData::instance.mTestStateReplicatorPrx->addListener(SharedTestData::instance.mTestStateListener1Prx);
+            SharedTestData::instance.mTestStateReplicatorPrx->addListener(SharedTestData::instance.mTestStateListener2Prx);
+
+            mTestValues.clear();
+
+            TestStateItemFooPtr item1 = new TestStateItemFoo();
+            item1->key = "FooBabar";
+            item1->mFooCount = 12;
+            item1->mFooString = "Baileys";
+            mTestValues.push_back(item1);
+
+            TestStateItemBarPtr item2 = new TestStateItemBar();
+            item2->key = "BarMouse";
+            item2->mBarString = "Ringling";
+            mTestValues.push_back(item2);
+
+            TestStateItemFooPtr item3 = new TestStateItemFoo();
+            item3->key = "FooDumbo";
+            item3->mFooCount = 7;
+            item3->mFooString = "Barnum";
+            mTestValues.push_back(item3);
+
+        }
+        catch (...)
+        {
+            BOOST_TEST_MESSAGE("PerTestFixture failed to initialize.");
+
+            SharedTestData::instance.mTestReplicatorImplPtr->clearListeners();
+            SharedTestData::instance.mTestReplicatorImplPtr->clearState();
+        }
+    }
+
+    ~PerTestFixture()
+    {
+        try
+        {
+            SharedTestData::instance.mTestReplicatorImplPtr->clearListeners();
+            SharedTestData::instance.mTestReplicatorImplPtr->clearState();
+        }
+        catch (...)
+        {
+            BOOST_TEST_MESSAGE("PerTestFixture failed in shutdown.");
+        }
+    }
 
 public:
-   TestStateItemSeq mTestValues;
+    TestStateItemSeq mTestValues;
 };
 
 /**
@@ -215,37 +215,37 @@ public:
  */
 BOOST_AUTO_TEST_CASE(AddRemoveListeners)
 {
-   bool addListenerSucceeded(true);
-	try
-   {
-      SharedTestData::instance.mTestStateReplicatorPrx->addListener(SharedTestData::instance.mTestStateListener1Prx);
-      SharedTestData::instance.mTestStateReplicatorPrx->addListener(SharedTestData::instance.mTestStateListener2Prx);
-   }
-   catch (...)
-   {
-      addListenerSucceeded = false;
-      BOOST_TEST_MESSAGE("Exception adding Listeners.");
-   }
-
-	BOOST_CHECK(addListenerSucceeded);
-   BOOST_CHECK(SharedTestData::instance.mTestReplicatorImplPtr->getListenerCount() == 2);
-
-   bool removeListenerSucceeded(true);
-	try
-   {
-      SharedTestData::instance.mTestStateReplicatorPrx->removeListener(SharedTestData::instance.mTestStateListener1Prx);
-      SharedTestData::instance.mTestStateReplicatorPrx->removeListener(SharedTestData::instance.mTestStateListener2Prx);
-   }
-   catch (...)
-   {
-      removeListenerSucceeded = false;
-      BOOST_TEST_MESSAGE("Exception removing Listener.");
-   }
-	BOOST_CHECK(removeListenerSucceeded);
-   BOOST_CHECK(SharedTestData::instance.mTestReplicatorImplPtr->getListenerCount() == 0);
-
-
-   BOOST_TEST_MESSAGE("Completed AddRemoveListeners test.");
+    bool addListenerSucceeded(true);
+    try
+    {
+        SharedTestData::instance.mTestStateReplicatorPrx->addListener(SharedTestData::instance.mTestStateListener1Prx);
+        SharedTestData::instance.mTestStateReplicatorPrx->addListener(SharedTestData::instance.mTestStateListener2Prx);
+    }
+    catch (...)
+    {
+        addListenerSucceeded = false;
+        BOOST_TEST_MESSAGE("Exception adding Listeners.");
+    }
+
+    BOOST_CHECK(addListenerSucceeded);
+    BOOST_CHECK(SharedTestData::instance.mTestReplicatorImplPtr->getListenerCount() == 2);
+
+    bool removeListenerSucceeded(true);
+    try
+    {
+        SharedTestData::instance.mTestStateReplicatorPrx->removeListener(SharedTestData::instance.mTestStateListener1Prx);
+        SharedTestData::instance.mTestStateReplicatorPrx->removeListener(SharedTestData::instance.mTestStateListener2Prx);
+    }
+    catch (...)
+    {
+        removeListenerSucceeded = false;
+        BOOST_TEST_MESSAGE("Exception removing Listener.");
+    }
+    BOOST_CHECK(removeListenerSucceeded);
+    BOOST_CHECK(SharedTestData::instance.mTestReplicatorImplPtr->getListenerCount() == 0);
+
+
+    BOOST_TEST_MESSAGE("Completed AddRemoveListeners test.");
 }
 
 /**
@@ -253,31 +253,31 @@ BOOST_AUTO_TEST_CASE(AddRemoveListeners)
  */
 BOOST_FIXTURE_TEST_CASE(PushData, PerTestFixture)
 {
-	try
-   {
-      SharedTestData::instance.mTestStateReplicatorPrx->setState(mTestValues);
-
-   }
-   catch(const IceUtil::Exception &ie)
-   {
-      bool IceException(false);
-      string msg = "Exception pushing state data.";
-      msg += ie.what();
-      BOOST_TEST_MESSAGE(msg);
-      BOOST_CHECK(IceException);
-   }
-   catch (...)
-   {
-      bool unknownException(false);
-      BOOST_CHECK(unknownException);
-   }
-
-   BOOST_CHECK(SharedTestData::instance.mMockStateListener1Ptr->mStateItems.size() == 3);
-   BOOST_CHECK(SharedTestData::instance.mMockStateListener2Ptr->mStateItems.size() == 3);
-
-   BOOST_CHECK(SharedTestData::instance.mMockStateListener1Ptr->mStateItems.front()->key == "FooBabar");
- 
-   BOOST_TEST_MESSAGE("Completed PushData test.");
+    try
+    {
+        SharedTestData::instance.mTestStateReplicatorPrx->setState(mTestValues);
+
+    }
+    catch(const IceUtil::Exception &ie)
+    {
+        bool IceException(false);
+        string msg = "Exception pushing state data.";
+        msg += ie.what();
+        BOOST_TEST_MESSAGE(msg);
+        BOOST_CHECK(IceException);
+    }
+    catch (...)
+    {
+        bool unknownException(false);
+        BOOST_CHECK(unknownException);
+    }
+
+    BOOST_CHECK(SharedTestData::instance.mMockStateListener1Ptr->mStateItems.size() == 3);
+    BOOST_CHECK(SharedTestData::instance.mMockStateListener2Ptr->mStateItems.size() == 3);
+
+    BOOST_CHECK(SharedTestData::instance.mMockStateListener1Ptr->mStateItems.front()->key == "FooBabar");
+
+    BOOST_TEST_MESSAGE("Completed PushData test.");
 
 }
 
@@ -286,83 +286,83 @@ BOOST_FIXTURE_TEST_CASE(PushData, PerTestFixture)
  */
 BOOST_FIXTURE_TEST_CASE(ForwardRemoveState, PerTestFixture)
 {
-   TestStateItemSeq retrievedValues;
-
-	try
-   {
-      SharedTestData::instance.mTestStateReplicatorPrx->setState(mTestValues);
-      // {FooBabar, BarMouse, FooDumbo} 
-
-      Ice::StringSeq keys;
-      keys.push_back("FooBabar");
-      keys.push_back("FooDumbo");
-
-      SharedTestData::instance.mTestStateReplicatorPrx->removeState(keys);
-   }
-   catch(const IceUtil::Exception &ie)
-   {
-      bool IceException(false);
-      string msg = "Exception removing state data.";
-      msg += ie.what();
-      BOOST_TEST_MESSAGE(msg);
-      BOOST_CHECK(IceException);
-   }
-   catch (...)
-   {
-      bool unknownException(false);
-      BOOST_CHECK(unknownException);
-   }
-
-   BOOST_CHECK(SharedTestData::instance.mMockStateListener1Ptr->mItemKeys.size() == 2);
-   BOOST_CHECK(SharedTestData::instance.mMockStateListener2Ptr->mItemKeys.size() == 2);
-
-   BOOST_CHECK(SharedTestData::instance.mMockStateListener1Ptr->mItemKeys.front() == "FooBabar");
- 
-   BOOST_TEST_MESSAGE("Completed ForwardRemoveState test.");
+    TestStateItemSeq retrievedValues;
+
+    try
+    {
+        SharedTestData::instance.mTestStateReplicatorPrx->setState(mTestValues);
+        // {FooBabar, BarMouse, FooDumbo}
+
+        Ice::StringSeq keys;
+        keys.push_back("FooBabar");
+        keys.push_back("FooDumbo");
+
+        SharedTestData::instance.mTestStateReplicatorPrx->removeState(keys);
+    }
+    catch(const IceUtil::Exception &ie)
+    {
+        bool IceException(false);
+        string msg = "Exception removing state data.";
+        msg += ie.what();
+        BOOST_TEST_MESSAGE(msg);
+        BOOST_CHECK(IceException);
+    }
+    catch (...)
+    {
+        bool unknownException(false);
+        BOOST_CHECK(unknownException);
+    }
+
+    BOOST_CHECK(SharedTestData::instance.mMockStateListener1Ptr->mItemKeys.size() == 2);
+    BOOST_CHECK(SharedTestData::instance.mMockStateListener2Ptr->mItemKeys.size() == 2);
+
+    BOOST_CHECK(SharedTestData::instance.mMockStateListener1Ptr->mItemKeys.front() == "FooBabar");
+
+    BOOST_TEST_MESSAGE("Completed ForwardRemoveState test.");
 
 }
 
 /**
- * Test removing state. Also tests retrieving all the state. 
+ * Test removing state. Also tests retrieving all the state.
  */
 BOOST_FIXTURE_TEST_CASE(RemoveState, PerTestFixture)
 {
-   TestStateItemSeq retrievedValues;
-
-	try
-   {
-      // Set the basic 3 items of state. 
-      // {FooBabar, BarMouse, FooDumbo} 
-      SharedTestData::instance.mTestStateReplicatorPrx->setState(mTestValues);
-
-      // Try removing two of them.
-      Ice::StringSeq keys;
-      keys.push_back("FooBabar");
-      keys.push_back("FooDumbo");
-
-      SharedTestData::instance.mTestStateReplicatorPrx->removeState(keys);
-
-      retrievedValues = SharedTestData::instance.mTestStateReplicatorPrx->getAllState();
-   }
-   catch(const IceUtil::Exception &ie)
-   {
-      bool IceException(false);
-      string msg = "Exception removing state data.";
-      msg += ie.what();
-      BOOST_TEST_MESSAGE(msg);
-      BOOST_CHECK(IceException);
-   }
-   catch (...)
-   {
-      bool unknownException(false);
-      BOOST_CHECK(unknownException);
-   }
-
-   BOOST_CHECK(retrievedValues.size() == 1);
-
-   BOOST_CHECK(retrievedValues.front()->key == "BarMouse");
- 
-   BOOST_TEST_MESSAGE("Completed RemoveState test.");
+    TestStateItemSeq retrievedValues;
+
+    try
+    {
+        // Set the basic 3 items of state.
+        // {FooBabar, BarMouse, FooDumbo}
+        SharedTestData::instance.mTestStateReplicatorPrx->setState(mTestValues);
+
+        // Try removing two of them.
+        Ice::StringSeq keys;
+        keys.push_back("FooBabar");
+        keys.push_back("FooDumbo");
+
+        SharedTestData::instance.mTestStateReplicatorPrx->removeState(keys);
+
+        retrievedValues = SharedTestData::instance.mTestStateReplicatorPrx->getAllState();
+    }
+    catch(const IceUtil::Exception &ie)
+    {
+        bool IceException(false);
+        string msg = "Exception removing state data.";
+        msg += ie.what();
+        BOOST_TEST_MESSAGE(msg);
+        BOOST_CHECK(IceException);
+    }
+    catch (...)
+    {
+        bool unknownException(false);
+        BOOST_CHECK(unknownException);
+    }
+
+    BOOST_CHECK(retrievedValues.size() == 1);
+
+    BOOST_CHECK(retrievedValues.front()->key == "BarMouse");
+
+    BOOST_TEST_MESSAGE("Completed RemoveState test.");
 }
 
 /**
@@ -370,38 +370,38 @@ BOOST_FIXTURE_TEST_CASE(RemoveState, PerTestFixture)
  */
 BOOST_FIXTURE_TEST_CASE(GetSomeState, PerTestFixture)
 {
-   TestStateItemSeq retrievedValues;
-
-	try
-   {
-      SharedTestData::instance.mTestStateReplicatorPrx->setState(mTestValues);
-      // {FooBabar, BarMouse, FooDumbo} 
-
-      Ice::StringSeq keys;
-      keys.push_back("FooBabar");
-      keys.push_back("FooDumbo");
-
-      retrievedValues = SharedTestData::instance.mTestStateReplicatorPrx->getState(keys);
-   }
-   catch(const IceUtil::Exception &ie)
-   {
-      bool IceException(false);
-      string msg = "Exception getting partial state data.";
-      msg += ie.what();
-      BOOST_TEST_MESSAGE(msg);
-      BOOST_CHECK(IceException);
-   }
-   catch (...)
-   {
-      bool unknownException(false);
-      BOOST_CHECK(unknownException);
-   }
-
-   BOOST_CHECK(retrievedValues.size() == 2);
-
-   BOOST_CHECK(retrievedValues.front()->key == "FooBabar");
- 
-   BOOST_TEST_MESSAGE("Completed GetSomeState test.");
+    TestStateItemSeq retrievedValues;
+
+    try
+    {
+        SharedTestData::instance.mTestStateReplicatorPrx->setState(mTestValues);
+        // {FooBabar, BarMouse, FooDumbo}
+
+        Ice::StringSeq keys;
+        keys.push_back("FooBabar");
+        keys.push_back("FooDumbo");
+
+        retrievedValues = SharedTestData::instance.mTestStateReplicatorPrx->getState(keys);
+    }
+    catch(const IceUtil::Exception &ie)
+    {
+        bool IceException(false);
+        string msg = "Exception getting partial state data.";
+        msg += ie.what();
+        BOOST_TEST_MESSAGE(msg);
+        BOOST_CHECK(IceException);
+    }
+    catch (...)
+    {
+        bool unknownException(false);
+        BOOST_CHECK(unknownException);
+    }
+
+    BOOST_CHECK(retrievedValues.size() == 2);
+
+    BOOST_CHECK(retrievedValues.front()->key == "FooBabar");
+
+    BOOST_TEST_MESSAGE("Completed GetSomeState test.");
 }
 
 /**
@@ -409,77 +409,77 @@ BOOST_FIXTURE_TEST_CASE(GetSomeState, PerTestFixture)
  */
 BOOST_FIXTURE_TEST_CASE(PreserveOrder, PerTestFixture)
 {
-   TestStateItemSeq retrievedValues;
-
-	try
-   {
-      SharedTestData::instance.mTestStateReplicatorPrx->setState(mTestValues);
-
-      // {FooBabar, BarMouse, FooDumbo} 
-      Ice::StringSeq keys;
-      keys.push_back("BarMouse");
-      SharedTestData::instance.mTestStateReplicatorPrx->removeState(keys);
-      // {FooBabar, FooDumbo} 
-
-      TestStateItemSeq moreItems;
-      TestStateItemBarPtr item1 = new TestStateItemBar();
-      item1->key = "Extra";
-      moreItems.push_back(item1);
-
-      // Re-add BarMouse
-      TestStateItemBarPtr item2 = new TestStateItemBar();
-      item2->key = "BarMouse";
-      moreItems.push_back(item2);
-
-      SharedTestData::instance.mTestStateReplicatorPrx->setState(moreItems);
-      // {FooBabar, FooDumbo, Extra, BarMouse} 
-
-      retrievedValues = SharedTestData::instance.mTestStateReplicatorPrx->getAllState();
-   }
-   catch(const IceUtil::Exception &ie)
-   {
-      bool IceException(false);
-      string msg = "Exception altering state data.";
-      msg += ie.what();
-      BOOST_TEST_MESSAGE(msg);
-      BOOST_CHECK(IceException);
-   }
-   catch (...)
-   {
-      bool unknownException(false);
-      BOOST_CHECK(unknownException);
-   }
-
-   BOOST_CHECK(retrievedValues.size() == 4);
-
-   BOOST_CHECK(retrievedValues[0]->key == "FooBabar");
-   BOOST_CHECK(retrievedValues[1]->key == "FooDumbo");
-   BOOST_CHECK(retrievedValues[2]->key == "Extra");
-   BOOST_CHECK(retrievedValues[3]->key == "BarMouse");
-
-   try
-   {
-      //Insure that a late joiner is pushed the correct current state, in correct order.
-      SharedTestData::instance.mTestStateReplicatorPrx->addListener(SharedTestData::instance.mTestStateListener3Prx);
-
-      // NOTE: This test currently is reliable only because we are NOT doing asynchronous sends to the listeners. 
-      // Will need a delay when asynch.
-      BOOST_CHECK(SharedTestData::instance.mMockStateListener3Ptr->mStateItems.size() == 4);
-
-      BOOST_CHECK(SharedTestData::instance.mMockStateListener3Ptr->mStateItems[0]->key == "FooBabar");
-      BOOST_CHECK(SharedTestData::instance.mMockStateListener3Ptr->mStateItems[1]->key == "FooDumbo");
-      BOOST_CHECK(SharedTestData::instance.mMockStateListener3Ptr->mStateItems[2]->key == "Extra");
-      BOOST_CHECK(SharedTestData::instance.mMockStateListener3Ptr->mStateItems[3]->key == "BarMouse");
-   }
-   catch(const IceUtil::Exception &ie)
-   {
-      bool IceException(false);
-      string msg = "Exception adding a late listener.";
-      msg += ie.what();
-      BOOST_TEST_MESSAGE(msg);
-      BOOST_CHECK(IceException);
-   }
-
-   BOOST_TEST_MESSAGE("Completed PreserveOrder test.");
+    TestStateItemSeq retrievedValues;
+
+    try
+    {
+        SharedTestData::instance.mTestStateReplicatorPrx->setState(mTestValues);
+
+        // {FooBabar, BarMouse, FooDumbo}
+        Ice::StringSeq keys;
+        keys.push_back("BarMouse");
+        SharedTestData::instance.mTestStateReplicatorPrx->removeState(keys);
+        // {FooBabar, FooDumbo}
+
+        TestStateItemSeq moreItems;
+        TestStateItemBarPtr item1 = new TestStateItemBar();
+        item1->key = "Extra";
+        moreItems.push_back(item1);
+
+        // Re-add BarMouse
+        TestStateItemBarPtr item2 = new TestStateItemBar();
+        item2->key = "BarMouse";
+        moreItems.push_back(item2);
+
+        SharedTestData::instance.mTestStateReplicatorPrx->setState(moreItems);
+        // {FooBabar, FooDumbo, Extra, BarMouse}
+
+        retrievedValues = SharedTestData::instance.mTestStateReplicatorPrx->getAllState();
+    }
+    catch(const IceUtil::Exception &ie)
+    {
+        bool IceException(false);
+        string msg = "Exception altering state data.";
+        msg += ie.what();
+        BOOST_TEST_MESSAGE(msg);
+        BOOST_CHECK(IceException);
+    }
+    catch (...)
+    {
+        bool unknownException(false);
+        BOOST_CHECK(unknownException);
+    }
+
+    BOOST_CHECK(retrievedValues.size() == 4);
+
+    BOOST_CHECK(retrievedValues[0]->key == "FooBabar");
+    BOOST_CHECK(retrievedValues[1]->key == "FooDumbo");
+    BOOST_CHECK(retrievedValues[2]->key == "Extra");
+    BOOST_CHECK(retrievedValues[3]->key == "BarMouse");
+
+    try
+    {
+        //Insure that a late joiner is pushed the correct current state, in correct order.
+        SharedTestData::instance.mTestStateReplicatorPrx->addListener(SharedTestData::instance.mTestStateListener3Prx);
+
+        // NOTE: This test currently is reliable only because we are NOT doing asynchronous sends to the listeners.
+        // Will need a delay when asynch.
+        BOOST_CHECK(SharedTestData::instance.mMockStateListener3Ptr->mStateItems.size() == 4);
+
+        BOOST_CHECK(SharedTestData::instance.mMockStateListener3Ptr->mStateItems[0]->key == "FooBabar");
+        BOOST_CHECK(SharedTestData::instance.mMockStateListener3Ptr->mStateItems[1]->key == "FooDumbo");
+        BOOST_CHECK(SharedTestData::instance.mMockStateListener3Ptr->mStateItems[2]->key == "Extra");
+        BOOST_CHECK(SharedTestData::instance.mMockStateListener3Ptr->mStateItems[3]->key == "BarMouse");
+    }
+    catch(const IceUtil::Exception &ie)
+    {
+        bool IceException(false);
+        string msg = "Exception adding a late listener.";
+        msg += ie.what();
+        BOOST_TEST_MESSAGE(msg);
+        BOOST_CHECK(IceException);
+    }
+
+    BOOST_TEST_MESSAGE("Completed PreserveOrder test.");
 
 }

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


-- 
asterisk-scf/integration/ice-util-c++.git



More information about the asterisk-scf-commits mailing list