[asterisk-scf-commits] asterisk-scf/integration/routing.git branch "retry_deux" updated.

Commits to the Asterisk SCF project code repositories asterisk-scf-commits at lists.digium.com
Fri Mar 2 11:10:45 CST 2012


branch "retry_deux" has been updated
       via  11b242156f34537cfcf565e7a632fdaf52d7b49d (commit)
      from  a2252b0f78faa1788402547fbe9022d00b12f0f1 (commit)

Summary of changes:
 .../BasicRoutingStateReplicationIf.ice             |    4 +-
 src/BasicRoutingStateReplicatorApp.cpp             |   16 ++--
 src/Component.cpp                                  |    4 +-
 src/EndpointRegistry.cpp                           |    6 +-
 src/OperationReplicaCache.cpp                      |    1 +
 src/RoutingServiceEventPublisher.cpp               |    4 +-
 src/RoutingServiceEventPublisher.h                 |    1 +
 src/RoutingStateReplicatorListener.cpp             |    7 +-
 test/MockBridge.cpp                                |    6 +-
 test/MockSession.cpp                               |    6 +-
 test/TestRouting.cpp                               |   70 ++++++++++----------
 11 files changed, 63 insertions(+), 62 deletions(-)
 mode change 100644 => 100755 src/BasicRoutingStateReplicatorApp.cpp
 mode change 100644 => 100755 src/OperationReplicaCache.cpp
 mode change 100644 => 100755 src/RoutingServiceEventPublisher.cpp
 mode change 100644 => 100755 src/RoutingServiceEventPublisher.h
 mode change 100644 => 100755 src/RoutingStateReplicatorListener.cpp


- Log -----------------------------------------------------------------
commit 11b242156f34537cfcf565e7a632fdaf52d7b49d
Author: Brent Eagles <beagles at digium.com>
Date:   Fri Mar 2 13:40:17 2012 -0330

    Slice sync/build fixes.

diff --git a/slice/AsteriskSCF/Replication/BasicRoutingService/BasicRoutingStateReplicationIf.ice b/slice/AsteriskSCF/Replication/BasicRoutingService/BasicRoutingStateReplicationIf.ice
index 22a1282..790b20a 100755
--- a/slice/AsteriskSCF/Replication/BasicRoutingService/BasicRoutingStateReplicationIf.ice
+++ b/slice/AsteriskSCF/Replication/BasicRoutingService/BasicRoutingStateReplicationIf.ice
@@ -72,8 +72,8 @@ module V1
      */
     interface RoutingStateReplicator
     {
-       idempotent void addListener(RoutingStateReplicatorListener *listener);
-       idempotent void removeListener(RoutingStateReplicatorListener *listener);
+       idempotent void addListener(AsteriskSCF::System::V1::OperationContext operationContext, RoutingStateReplicatorListener *listener);
+       idempotent void removeListener(AsteriskSCF::System::V1::OperationContext operationContext, RoutingStateReplicatorListener *listener);
        idempotent void setState (AsteriskSCF::System::V1::OperationContext operationContext, RoutingStateItemSeq items);
        idempotent void removeState(AsteriskSCF::System::V1::OperationContext operationContext, Ice::StringSeq items);
        idempotent void removeStateForItems(AsteriskSCF::System::V1::OperationContext operationContext, RoutingStateItemSeq items); 
diff --git a/src/BasicRoutingStateReplicatorApp.cpp b/src/BasicRoutingStateReplicatorApp.cpp
old mode 100644
new mode 100755
index 7697713..dee2c92
--- a/src/BasicRoutingStateReplicatorApp.cpp
+++ b/src/BasicRoutingStateReplicatorApp.cpp
@@ -107,17 +107,17 @@ public:
     ComponentServiceImpl(BasicRoutingStateReplicatorService* service) : mService(service) {}
 
 public: // Overrides of the ComponentService interface.
-    virtual void suspend(const ::Ice::Current&)
+    virtual void suspend(const AsteriskSCF::System::V1::OperationContextPtr&, const ::Ice::Current&)
     {
         mService->suspend();
     }
 
-    virtual void resume(const ::Ice::Current&)
+    virtual void resume(const AsteriskSCF::System::V1::OperationContextPtr&, const ::Ice::Current&)
     {
         mService->resume();
     }
 
-    virtual void shutdown(const ::Ice::Current&)
+    virtual void shutdown(const AsteriskSCF::System::V1::OperationContextPtr&, const ::Ice::Current&)
     {
         mService->stop();
     }
@@ -157,11 +157,11 @@ void BasicRoutingStateReplicatorService::registerWithServiceLocator()
         // Add our ComponentService interface and add it to the Service Locator.
         // Note that this interface has its own adapter.
         string componentServiceGuid(StateReplicatorComponentCategory);
-        mComponentServiceManagement = mServiceLocatorManagement->addService(mComponentServicePrx, componentServiceGuid);
+        mComponentServiceManagement = mServiceLocatorManagement->addService(AsteriskSCF::Operations::createContext(), mComponentServicePrx, componentServiceGuid);
         setCategory(mComponentServiceManagement,  StateReplicatorComponentCategory, serviceName);
 
         // Add our Replicator interface and add it to the Service Locator.
-        mStateReplicationManagement = mServiceLocatorManagement->addService(mStateReplicatorPrx, StateReplicatorDiscoveryCategory);
+        mStateReplicationManagement = mServiceLocatorManagement->addService(AsteriskSCF::Operations::createContext(), mStateReplicatorPrx, StateReplicatorDiscoveryCategory);
 
         string replicatorName = mAppName;
 	setCategory(mStateReplicationManagement, StateReplicatorDiscoveryCategory, serviceName, replicatorName);
@@ -186,11 +186,11 @@ void BasicRoutingStateReplicatorService::deregisterFromServiceLocator(bool inclu
 {
     try
     {
-        mStateReplicationManagement->unregister();
+        mStateReplicationManagement->unregister(AsteriskSCF::Operations::createContext());
 
         if (includeBackplane)
         {
-            mComponentServiceManagement->unregister();
+            mComponentServiceManagement->unregister(AsteriskSCF::Operations::createContext());
         }
     }
     catch(...)
@@ -311,7 +311,7 @@ void BasicRoutingStateReplicatorService::stop()
     suspendService(true);
 
     // Just in case we were in suspend() mode when told to stop.
-    mComponentServiceManagement->unregister();
+    mComponentServiceManagement->unregister(AsteriskSCF::Operations::createContext());
 
 
     lg(Info) << "Stopped.";
diff --git a/src/Component.cpp b/src/Component.cpp
index fbd60a2..1f0004f 100644
--- a/src/Component.cpp
+++ b/src/Component.cpp
@@ -151,7 +151,7 @@ void Component::listenToStateReplicators()
         // Are we in standby mode?
         if (routingReplicationContext->getState() == STANDBY_IN_REPLICA_GROUP)
         {
-            routingReplicationContext->getReplicator().tryOneWay()->addListener(mReplicatorListenerProxy);
+            routingReplicationContext->getReplicator().tryOneWay()->addListener(AsteriskSCF::Operations::createContext(), mReplicatorListenerProxy);
             mListeningToReplicator = true;
         }
     }
@@ -180,7 +180,7 @@ void Component::stopListeningToStateReplicators()
 
     try
     {
-        routingReplicationContext->getReplicator().tryOneWay()->removeListener(mReplicatorListenerProxy);
+        routingReplicationContext->getReplicator().tryOneWay()->removeListener(AsteriskSCF::Operations::createContext(), mReplicatorListenerProxy);
         mListeningToReplicator = false;
     }
     catch (const Ice::Exception& e)
diff --git a/src/EndpointRegistry.cpp b/src/EndpointRegistry.cpp
index be6b387..364decc 100644
--- a/src/EndpointRegistry.cpp
+++ b/src/EndpointRegistry.cpp
@@ -327,7 +327,7 @@ public:
             lg(Debug) << "EndpointRegistry::lookup() found Endpoint for destination " << mDestination;
           
             // Post event
-            mEventPublisher->lookupEvent(mDestination, Event::SUCCESS);
+            mEventPublisher->lookupEvent(AsteriskSCF::Operations::createContext(), mDestination, Event::SUCCESS);
         }
 
         assert(mNumVotes > 0);
@@ -357,7 +357,7 @@ public:
         mCallback = 0;
 
         // Post event
-        mEventPublisher->lookupEvent(mDestination, Event::FAILURE);
+        mEventPublisher->lookupEvent(AsteriskSCF::Operations::createContext(), mDestination, Event::FAILURE);
 
         lg(Debug) << "EndpointRegistry::lookup() failed to find destination " << mDestination;
     }
@@ -398,7 +398,7 @@ void EndpointRegistry::lookup_async(const ::AsteriskSCF::Core::Routing::V1::AMD_
     {
         if (!mImpl->mScriptProcessor->confirmLookup(destination, modifiedDestination))
         {
-            mImpl->mEventPublisher->lookupEvent(destination, Event::FAILURE);
+            mImpl->mEventPublisher->lookupEvent(AsteriskSCF::Operations::createContext(), destination, Event::FAILURE);
 
             lg(Error) << "lookup(): denied by confirmLookup() script.";
             amdcallback->ice_response(endpoints);
diff --git a/src/OperationReplicaCache.cpp b/src/OperationReplicaCache.cpp
old mode 100644
new mode 100755
index 56c22e6..066be7c
--- a/src/OperationReplicaCache.cpp
+++ b/src/OperationReplicaCache.cpp
@@ -14,6 +14,7 @@
  * at the top of the source tree.
  */
 #include <boost/thread/locks.hpp>
+#include <boost/thread.hpp> // XXX for weird windows build issue, revisit
 
 #include <AsteriskSCF/Threading/WorkQueue.h>
 
diff --git a/src/RoutingServiceEventPublisher.cpp b/src/RoutingServiceEventPublisher.cpp
old mode 100644
new mode 100755
index a14f5f1..6794a8e
--- a/src/RoutingServiceEventPublisher.cpp
+++ b/src/RoutingServiceEventPublisher.cpp
@@ -156,7 +156,7 @@ RoutingServiceEventPublisher::RoutingServiceEventPublisher(const Ice::ObjectAdap
  * Send a message to the service's event topic to report a lookup event.
  */
 void RoutingServiceEventPublisher::lookupEvent(
-    const std::string& destination,
+    const AsteriskSCF::System::V1::OperationContextPtr&, const std::string& destination,
     AsteriskSCF::Core::Routing::V1::Event::OperationResult result, const Ice::Current &)
 {
     if (!mImpl->isInitialized())
@@ -166,7 +166,7 @@ void RoutingServiceEventPublisher::lookupEvent(
 
     try
     {
-        mImpl->mEventTopic->lookupEvent(destination, result);
+        mImpl->mEventTopic->lookupEvent(AsteriskSCF::Operations::createContext(), destination, result);
     }
     catch(const Ice::Exception &e)
     {
diff --git a/src/RoutingServiceEventPublisher.h b/src/RoutingServiceEventPublisher.h
old mode 100644
new mode 100755
index 77158e6..73e4791
--- a/src/RoutingServiceEventPublisher.h
+++ b/src/RoutingServiceEventPublisher.h
@@ -45,6 +45,7 @@ public:
      *  @param result Informs event listeners of the operations success or failure.
      */
     void lookupEvent(
+        const AsteriskSCF::System::V1::OperationContextPtr&,
         const std::string& destination, 
         AsteriskSCF::Core::Routing::V1::Event::OperationResult result,
         const Ice::Current&);
diff --git a/src/RoutingStateReplicatorListener.cpp b/src/RoutingStateReplicatorListener.cpp
old mode 100644
new mode 100755
index 59e1257..1b12b11
--- a/src/RoutingStateReplicatorListener.cpp
+++ b/src/RoutingStateReplicatorListener.cpp
@@ -14,12 +14,13 @@
  * at the top of the source tree.
  */
 
-#include <IceUtil/UUID.h>
+#include <boost/thread.hpp> // XXX for weird windows build issue, revisit
+#include <boost/thread/locks.hpp>
+#include <AsteriskSCF/Operations/OperationContextCache.h>
 
-#include <boost/thread.hpp>
+#include <IceUtil/UUID.h>
 
 #include <AsteriskSCF/Logger.h>
-#include <AsteriskSCF/Operations/OperationContextCache.h>
 
 #include "RoutingStateReplicatorListener.h"
 #include "OperationReplicaCache.h"
diff --git a/test/MockBridge.cpp b/test/MockBridge.cpp
index 48eb970..371c938 100644
--- a/test/MockBridge.cpp
+++ b/test/MockBridge.cpp
@@ -132,7 +132,7 @@ void MockBridge::removeSession(const SessionPrx& session)
             break;
         }
     }
-    session->removeBridge(mListenerPrx);
+    session->removeBridge(AsteriskSCF::Operations::createContext(), mListenerPrx);
 }
 
 SessionSeq MockBridge::listSessions(const Ice::Current&)
@@ -172,7 +172,7 @@ void MockBridge::replaceSession_async(const AsteriskSCF::SessionCommunications::
         addSessionsImpl(newSessions);
 
         ResponseCodePtr response = new ResponseCode(1);
-        sessionToReplace->stop(response);
+        sessionToReplace->stop(AsteriskSCF::Operations::createContext(), response);
         cb->ice_response();
     }
     catch (const std::exception& ex)
@@ -210,7 +210,7 @@ void MockBridge::addSessionsImpl(const AsteriskSCF::SessionCommunications::V1::S
 
     for (SessionSeq::const_iterator s = newSessions.begin(); s != newSessions.end(); ++s)
     {
-        (*s)->setBridge(mBridgePrx, mListenerPrx);
+        (*s)->setBridge(AsteriskSCF::Operations::createContext(), mBridgePrx, mListenerPrx);
     }
 }
 
diff --git a/test/MockSession.cpp b/test/MockSession.cpp
index decc761..aedd236 100644
--- a/test/MockSession.cpp
+++ b/test/MockSession.cpp
@@ -47,7 +47,7 @@ public:
     {
 	AsteriskSCF::SessionCommunications::V1::StoppedIndicationPtr stopped(new  AsteriskSCF::SessionCommunications::V1::StoppedIndication());
 	stopped->response = mResponse;
-	l->indicated(new OperationContext(::IceUtil::generateUUID()), mMyProxy, stopped, AsteriskSCF::SessionCommunications::V1::SessionCookies());
+	l->indicated(new OperationContext(AsteriskSCF::Operations::createContext()), mMyProxy, stopped, AsteriskSCF::SessionCommunications::V1::SessionCookies());
     }
 
 private:
@@ -136,7 +136,7 @@ void MockSession::indicate_async(
     {
 	for(vector<SessionListenerPrx>::iterator i = mListeners.begin(); i != mListeners.end(); ++i)
 	{
-	    (*i)->indicated(new OperationContext(::IceUtil::generateUUID()), mMyPrx, new AsteriskSCF::SessionCommunications::V1::ConnectedIndication(), AsteriskSCF::SessionCommunications::V1::SessionCookies());
+	    (*i)->indicated(AsteriskSCF::Operations::createContext(), mMyPrx, new AsteriskSCF::SessionCommunications::V1::ConnectedIndication(), AsteriskSCF::SessionCommunications::V1::SessionCookies());
 	}
     }
     cb->ice_response();
@@ -183,7 +183,7 @@ void MockSession::start(const Ice::Current&)
     for(vector<SessionListenerPrx>::iterator i = mListeners.begin(); i != mListeners.end(); ++i)
     {
         // Auto-answer!
-	(*i)->indicated(new OperationContext(::IceUtil::generateUUID()), mMyPrx, new AsteriskSCF::SessionCommunications::V1::ConnectedIndication(), AsteriskSCF::SessionCommunications::V1::SessionCookies());
+	(*i)->indicated(new OperationContext(AsteriskSCF::Operations::createContext(), mMyPrx, new AsteriskSCF::SessionCommunications::V1::ConnectedIndication(), AsteriskSCF::SessionCommunications::V1::SessionCookies());
     }
 }
 
diff --git a/test/TestRouting.cpp b/test/TestRouting.cpp
index 95f44b9..ed56162 100644
--- a/test/TestRouting.cpp
+++ b/test/TestRouting.cpp
@@ -156,7 +156,7 @@ struct GlobalIceFixture
 
             // Note: This would be done by Pacemaker-initiated script in the real system. Something
             // external must activate one of the sevice instances. 
-            SharedTestData::instance.serviceReplicaMgmt->activate();
+            SharedTestData::instance.serviceReplicaMgmt->activate(AsteriskSCF::Operations::createContext());
 
             // Get a ref to the Replica interface and cache it for testing.
             Ice::ObjectPrx replicaObj2 = SharedTestData::instance.communicatorOut->propertyToProxy("BackupReplica.Proxy");
@@ -207,7 +207,7 @@ struct GlobalIceFixture
                SharedTestData::instance.communicatorIn->getProperties()->getProperty("BridgeManager.ServiceLocatorId")));
         BridgeManagerPrx bridgeManagerPrx = BridgeManagerPrx::checkedCast(bridgeManagerObject);
         ServiceManagementPrx management = ServiceManagementPrx::uncheckedCast(
-            SharedTestData::instance.serviceLocatorManagement->addService(bridgeManagerPrx, "BridgeService"));
+            SharedTestData::instance.serviceLocatorManagement->addService(AsteriskSCF::Operations::createContext(), bridgeManagerPrx, "BridgeService"));
 
 
         std::string serviceName =SharedTestData::instance.communicatorIn->getProperties()->getPropertyWithDefault(
@@ -251,9 +251,9 @@ public:
             BOOST_TEST_MESSAGE("PerTestFixture ctor entered.");
             PopulateEndpoints();
 
-            SharedTestData::instance.componentTest->clearTestModes();
+            SharedTestData::instance.componentTest->clearTestModes(AsteriskSCF::Operations::createContext());
 
-            SharedTestData::instance.locatorRegistry->addEndpointLocator("TestChannel", SharedTestData::instance.regExIds, SharedTestData::instance.endpointLocatorPrx);
+            SharedTestData::instance.locatorRegistry->addEndpointLocator(AsteriskSCF::Operations::createContext(), "TestChannel", SharedTestData::instance.regExIds, SharedTestData::instance.endpointLocatorPrx);
             BOOST_TEST_MESSAGE("PerTestFixture ctor done.");
         }
         catch (...)
@@ -267,7 +267,7 @@ public:
         try
         {
             BOOST_TEST_MESSAGE("PerTestFixture destructor entered.");
-            SharedTestData::instance.locatorRegistry->removeEndpointLocator("TestChannel");
+            SharedTestData::instance.locatorRegistry->removeEndpointLocator(AsteriskSCF::Operations::createContext(), "TestChannel");
             BOOST_TEST_MESSAGE("PerTestFixture destructor....removeEndpointLocator() done.");
             SharedTestData::instance.endpointLocator->perTestCleanup();
             BOOST_TEST_MESSAGE("PerTestFixture destructor done.");
@@ -307,7 +307,7 @@ BOOST_AUTO_TEST_CASE(AddAndRemoveEndpointLocator)
 {
     try
     {
-        SharedTestData::instance.locatorRegistry->addEndpointLocator("TestChannel", SharedTestData::instance.regExIds, SharedTestData::instance.endpointLocatorPrx);
+        SharedTestData::instance.locatorRegistry->addEndpointLocator(AsteriskSCF::Operations::createContext(), "TestChannel", SharedTestData::instance.regExIds, SharedTestData::instance.endpointLocatorPrx);
     }
     catch (...)
     {
@@ -316,7 +316,7 @@ BOOST_AUTO_TEST_CASE(AddAndRemoveEndpointLocator)
 
     try
     {
-        SharedTestData::instance.locatorRegistry->removeEndpointLocator("TestChannel");
+        SharedTestData::instance.locatorRegistry->removeEndpointLocator(AsteriskSCF::Operations::createContext(), "TestChannel");
     }
     catch (...)
     {
@@ -333,8 +333,8 @@ BOOST_AUTO_TEST_CASE(AddEndpointLocatorTwice)
 {
     try
     {
-        SharedTestData::instance.locatorRegistry->addEndpointLocator("TestChannel", SharedTestData::instance.regExIds, SharedTestData::instance.endpointLocatorPrx);
-        SharedTestData::instance.locatorRegistry->addEndpointLocator("TestChannel", SharedTestData::instance.regExIds, SharedTestData::instance.endpointLocatorPrx);
+        SharedTestData::instance.locatorRegistry->addEndpointLocator(AsteriskSCF::Operations::createContext(), "TestChannel", SharedTestData::instance.regExIds, SharedTestData::instance.endpointLocatorPrx);
+        SharedTestData::instance.locatorRegistry->addEndpointLocator(AsteriskSCF::Operations::createContext(), "TestChannel", SharedTestData::instance.regExIds, SharedTestData::instance.endpointLocatorPrx);
     }
     catch (...)
     {
@@ -343,7 +343,7 @@ BOOST_AUTO_TEST_CASE(AddEndpointLocatorTwice)
 
     try
     {
-        SharedTestData::instance.locatorRegistry->removeEndpointLocator("TestChannel");
+        SharedTestData::instance.locatorRegistry->removeEndpointLocator(AsteriskSCF::Operations::createContext(), "TestChannel");
     }
     catch (...)
     {
@@ -398,7 +398,7 @@ BOOST_FIXTURE_TEST_CASE(RouteSession, PerTestFixture)
         SharedTestData::instance.mBridgeConnected = false;
 
         BOOST_TEST_MESSAGE("Routing the session...");
-        SharedTestData::instance.sessionRouter->routeSession(new OperationContext(IceUtil::generateUUID()), session, "102", 0, session->getCaller(), session->getRedirections());
+        SharedTestData::instance.sessionRouter->routeSession(AsteriskSCF::Operations::createContext(), session, "102", 0, session->getCaller(), session->getRedirections());
 
         BOOST_CHECK(SharedTestData::instance.mBridgeConnected);
 
@@ -453,14 +453,14 @@ BOOST_FIXTURE_TEST_CASE(BlindTransfer, PerTestFixture)
         SharedTestData::instance.mSessionReplaced = false;
 
         BOOST_TEST_MESSAGE("Routing the session...");
-        SharedTestData::instance.sessionRouter->routeSession(new OperationContext(IceUtil::generateUUID()), session, "102", 0, session->getCaller(), session->getRedirections());
+        SharedTestData::instance.sessionRouter->routeSession(AsteriskSCF::Operations::createContext(), session, "102", 0, session->getCaller(), session->getRedirections());
 
         BridgePrx bridge = session->getBridge();
         BOOST_CHECK(bridge != 0);
         BOOST_CHECK(SharedTestData::instance.mBridgeConnected);
 
         // Now transfer to a new extension.
-        SharedTestData::instance.sessionRouter->connectBridgedSessionsWithDestination(new OperationContext(IceUtil::generateUUID()), session, "103", true, 0);
+        SharedTestData::instance.sessionRouter->connectBridgedSessionsWithDestination(AsteriskSCF::Operations::createContext(), session, "103", true, 0);
 
         BOOST_CHECK(SharedTestData::instance.mSessionReplaced);
 
@@ -510,7 +510,7 @@ BOOST_FIXTURE_TEST_CASE(AttendedTransfer, PerTestFixture)
         SharedTestData::instance.mBridgeConnected = false;
 
         BOOST_TEST_MESSAGE("Routing for the first pair...");
-        SharedTestData::instance.sessionRouter->routeSession(new OperationContext(IceUtil::generateUUID()), session101, "102", 0, session101->getCaller(), session101->getRedirections());
+        SharedTestData::instance.sessionRouter->routeSession(AsteriskSCF::Operations::createContext(), session101, "102", 0, session101->getCaller(), session101->getRedirections());
 
         BOOST_CHECK(SharedTestData::instance.mBridgeConnected);
 
@@ -526,13 +526,13 @@ BOOST_FIXTURE_TEST_CASE(AttendedTransfer, PerTestFixture)
 
         BOOST_TEST_MESSAGE("Routing the second pair...");
 
-        SharedTestData::instance.sessionRouter->routeSession(new OperationContext(IceUtil::generateUUID()), session103, "104", 0, session103->getCaller(), session103->getRedirections());
+        SharedTestData::instance.sessionRouter->routeSession(AsteriskSCF::Operations::createContext(), session103, "104", 0, session103->getCaller(), session103->getRedirections());
 
         BOOST_CHECK(SharedTestData::instance.mBridgeConnected);
 
         // Now bridge 102 and 104 into the first pair's bridge
         BridgePrx survivingBridge = session101->getBridge(); // Cache for testing.
-        SharedTestData::instance.sessionRouter->connectBridgedSessions(new OperationContext(IceUtil::generateUUID()), session101, session103, true);
+        SharedTestData::instance.sessionRouter->connectBridgedSessions(AsteriskSCF::Operations::createContext(), session101, session103, true);
 
         BOOST_CHECK(SharedTestData::instance.mSessionReplaced);
 
@@ -585,7 +585,7 @@ BOOST_FIXTURE_TEST_CASE(ChangeLocatorIds, PerTestFixture)
     // Tell the routing service we have different destination ids
     try
     {
-        SharedTestData::instance.locatorRegistry->setEndpointLocatorDestinationIds("TestChannel", SharedTestData::instance.regExIds);
+        SharedTestData::instance.locatorRegistry->setEndpointLocatorDestinationIds(AsteriskSCF::Operations::createContext(), "TestChannel", SharedTestData::instance.regExIds);
     }
     catch (...)
     {
@@ -625,11 +625,11 @@ BOOST_FIXTURE_TEST_CASE(SwitchActiveAndStandby, PerTestFixture)
         BOOST_CHECK(SharedTestData::instance.backupServiceReplicaMgmt->isActive() == false);
 
         // Switch the active to standby. 
-        SharedTestData::instance.serviceReplicaMgmt->standby();
+        SharedTestData::instance.serviceReplicaMgmt->standby(AsteriskSCF::Operations::createContext());
         BOOST_CHECK(SharedTestData::instance.serviceReplicaMgmt->isActive() == false);
 
         // Switch back to active. 
-        SharedTestData::instance.serviceReplicaMgmt->activate();
+        SharedTestData::instance.serviceReplicaMgmt->activate(AsteriskSCF::Operations::createContext());
         BOOST_CHECK(SharedTestData::instance.serviceReplicaMgmt->isActive() == true);
     }
     catch (...)
@@ -650,7 +650,7 @@ BOOST_FIXTURE_TEST_CASE(BackupEndpointLocatorActive, PerTestFixture)
         IceUtil::ThreadControl::sleep(IceUtil::Time::milliSeconds(1000));
 
         // Make the backup active. 
-        SharedTestData::instance.backupServiceReplicaMgmt->activate();
+        SharedTestData::instance.backupServiceReplicaMgmt->activate(AsteriskSCF::Operations::createContext());
         BOOST_CHECK(SharedTestData::instance.backupServiceReplicaMgmt->isActive() == true);
 
         // Do a lookup on it now that it's active. 
@@ -662,7 +662,7 @@ BOOST_FIXTURE_TEST_CASE(BackupEndpointLocatorActive, PerTestFixture)
         BOOST_CHECK(seq[0]->getId() == lookupVal);
 
         // Set the backup back into standby mode.
-        SharedTestData::instance.backupServiceReplicaMgmt->standby();
+        SharedTestData::instance.backupServiceReplicaMgmt->standby(AsteriskSCF::Operations::createContext());
         BOOST_CHECK(SharedTestData::instance.backupServiceReplicaMgmt->isActive() == false);
 
     }
@@ -702,23 +702,22 @@ BOOST_FIXTURE_TEST_CASE(FailoverRouteSession, PerTestFixture)
         BOOST_CHECK(SharedTestData::instance.serviceReplicaMgmt->isActive() == true);
         BOOST_CHECK(SharedTestData::instance.backupServiceReplicaMgmt->isActive() == false);
 
-        SharedTestData::instance.componentTest->setTestMode("RouteSessionFailover");
+        SharedTestData::instance.componentTest->setTestMode(AsteriskSCF::Operations::createContext(), "RouteSessionFailover");
 
         // Get our local 101 endpoint
         MockSessionEndpointPtr session101Endpoint = SharedTestData::instance.endpointLocator->localLookup("101");
 
         BOOST_TEST_MESSAGE("Creating a session on our test endpoint...");
-        SessionPrx session = session101Endpoint->createSession("102", 0, 0, Ice::Current());
+        SessionPrx session = session101Endpoint->createSession(AsteriskSCF::Operations::createContext(), "102", 0, 0, Ice::Current());
         BOOST_CHECK(session != 0);
 
         SharedTestData::instance.mBridgeConnected = false;
 
         BOOST_TEST_MESSAGE("Routing the session...");
-        string operationId = IceUtil::generateUUID();
 
         // Note we're routing using AMI with no callback. The callback would never come due to the
         // way the test mode shuts down the operation. Simulates failure.
-        SharedTestData::instance.sessionRouter->begin_routeSession(new OperationContext(operationId), session, "102", 0, session->getCaller(), session->getRedirections());
+        SharedTestData::instance.sessionRouter->begin_routeSession(AsteriskSCF::Operations::createContext(), session, "102", 0, session->getCaller(), session->getRedirections());
 
         for (int counter=0; SharedTestData::instance.endpointLocator->mLookupCalled == false; counter++)
         {
@@ -743,11 +742,11 @@ BOOST_FIXTURE_TEST_CASE(FailoverRouteSession, PerTestFixture)
         SharedTestData::instance.endpointLocator->mLookupCalled = false;
 
         // Switch standby component to active. 
-        SharedTestData::instance.serviceReplicaMgmt->activate();
+        SharedTestData::instance.serviceReplicaMgmt->activate(AsteriskSCF::Operations::createContext());
         BOOST_CHECK(SharedTestData::instance.serviceReplicaMgmt->isActive() == true);
 
         // Let the backup session router try to route using same operationId.
-        SharedTestData::instance.backupSessionRouter->routeSession(new OperationContext(operationId), session, "102", 0, session->getCaller(), session->getRedirections());
+        SharedTestData::instance.backupSessionRouter->routeSession(AsteriskSCF::Operations::createContext(), session, "102", 0, session->getCaller(), session->getRedirections());
 
         // The lookup should not be done again. 
         BOOST_CHECK(!SharedTestData::instance.endpointLocator->mLookupCalled);
@@ -755,7 +754,7 @@ BOOST_FIXTURE_TEST_CASE(FailoverRouteSession, PerTestFixture)
         BOOST_CHECK(SharedTestData::instance.mBridgeConnected == true);
 
         // Set the backup back into standby mode.
-        SharedTestData::instance.backupServiceReplicaMgmt->standby();
+        SharedTestData::instance.backupServiceReplicaMgmt->standby(AsteriskSCF::Operations::createContext());
         BOOST_CHECK(SharedTestData::instance.backupServiceReplicaMgmt->isActive() == false);
     }
     catch (...)
@@ -790,29 +789,28 @@ BOOST_FIXTURE_TEST_CASE(FailoverConnectBridgedSessWithDest, PerTestFixture)
         BOOST_CHECK(SharedTestData::instance.serviceReplicaMgmt->isActive() == true);
         BOOST_CHECK(SharedTestData::instance.backupServiceReplicaMgmt->isActive() == false);
 
-        SharedTestData::instance.componentTest->setTestMode("ConnectBridgedSessWithDestFailover");
+        SharedTestData::instance.componentTest->setTestMode(AsteriskSCF::Operations::createContext(), "ConnectBridgedSessWithDestFailover");
 
         // Get our local 101 endpoint
         MockSessionEndpointPtr session101Endpoint = SharedTestData::instance.endpointLocator->localLookup("101");
 
         BOOST_TEST_MESSAGE("Creating a session on our test endpoint...");
-        SessionPrx session = session101Endpoint->createSession("102", 0, 0, Ice::Current());
+        SessionPrx session = session101Endpoint->createSession(AsteriskSCF::Operations::createContext(), "102", 0, 0, Ice::Current());
         BOOST_CHECK(session != 0);
 
         SharedTestData::instance.mBridgeConnected = false;
         SharedTestData::instance.mSessionReplaced = false;
 
         BOOST_TEST_MESSAGE("Routing the session...");
-        SharedTestData::instance.sessionRouter->routeSession(new OperationContext(IceUtil::generateUUID()), session, "102", 0, session->getCaller(), session->getRedirections());
+        SharedTestData::instance.sessionRouter->routeSession(AsteriskSCF::Operations::createContext(), session, "102", 0, session->getCaller(), session->getRedirections());
 
         BridgePrx bridge = session->getBridge();
         BOOST_CHECK(bridge != 0);
         BOOST_CHECK(SharedTestData::instance.mBridgeConnected);
 
-        string operationId = IceUtil::generateUUID();
 
         // Now transfer to a new extension. In our test mode, this operation will never complete.
-        SharedTestData::instance.sessionRouter->begin_connectBridgedSessionsWithDestination(new OperationContext(operationId), session, "103", true, 0);
+        SharedTestData::instance.sessionRouter->begin_connectBridgedSessionsWithDestination(AsteriskSCF::Operations::createContext(), session, "103", true, 0);
 
         for (int counter=0; SharedTestData::instance.mSessionReplaced == false; counter++)
         {
@@ -839,11 +837,11 @@ BOOST_FIXTURE_TEST_CASE(FailoverConnectBridgedSessWithDest, PerTestFixture)
         IceUtil::ThreadControl::sleep(IceUtil::Time::milliSeconds(1000));
 
         // Switch standby component to active. 
-        SharedTestData::instance.serviceReplicaMgmt->activate();
+        SharedTestData::instance.serviceReplicaMgmt->activate(AsteriskSCF::Operations::createContext());
         BOOST_CHECK(SharedTestData::instance.serviceReplicaMgmt->isActive() == true);
 
         // Let the backup session router try to route using same operationId. Synchronous call.
-        SharedTestData::instance.backupSessionRouter->connectBridgedSessionsWithDestination(new OperationContext(operationId), session, "103", true, 0);
+        SharedTestData::instance.backupSessionRouter->connectBridgedSessionsWithDestination(AsteriskSCF::Operations::createContext(), session, "103", true, 0);
 
         // The lookup should not be done again. 
         BOOST_CHECK(SharedTestData::instance.endpointLocator->mLookupCalled == false);
@@ -852,7 +850,7 @@ BOOST_FIXTURE_TEST_CASE(FailoverConnectBridgedSessWithDest, PerTestFixture)
         BOOST_CHECK(SharedTestData::instance.mSessionReplaced == false);
 
         // Set the backup back into standby mode.
-        SharedTestData::instance.backupServiceReplicaMgmt->standby();
+        SharedTestData::instance.backupServiceReplicaMgmt->standby(AsteriskSCF::Operations::createContext());
         BOOST_CHECK(SharedTestData::instance.backupServiceReplicaMgmt->isActive() == false);
     }
     catch (...)

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


-- 
asterisk-scf/integration/routing.git



More information about the asterisk-scf-commits mailing list