[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
Wed Mar 14 18:00:02 CDT 2012
branch "retry_deux" has been updated
via 17394f7f48475944efc079a76f9a817a6ec6cacb (commit)
from be4a8051a643214fa8cc1478209bc4f18b6a0a19 (commit)
Summary of changes:
test/MockBridge.cpp | 40 +++++++++++++-------
test/MockBridge.h | 28 ++++++++------
test/MockBridgeManager.cpp | 11 +++---
test/MockBridgeManager.h | 16 ++++++---
test/MockSession.cpp | 22 ++++++++----
test/MockSession.h | 18 ++++++---
test/MockSessionEndpoint.cpp | 10 ++++-
test/MockSessionEndpoint.h | 23 ++++++++----
test/TestRouting.cpp | 80 +++++++++++++++++++++--------------------
9 files changed, 150 insertions(+), 98 deletions(-)
- Log -----------------------------------------------------------------
commit 17394f7f48475944efc079a76f9a817a6ec6cacb
Author: Ken Hunt <ken.hunt at digium.com>
Date: Wed Mar 14 17:57:49 2012 -0500
OperationContext updates for unit tests.
diff --git a/test/MockBridge.cpp b/test/MockBridge.cpp
index 371c938..6f5344b 100644
--- a/test/MockBridge.cpp
+++ b/test/MockBridge.cpp
@@ -18,10 +18,12 @@
#include <AsteriskSCF/System/OperationsIf.h>
#include "MockBridge.h"
#include "SharedTestData.h"
+#include <AsteriskSCF/Operations/OperationContext.h>
using namespace AsteriskSCF::System::V1;
using namespace AsteriskSCF::SessionCommunications::V1;
using namespace AsteriskSCF::SessionCommunications::PartyIdentification::V1;
+using namespace AsteriskSCF::Operations;
namespace AsteriskSCF
{
@@ -36,7 +38,7 @@ public:
}
// Overrides
- virtual void indicated(const AsteriskSCF::System::V1::OperationContextPtr& operationId, const AsteriskSCF::SessionCommunications::V1::SessionPrx& session,
+ virtual void indicated(const AsteriskSCF::System::V1::OperationContextPtr& operationContext, const AsteriskSCF::SessionCommunications::V1::SessionPrx& session,
const AsteriskSCF::SessionCommunications::V1::IndicationPtr& indication,
const AsteriskSCF::SessionCommunications::V1::SessionCookies&, const Ice::Current&)
{
@@ -44,7 +46,7 @@ public:
if ((connected = AsteriskSCF::SessionCommunications::V1::ConnectedIndicationPtr::dynamicCast(indication)))
{
- mBridge->connected(session);
+ mBridge->connected(createContext(operationContext), session);
}
}
@@ -80,6 +82,7 @@ static SessionPrx extractSession(const SessionWithSessionInfo& swsi)
}
void MockBridge::addSessions_async(const AMD_Bridge_addSessionsPtr& callback,
+ const AsteriskSCF::System::V1::OperationContextPtr &,
const SessionWithSessionInfoSeq& newSessionInfos,
const Ice::Current&)
{
@@ -101,14 +104,16 @@ void MockBridge::addSessions_async(const AMD_Bridge_addSessionsPtr& callback,
}
}
-void MockBridge::removeSessions_async(const AMD_Bridge_removeSessionsPtr& callback, const SessionSeq& sessions,
+void MockBridge::removeSessions_async(const AMD_Bridge_removeSessionsPtr& callback,
+ const AsteriskSCF::System::V1::OperationContextPtr &operationContext,
+ const SessionSeq& sessions,
const Ice::Current&)
{
try
{
for(SessionSeq::const_iterator s = sessions.begin(); s != sessions.end(); ++s)
{
- removeSession(*s);
+ removeSession(createContext(operationContext), *s);
}
callback->ice_response();
}
@@ -122,7 +127,7 @@ void MockBridge::removeSessions_async(const AMD_Bridge_removeSessionsPtr& callba
}
}
-void MockBridge::removeSession(const SessionPrx& session)
+void MockBridge::removeSession(const AsteriskSCF::System::V1::OperationContextPtr &, const SessionPrx& session)
{
for(SessionSeq::iterator s = mSessions.begin(); s != mSessions.end(); ++s)
{
@@ -140,23 +145,28 @@ SessionSeq MockBridge::listSessions(const Ice::Current&)
return mSessions;
}
-void MockBridge::addListener(const AsteriskSCF::SessionCommunications::V1::BridgeListenerPrx&, const Ice::Current& )
+void MockBridge::addListener(const AsteriskSCF::System::V1::OperationContextPtr &,
+ const AsteriskSCF::SessionCommunications::V1::BridgeListenerPrx&, const Ice::Current& )
{
}
-void MockBridge::removeListener(const AsteriskSCF::SessionCommunications::V1::BridgeListenerPrx&, const Ice::Current& )
+void MockBridge::removeListener(
+ const AsteriskSCF::System::V1::OperationContextPtr &,
+ const AsteriskSCF::SessionCommunications::V1::BridgeListenerPrx&,
+ const Ice::Current& )
{
}
-void MockBridge::destroy(const Ice::Current&)
+void MockBridge::destroy(const AsteriskSCF::System::V1::OperationContextPtr &, const Ice::Current&)
{
}
-void MockBridge::shutdown(const Ice::Current&)
+void MockBridge::shutdown(const AsteriskSCF::System::V1::OperationContextPtr &, const Ice::Current&)
{
}
void MockBridge::replaceSession_async(const AsteriskSCF::SessionCommunications::V1::AMD_Bridge_replaceSessionPtr& cb,
+ const AsteriskSCF::System::V1::OperationContextPtr &operationContext,
const AsteriskSCF::SessionCommunications::V1::SessionPrx& sessionToReplace,
const AsteriskSCF::SessionCommunications::V1::SessionWithSessionInfoSeq& newSessionInfos,
const Ice::Current&)
@@ -168,7 +178,7 @@ void MockBridge::replaceSession_async(const AsteriskSCF::SessionCommunications::
{
SharedTestData::instance.mSessionReplaced = true;
- removeSession(sessionToReplace);
+ removeSession(createContext(operationContext), sessionToReplace);
addSessionsImpl(newSessions);
ResponseCodePtr response = new ResponseCode(1);
@@ -185,11 +195,13 @@ void MockBridge::replaceSession_async(const AsteriskSCF::SessionCommunications::
}
}
-void MockBridge::setCookies(const AsteriskSCF::SessionCommunications::V1::BridgeCookies& , const Ice::Current&)
+void MockBridge::setCookies(const AsteriskSCF::System::V1::OperationContextPtr &,
+ const AsteriskSCF::SessionCommunications::V1::BridgeCookies& , const Ice::Current&)
{
}
-void MockBridge::removeCookies(const AsteriskSCF::SessionCommunications::V1::BridgeCookies& , const Ice::Current&)
+void MockBridge::removeCookies(const AsteriskSCF::System::V1::OperationContextPtr &,
+ const AsteriskSCF::SessionCommunications::V1::BridgeCookies& , const Ice::Current&)
{
}
@@ -198,7 +210,7 @@ AsteriskSCF::SessionCommunications::V1::BridgeCookies MockBridge::getCookies(con
return AsteriskSCF::SessionCommunications::V1::BridgeCookies();
}
-void MockBridge::connected(const AsteriskSCF::SessionCommunications::V1::SessionPrx&)
+void MockBridge::connected(const AsteriskSCF::System::V1::OperationContextPtr &, const AsteriskSCF::SessionCommunications::V1::SessionPrx&)
{
SharedTestData::instance.mBridgeConnected = true;
}
@@ -210,7 +222,7 @@ void MockBridge::addSessionsImpl(const AsteriskSCF::SessionCommunications::V1::S
for (SessionSeq::const_iterator s = newSessions.begin(); s != newSessions.end(); ++s)
{
- (*s)->setBridge(AsteriskSCF::Operations::createContext(), mBridgePrx, mListenerPrx);
+ (*s)->setBridge(createContext(), mBridgePrx, mListenerPrx);
}
}
diff --git a/test/MockBridge.h b/test/MockBridge.h
index e32b190..0b77438 100644
--- a/test/MockBridge.h
+++ b/test/MockBridge.h
@@ -35,29 +35,33 @@ public:
// Overrides
void addSessions_async(const AsteriskSCF::SessionCommunications::V1::AMD_Bridge_addSessionsPtr&,
- const AsteriskSCF::SessionCommunications::V1::SessionWithSessionInfoSeq& newSessionInfos,
- const Ice::Current& = ::Ice::Current());
- void destroy(const Ice::Current& ) ;
+ const AsteriskSCF::System::V1::OperationContextPtr &,
+ const AsteriskSCF::SessionCommunications::V1::SessionWithSessionInfoSeq& newSessionInfos,
+ const Ice::Current& = ::Ice::Current());
+ void destroy(const AsteriskSCF::System::V1::OperationContextPtr &, const Ice::Current& ) ;
void removeSessions_async(const AsteriskSCF::SessionCommunications::V1::AMD_Bridge_removeSessionsPtr&,
- const AsteriskSCF::SessionCommunications::V1::SessionSeq&, const Ice::Current&);
+ const AsteriskSCF::System::V1::OperationContextPtr &,
+ const AsteriskSCF::SessionCommunications::V1::SessionSeq&, const Ice::Current&);
AsteriskSCF::SessionCommunications::V1::SessionSeq listSessions(const Ice::Current&);
- void shutdown(const Ice::Current&) ;
- void addListener(const AsteriskSCF::SessionCommunications::V1::BridgeListenerPrx&, const Ice::Current& );
- void removeListener(const AsteriskSCF::SessionCommunications::V1::BridgeListenerPrx&, const Ice::Current& );
+ void shutdown(const AsteriskSCF::System::V1::OperationContextPtr &, const Ice::Current&) ;
+ void addListener(const AsteriskSCF::System::V1::OperationContextPtr &, const AsteriskSCF::SessionCommunications::V1::BridgeListenerPrx&, const Ice::Current& );
+ void removeListener(const AsteriskSCF::System::V1::OperationContextPtr &, const AsteriskSCF::SessionCommunications::V1::BridgeListenerPrx&, const Ice::Current& );
void replaceSession_async(const AsteriskSCF::SessionCommunications::V1::AMD_Bridge_replaceSessionPtr&,
+ const AsteriskSCF::System::V1::OperationContextPtr &,
const AsteriskSCF::SessionCommunications::V1::SessionPrx& sessionToReplace,
const AsteriskSCF::SessionCommunications::V1::SessionWithSessionInfoSeq& newSessionInfos,
const Ice::Current&);
- void setCookies(const AsteriskSCF::SessionCommunications::V1::BridgeCookies& cookies, const Ice::Current&);
- void removeCookies(const AsteriskSCF::SessionCommunications::V1::BridgeCookies& cookies, const Ice::Current&);
- AsteriskSCF::SessionCommunications::V1::BridgeCookies getCookies(const AsteriskSCF::SessionCommunications::V1::BridgeCookies& cookies, const Ice::Current&);
+ void setCookies(const AsteriskSCF::System::V1::OperationContextPtr &,
+ const AsteriskSCF::SessionCommunications::V1::BridgeCookies& cookies, const Ice::Current&);
+ void removeCookies(const AsteriskSCF::System::V1::OperationContextPtr &, const AsteriskSCF::SessionCommunications::V1::BridgeCookies& cookies, const Ice::Current&);
+ AsteriskSCF::SessionCommunications::V1::BridgeCookies getCookies( const AsteriskSCF::SessionCommunications::V1::BridgeCookies& cookies, const Ice::Current&);
// Implementation
- void connected(const AsteriskSCF::SessionCommunications::V1::SessionPrx& session);
- void removeSession(const AsteriskSCF::SessionCommunications::V1::SessionPrx& session);
+ void connected(const AsteriskSCF::System::V1::OperationContextPtr &, const AsteriskSCF::SessionCommunications::V1::SessionPrx& session);
+ void removeSession(const AsteriskSCF::System::V1::OperationContextPtr &, const AsteriskSCF::SessionCommunications::V1::SessionPrx& session);
AsteriskSCF::SessionCommunications::V1::BridgePrx getProxy() {return mBridgePrx;}
private:
diff --git a/test/MockBridgeManager.cpp b/test/MockBridgeManager.cpp
index f9af4c6..e12a4e2 100644
--- a/test/MockBridgeManager.cpp
+++ b/test/MockBridgeManager.cpp
@@ -27,11 +27,12 @@ namespace AsteriskSCF
namespace RoutingTest
{
-void MockBridgeManager::addListener(const BridgeManagerListenerPrx&, const Ice::Current& )
+void MockBridgeManager::addListener(const AsteriskSCF::System::V1::OperationContextPtr &, const BridgeManagerListenerPrx&, const Ice::Current& )
{
}
void MockBridgeManager::createBridge_async(const AMD_BridgeManager_createBridgePtr& callback,
+ const AsteriskSCF::System::V1::OperationContextPtr &,
const SessionPrx&,
const SessionSeq& sessions,
const BridgeListenerPrx& listener,
@@ -60,15 +61,15 @@ void MockBridgeManager::createBridge_async(const AMD_BridgeManager_createBridgeP
}
}
-void MockBridgeManager::removeListener(const BridgeManagerListenerPrx&, const Ice::Current& )
+void MockBridgeManager::removeListener(const AsteriskSCF::System::V1::OperationContextPtr &, const BridgeManagerListenerPrx&, const Ice::Current& )
{
}
-void MockBridgeManager::addDefaultBridgeListener(const AsteriskSCF::SessionCommunications::V1::BridgeListenerPrx&, const Ice::Current&)
+void MockBridgeManager::addDefaultBridgeListener(const AsteriskSCF::System::V1::OperationContextPtr &, const AsteriskSCF::SessionCommunications::V1::BridgeListenerPrx&, const Ice::Current&)
{
}
-void MockBridgeManager::removeDefaultBridgeListener(const AsteriskSCF::SessionCommunications::V1::BridgeListenerPrx&, const Ice::Current&)
+void MockBridgeManager::removeDefaultBridgeListener(const AsteriskSCF::System::V1::OperationContextPtr &, const AsteriskSCF::SessionCommunications::V1::BridgeListenerPrx&, const Ice::Current&)
{
}
@@ -77,7 +78,7 @@ BridgeSeq MockBridgeManager::listBridges(const Ice::Current&)
return mBridges;
}
-void MockBridgeManager::shutdown(const Ice::Current&)
+void MockBridgeManager::shutdown(const AsteriskSCF::System::V1::OperationContextPtr &, const Ice::Current&)
{
}
diff --git a/test/MockBridgeManager.h b/test/MockBridgeManager.h
index 36b7293..4387f6c 100644
--- a/test/MockBridgeManager.h
+++ b/test/MockBridgeManager.h
@@ -30,19 +30,25 @@ public:
{
}
- void addListener(const AsteriskSCF::SessionCommunications::V1::BridgeManagerListenerPrx&, const Ice::Current&);
+ void addListener(const AsteriskSCF::System::V1::OperationContextPtr &,
+ const AsteriskSCF::SessionCommunications::V1::BridgeManagerListenerPrx&,
+ const Ice::Current&);
void createBridge_async(const AsteriskSCF::SessionCommunications::V1::AMD_BridgeManager_createBridgePtr&,
+ const AsteriskSCF::System::V1::OperationContextPtr &,
const AsteriskSCF::SessionCommunications::V1::SessionPrx& source,
const AsteriskSCF::SessionCommunications::V1::SessionSeq& sessions,
const AsteriskSCF::SessionCommunications::V1::BridgeListenerPrx& listener,
const AsteriskSCF::SessionCommunications::PartyIdentification::V1::CallerPtr& callerID,
const AsteriskSCF::SessionCommunications::PartyIdentification::V1::RedirectionsPtr& redirects, const Ice::Current&);
- void removeListener(const AsteriskSCF::SessionCommunications::V1::BridgeManagerListenerPrx&, const Ice::Current&);
- void addDefaultBridgeListener(const AsteriskSCF::SessionCommunications::V1::BridgeListenerPrx&, const Ice::Current&);
- void removeDefaultBridgeListener(const AsteriskSCF::SessionCommunications::V1::BridgeListenerPrx&, const Ice::Current&);
+ void removeListener(const AsteriskSCF::System::V1::OperationContextPtr &,
+ const AsteriskSCF::SessionCommunications::V1::BridgeManagerListenerPrx&, const Ice::Current&);
+ void addDefaultBridgeListener(const AsteriskSCF::System::V1::OperationContextPtr &,
+ const AsteriskSCF::SessionCommunications::V1::BridgeListenerPrx&, const Ice::Current&);
+ void removeDefaultBridgeListener(const AsteriskSCF::System::V1::OperationContextPtr &,
+ const AsteriskSCF::SessionCommunications::V1::BridgeListenerPrx&, const Ice::Current&);
AsteriskSCF::SessionCommunications::V1::BridgeSeq listBridges(const Ice::Current&);
- void shutdown(const ::Ice::Current&);
+ void shutdown(const AsteriskSCF::System::V1::OperationContextPtr &,const ::Ice::Current&);
private:
std::vector<AsteriskSCF::SessionCommunications::V1::BridgePtr> mBridgeServants;
diff --git a/test/MockSession.cpp b/test/MockSession.cpp
index aedd236..193501f 100644
--- a/test/MockSession.cpp
+++ b/test/MockSession.cpp
@@ -20,10 +20,12 @@
#include "MockSession.h"
#include "SharedTestData.h"
+#include <AsteriskSCF/Operations/OperationContext.h>
using namespace AsteriskSCF::SessionCommunications::V1;
using namespace AsteriskSCF::SessionCommunications::PartyIdentification::V1;
using namespace AsteriskSCF::System::V1;
+using namespace AsteriskSCF::Operations;
using namespace std;
namespace AsteriskSCF
@@ -47,7 +49,7 @@ public:
{
AsteriskSCF::SessionCommunications::V1::StoppedIndicationPtr stopped(new AsteriskSCF::SessionCommunications::V1::StoppedIndication());
stopped->response = mResponse;
- l->indicated(new OperationContext(AsteriskSCF::Operations::createContext()), mMyProxy, stopped, AsteriskSCF::SessionCommunications::V1::SessionCookies());
+ l->indicated(createContext(), mMyProxy, stopped, AsteriskSCF::SessionCommunications::V1::SessionCookies());
}
private:
@@ -118,6 +120,7 @@ void MockSession::internalAddListener(const SessionListenerPrx& listener)
void MockSession::addListener_async(
const AsteriskSCF::SessionCommunications::V1::AMD_Session_addListenerPtr& cb,
+ const OperationContextPtr& operationContext,
const SessionListenerPrx& listener,
const Ice::Current&)
{
@@ -127,6 +130,7 @@ void MockSession::addListener_async(
void MockSession::indicate_async(
const AsteriskSCF::SessionCommunications::V1::AMD_Session_indicatePtr& cb,
+ const OperationContextPtr& operationContext,
const AsteriskSCF::SessionCommunications::V1::IndicationPtr& indication,
const Ice::Current&)
{
@@ -136,7 +140,7 @@ void MockSession::indicate_async(
{
for(vector<SessionListenerPrx>::iterator i = mListeners.begin(); i != mListeners.end(); ++i)
{
- (*i)->indicated(AsteriskSCF::Operations::createContext(), mMyPrx, new AsteriskSCF::SessionCommunications::V1::ConnectedIndication(), AsteriskSCF::SessionCommunications::V1::SessionCookies());
+ (*i)->indicated(createContext(), mMyPrx, new AsteriskSCF::SessionCommunications::V1::ConnectedIndication(), AsteriskSCF::SessionCommunications::V1::SessionCookies());
}
}
cb->ice_response();
@@ -164,7 +168,7 @@ void MockSession::getMediaSession_async(
cb->ice_response(0);
}
-void MockSession::removeListener(const SessionListenerPrx& listener, const Ice::Current&)
+void MockSession::removeListener(const OperationContextPtr& operationContext, const SessionListenerPrx& listener, const Ice::Current&)
{
for(vector<SessionListenerPrx>::iterator i = mListeners.begin(); i != mListeners.end(); ++i)
{
@@ -176,18 +180,18 @@ void MockSession::removeListener(const SessionListenerPrx& listener, const Ice::
}
}
-void MockSession::start(const Ice::Current&)
+void MockSession::start(const OperationContextPtr& operationContext, const Ice::Current&)
{
cout << "Session started." << endl;
for(vector<SessionListenerPrx>::iterator i = mListeners.begin(); i != mListeners.end(); ++i)
{
// Auto-answer!
- (*i)->indicated(new OperationContext(AsteriskSCF::Operations::createContext(), mMyPrx, new AsteriskSCF::SessionCommunications::V1::ConnectedIndication(), AsteriskSCF::SessionCommunications::V1::SessionCookies());
+ (*i)->indicated(createContext(), mMyPrx, new AsteriskSCF::SessionCommunications::V1::ConnectedIndication(), AsteriskSCF::SessionCommunications::V1::SessionCookies());
}
}
-void MockSession::stop(const ResponseCodePtr& response, const Ice::Current&)
+void MockSession::stop(const OperationContextPtr& operationContext, const ResponseCodePtr& response, const Ice::Current&)
{
BOOST_TEST_MESSAGE("Session " + mLegId + " stopped.");
@@ -215,6 +219,7 @@ void MockSession::getStreams_async(
void MockSession::setAndGetSessionController_async(
const AsteriskSCF::SessionCommunications::V1::AMD_Session_setAndGetSessionControllerPtr& cb,
+ const OperationContextPtr& operationContext,
const AsteriskSCF::SessionCommunications::V1::SessionControllerPrx&,
const Ice::Current&)
{
@@ -223,6 +228,7 @@ void MockSession::setAndGetSessionController_async(
void MockSession::removeSessionController_async(
const AsteriskSCF::SessionCommunications::V1::AMD_Session_removeSessionControllerPtr& cb,
+ const OperationContextPtr& operationContext,
const AsteriskSCF::SessionCommunications::V1::SessionControllerPrx&,
const Ice::Current&)
{
@@ -260,6 +266,7 @@ void MockSession::getRedirections_async(const AMD_Session_getRedirectionsPtr& cb
*/
void MockSession::setBridge_async(
const AMD_Session_setBridgePtr& cb,
+ const OperationContextPtr& operationContext,
const BridgePrx& bridge,
const SessionListenerPrx& listener,
const Ice::Current&)
@@ -274,13 +281,14 @@ void MockSession::setBridge_async(
void MockSession::removeBridge_async(
const AsteriskSCF::SessionCommunications::V1::AMD_Session_removeBridgePtr& cb,
+ const OperationContextPtr& operationContext,
const SessionListenerPrx& listener,
const Ice::Current ¤t)
{
mBridgePrx = 0;
mBridgeSet = false;
- removeListener(listener, current);
+ removeListener(createContext(), listener, current);
cb->ice_response();
}
diff --git a/test/MockSession.h b/test/MockSession.h
index 00026f5..c44f6b1 100644
--- a/test/MockSession.h
+++ b/test/MockSession.h
@@ -34,10 +34,12 @@ public:
void addListener_async(
const AsteriskSCF::SessionCommunications::V1::AMD_Session_addListenerPtr& cb,
+ const AsteriskSCF::System::V1::OperationContextPtr &,
const AsteriskSCF::SessionCommunications::V1::SessionListenerPrx& listener,
const Ice::Current&);
void indicate_async(
const AsteriskSCF::SessionCommunications::V1::AMD_Session_indicatePtr& cb,
+ const AsteriskSCF::System::V1::OperationContextPtr &,
const AsteriskSCF::SessionCommunications::V1::IndicationPtr&,
const Ice::Current&);
void getEndpoint_async(
@@ -49,12 +51,12 @@ public:
void getMediaSession_async(
const AsteriskSCF::SessionCommunications::V1::AMD_Session_getMediaSessionPtr& cb,
const Ice::Current&);
- void removeListener(const AsteriskSCF::SessionCommunications::V1::SessionListenerPrx&, const Ice::Current&);
- void start(const Ice::Current&);
- void stop(const AsteriskSCF::SessionCommunications::V1::ResponseCodePtr&, const Ice::Current&);
- void removeBridge(const AsteriskSCF::SessionCommunications::V1::SessionListenerPrx& listener, const Ice::Current &);
- void setCookies(const AsteriskSCF::SessionCommunications::V1::SessionCookies&, const Ice::Current&) { };
- void removeCookies(const AsteriskSCF::SessionCommunications::V1::SessionCookies&, const Ice::Current&) { };
+ void removeListener(const AsteriskSCF::System::V1::OperationContextPtr &, const AsteriskSCF::SessionCommunications::V1::SessionListenerPrx&, const Ice::Current&);
+ void start(const AsteriskSCF::System::V1::OperationContextPtr &, const Ice::Current&);
+ void stop(const AsteriskSCF::System::V1::OperationContextPtr &, const AsteriskSCF::SessionCommunications::V1::ResponseCodePtr&, const Ice::Current&);
+ void removeBridge(const AsteriskSCF::System::V1::OperationContextPtr &, const AsteriskSCF::SessionCommunications::V1::SessionListenerPrx& listener, const Ice::Current &);
+ void setCookies(const AsteriskSCF::System::V1::OperationContextPtr &, const AsteriskSCF::SessionCommunications::V1::SessionCookies&, const Ice::Current&) { };
+ void removeCookies(const AsteriskSCF::System::V1::OperationContextPtr &, const AsteriskSCF::SessionCommunications::V1::SessionCookies&, const Ice::Current&) { };
void getCookies_async(
const AsteriskSCF::SessionCommunications::V1::AMD_Session_getCookiesPtr& cb,
@@ -70,11 +72,13 @@ public:
const Ice::Current &);
void setBridge_async(
const AsteriskSCF::SessionCommunications::V1::AMD_Session_setBridgePtr& cb,
+ const AsteriskSCF::System::V1::OperationContextPtr &,
const AsteriskSCF::SessionCommunications::V1::BridgePrx& bridge,
const AsteriskSCF::SessionCommunications::V1::SessionListenerPrx& listener,
const Ice::Current &);
void removeBridge_async(
const AsteriskSCF::SessionCommunications::V1::AMD_Session_removeBridgePtr& cb,
+ const AsteriskSCF::System::V1::OperationContextPtr &,
const AsteriskSCF::SessionCommunications::V1::SessionListenerPrx& listener,
const Ice::Current &);
@@ -84,11 +88,13 @@ public:
void setAndGetSessionController_async(
const AsteriskSCF::SessionCommunications::V1::AMD_Session_setAndGetSessionControllerPtr&,
+ const AsteriskSCF::System::V1::OperationContextPtr &,
const AsteriskSCF::SessionCommunications::V1::SessionControllerPrx&,
const Ice::Current&);
void removeSessionController_async(
const AsteriskSCF::SessionCommunications::V1::AMD_Session_removeSessionControllerPtr&,
+ const AsteriskSCF::System::V1::OperationContextPtr &,
const AsteriskSCF::SessionCommunications::V1::SessionControllerPrx&,
const Ice::Current&);
diff --git a/test/MockSessionEndpoint.cpp b/test/MockSessionEndpoint.cpp
index 2626809..cf7a110 100644
--- a/test/MockSessionEndpoint.cpp
+++ b/test/MockSessionEndpoint.cpp
@@ -17,11 +17,14 @@
#include <boost/test/test_tools.hpp>
#include <Ice/Ice.h>
+#include <AsteriskSCF/Operations/OperationContext.h>
#include "MockSessionEndpoint.h"
#include "SharedTestData.h"
using namespace AsteriskSCF::SessionCommunications::V1;
using namespace AsteriskSCF::SessionCommunications::ExtensionPoints::V1;
+using namespace AsteriskSCF::Operations;
+using namespace AsteriskSCF::System::V1;
using namespace std;
namespace AsteriskSCF
@@ -37,6 +40,7 @@ MockSessionEndpoint::MockSessionEndpoint(const std::string& id) :
}
SessionPrx MockSessionEndpoint::createSession(
+ const OperationContextPtr& operationContext,
const string& dest,
const SessionListenerPrx&,
const SessionCreationHookPrx&,
@@ -68,23 +72,25 @@ void MockSessionEndpoint::setProxy(const SessionEndpointPrx& proxy)
mProxy = proxy;
}
-void MockSessionEndpoint::addDefaultSessionListener(const SessionListenerPrx& listener, const Ice::Current& )
+void MockSessionEndpoint::addDefaultSessionListener(const OperationContextPtr& operationContext, const SessionListenerPrx& listener, const Ice::Current& )
{
mDefaultSessionListeners.add(listener);
}
-void MockSessionEndpoint::removeDefaultSessionListener(const SessionListenerPrx& listener, const Ice::Current&)
+void MockSessionEndpoint::removeDefaultSessionListener(const OperationContextPtr& operationContext, const SessionListenerPrx& listener, const Ice::Current&)
{
mDefaultSessionListeners.remove(listener);
}
void MockSessionEndpoint::addDefaultSessionCookies(
+ const OperationContextPtr& operationContext,
const AsteriskSCF::SessionCommunications::V1::SessionCookies&,
const Ice::Current&)
{
}
void MockSessionEndpoint::removeDefaultSessionCookies(
+ const OperationContextPtr& operationContext,
const AsteriskSCF::SessionCommunications::V1::SessionCookies&,
const Ice::Current&)
{
diff --git a/test/MockSessionEndpoint.h b/test/MockSessionEndpoint.h
index 4743dc0..86c748c 100644
--- a/test/MockSessionEndpoint.h
+++ b/test/MockSessionEndpoint.h
@@ -38,22 +38,29 @@ public:
// Overrides
AsteriskSCF::SessionCommunications::V1::SessionPrx createSession(
+ const AsteriskSCF::System::V1::OperationContextPtr &,
const std::string& dest,
const AsteriskSCF::SessionCommunications::V1::SessionListenerPrx& listener,
const AsteriskSCF::SessionCommunications::ExtensionPoints::V1::SessionCreationHookPrx&,
const Ice::Current&);
AsteriskSCF::SessionCommunications::V1::SessionSeq getSessions(const Ice::Current&);
- void addDefaultSessionListener(const AsteriskSCF::SessionCommunications::V1::SessionListenerPrx& listener,
- const Ice::Current& current);
- void removeDefaultSessionListener(const AsteriskSCF::SessionCommunications::V1::SessionListenerPrx& listener,
- const Ice::Current&);
+ void addDefaultSessionListener(
+ const AsteriskSCF::System::V1::OperationContextPtr &,
+ const AsteriskSCF::SessionCommunications::V1::SessionListenerPrx& listener,
+ const Ice::Current& current);
+ void removeDefaultSessionListener(
+ const AsteriskSCF::System::V1::OperationContextPtr &,
+ const AsteriskSCF::SessionCommunications::V1::SessionListenerPrx& listener,
+ const Ice::Current&);
void addDefaultSessionCookies(
- const AsteriskSCF::SessionCommunications::V1::SessionCookies& cookies,
- const Ice::Current&);
+ const AsteriskSCF::System::V1::OperationContextPtr &,
+ const AsteriskSCF::SessionCommunications::V1::SessionCookies& cookies,
+ const Ice::Current&);
void removeDefaultSessionCookies(
- const AsteriskSCF::SessionCommunications::V1::SessionCookies& cookies,
- const Ice::Current&);
+ const AsteriskSCF::System::V1::OperationContextPtr &,
+ const AsteriskSCF::SessionCommunications::V1::SessionCookies& cookies,
+ const Ice::Current&);
public:
// Implementation
diff --git a/test/TestRouting.cpp b/test/TestRouting.cpp
index ed56162..12a8eb7 100644
--- a/test/TestRouting.cpp
+++ b/test/TestRouting.cpp
@@ -28,6 +28,7 @@
#include <AsteriskSCF/Core/Routing/RoutingIf.h>
#include <AsteriskSCF/Core/Discovery/ServiceLocatorIf.h>
#include <AsteriskSCF/SessionCommunications/SessionCommunicationsIf.h>
+#include <AsteriskSCF/Operations/OperationContext.h>
#include "SharedTestData.h"
#include "MockBridge.h"
@@ -44,6 +45,7 @@ using namespace AsteriskSCF::Core::Discovery::V1;
using namespace AsteriskSCF::RoutingTest;
using namespace AsteriskSCF::System::Component::V1;
using namespace AsteriskSCF::System::V1;
+using namespace AsteriskSCF::Operations;
/**
* Instantiate our shared data.
@@ -156,7 +158,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(AsteriskSCF::Operations::createContext());
+ SharedTestData::instance.serviceReplicaMgmt->activate(createContext());
// Get a ref to the Replica interface and cache it for testing.
Ice::ObjectPrx replicaObj2 = SharedTestData::instance.communicatorOut->propertyToProxy("BackupReplica.Proxy");
@@ -207,7 +209,7 @@ struct GlobalIceFixture
SharedTestData::instance.communicatorIn->getProperties()->getProperty("BridgeManager.ServiceLocatorId")));
BridgeManagerPrx bridgeManagerPrx = BridgeManagerPrx::checkedCast(bridgeManagerObject);
ServiceManagementPrx management = ServiceManagementPrx::uncheckedCast(
- SharedTestData::instance.serviceLocatorManagement->addService(AsteriskSCF::Operations::createContext(), bridgeManagerPrx, "BridgeService"));
+ SharedTestData::instance.serviceLocatorManagement->addService(createContext(), bridgeManagerPrx, "BridgeService"));
std::string serviceName =SharedTestData::instance.communicatorIn->getProperties()->getPropertyWithDefault(
@@ -215,7 +217,7 @@ struct GlobalIceFixture
ServiceLocatorParamsPtr genericparams = new ServiceLocatorParams();
genericparams->category = BridgeManagerDiscoveryCategory;
genericparams->service = serviceName;
- management->addLocatorParams(genericparams, "");
+ management->addLocatorParams(createContext(), genericparams, "");
}
@@ -251,9 +253,9 @@ public:
BOOST_TEST_MESSAGE("PerTestFixture ctor entered.");
PopulateEndpoints();
- SharedTestData::instance.componentTest->clearTestModes(AsteriskSCF::Operations::createContext());
+ SharedTestData::instance.componentTest->clearTestModes(createContext());
- SharedTestData::instance.locatorRegistry->addEndpointLocator(AsteriskSCF::Operations::createContext(), "TestChannel", SharedTestData::instance.regExIds, SharedTestData::instance.endpointLocatorPrx);
+ SharedTestData::instance.locatorRegistry->addEndpointLocator(createContext(), "TestChannel", SharedTestData::instance.regExIds, SharedTestData::instance.endpointLocatorPrx);
BOOST_TEST_MESSAGE("PerTestFixture ctor done.");
}
catch (...)
@@ -267,7 +269,7 @@ public:
try
{
BOOST_TEST_MESSAGE("PerTestFixture destructor entered.");
- SharedTestData::instance.locatorRegistry->removeEndpointLocator(AsteriskSCF::Operations::createContext(), "TestChannel");
+ SharedTestData::instance.locatorRegistry->removeEndpointLocator(createContext(), "TestChannel");
BOOST_TEST_MESSAGE("PerTestFixture destructor....removeEndpointLocator() done.");
SharedTestData::instance.endpointLocator->perTestCleanup();
BOOST_TEST_MESSAGE("PerTestFixture destructor done.");
@@ -307,7 +309,7 @@ BOOST_AUTO_TEST_CASE(AddAndRemoveEndpointLocator)
{
try
{
- SharedTestData::instance.locatorRegistry->addEndpointLocator(AsteriskSCF::Operations::createContext(), "TestChannel", SharedTestData::instance.regExIds, SharedTestData::instance.endpointLocatorPrx);
+ SharedTestData::instance.locatorRegistry->addEndpointLocator(createContext(), "TestChannel", SharedTestData::instance.regExIds, SharedTestData::instance.endpointLocatorPrx);
}
catch (...)
{
@@ -316,7 +318,7 @@ BOOST_AUTO_TEST_CASE(AddAndRemoveEndpointLocator)
try
{
- SharedTestData::instance.locatorRegistry->removeEndpointLocator(AsteriskSCF::Operations::createContext(), "TestChannel");
+ SharedTestData::instance.locatorRegistry->removeEndpointLocator(createContext(), "TestChannel");
}
catch (...)
{
@@ -333,8 +335,8 @@ BOOST_AUTO_TEST_CASE(AddEndpointLocatorTwice)
{
try
{
- 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);
+ SharedTestData::instance.locatorRegistry->addEndpointLocator(createContext(), "TestChannel", SharedTestData::instance.regExIds, SharedTestData::instance.endpointLocatorPrx);
+ SharedTestData::instance.locatorRegistry->addEndpointLocator(createContext(), "TestChannel", SharedTestData::instance.regExIds, SharedTestData::instance.endpointLocatorPrx);
}
catch (...)
{
@@ -343,7 +345,7 @@ BOOST_AUTO_TEST_CASE(AddEndpointLocatorTwice)
try
{
- SharedTestData::instance.locatorRegistry->removeEndpointLocator(AsteriskSCF::Operations::createContext(), "TestChannel");
+ SharedTestData::instance.locatorRegistry->removeEndpointLocator(createContext(), "TestChannel");
}
catch (...)
{
@@ -392,13 +394,13 @@ BOOST_FIXTURE_TEST_CASE(RouteSession, PerTestFixture)
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(createContext(), "102", 0, 0, Ice::Current());
BOOST_CHECK(session != 0);
SharedTestData::instance.mBridgeConnected = false;
BOOST_TEST_MESSAGE("Routing the session...");
- SharedTestData::instance.sessionRouter->routeSession(AsteriskSCF::Operations::createContext(), session, "102", 0, session->getCaller(), session->getRedirections());
+ SharedTestData::instance.sessionRouter->routeSession(createContext(), session, "102", 0, session->getCaller(), session->getRedirections());
BOOST_CHECK(SharedTestData::instance.mBridgeConnected);
@@ -446,21 +448,21 @@ BOOST_FIXTURE_TEST_CASE(BlindTransfer, PerTestFixture)
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(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(AsteriskSCF::Operations::createContext(), session, "102", 0, session->getCaller(), session->getRedirections());
+ SharedTestData::instance.sessionRouter->routeSession(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(AsteriskSCF::Operations::createContext(), session, "103", true, 0);
+ SharedTestData::instance.sessionRouter->connectBridgedSessionsWithDestination(createContext(), session, "103", true, 0);
BOOST_CHECK(SharedTestData::instance.mSessionReplaced);
@@ -504,13 +506,13 @@ BOOST_FIXTURE_TEST_CASE(AttendedTransfer, PerTestFixture)
MockSessionEndpointPtr session101Endpoint = SharedTestData::instance.endpointLocator->localLookup("101");
BOOST_TEST_MESSAGE("Creating a session on our test endpoint...");
- SessionPrx session101 = session101Endpoint->createSession("102", 0, 0, Ice::Current());
+ SessionPrx session101 = session101Endpoint->createSession(createContext(), "102", 0, 0, Ice::Current());
BOOST_CHECK(session101 != 0);
SharedTestData::instance.mBridgeConnected = false;
BOOST_TEST_MESSAGE("Routing for the first pair...");
- SharedTestData::instance.sessionRouter->routeSession(AsteriskSCF::Operations::createContext(), session101, "102", 0, session101->getCaller(), session101->getRedirections());
+ SharedTestData::instance.sessionRouter->routeSession(createContext(), session101, "102", 0, session101->getCaller(), session101->getRedirections());
BOOST_CHECK(SharedTestData::instance.mBridgeConnected);
@@ -518,7 +520,7 @@ BOOST_FIXTURE_TEST_CASE(AttendedTransfer, PerTestFixture)
MockSessionEndpointPtr session103Endpoint = SharedTestData::instance.endpointLocator->localLookup("103");
BOOST_TEST_MESSAGE("Creating a session on our next endpoint...");
- SessionPrx session103 = session103Endpoint->createSession("104", 0, 0, Ice::Current());
+ SessionPrx session103 = session103Endpoint->createSession(createContext(), "104", 0, 0, Ice::Current());
BOOST_CHECK(session103 != 0);
SharedTestData::instance.mBridgeConnected = false;
@@ -526,13 +528,13 @@ BOOST_FIXTURE_TEST_CASE(AttendedTransfer, PerTestFixture)
BOOST_TEST_MESSAGE("Routing the second pair...");
- SharedTestData::instance.sessionRouter->routeSession(AsteriskSCF::Operations::createContext(), session103, "104", 0, session103->getCaller(), session103->getRedirections());
+ SharedTestData::instance.sessionRouter->routeSession(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(AsteriskSCF::Operations::createContext(), session101, session103, true);
+ SharedTestData::instance.sessionRouter->connectBridgedSessions(createContext(), session101, session103, true);
BOOST_CHECK(SharedTestData::instance.mSessionReplaced);
@@ -585,7 +587,7 @@ BOOST_FIXTURE_TEST_CASE(ChangeLocatorIds, PerTestFixture)
// Tell the routing service we have different destination ids
try
{
- SharedTestData::instance.locatorRegistry->setEndpointLocatorDestinationIds(AsteriskSCF::Operations::createContext(), "TestChannel", SharedTestData::instance.regExIds);
+ SharedTestData::instance.locatorRegistry->setEndpointLocatorDestinationIds(createContext(), "TestChannel", SharedTestData::instance.regExIds);
}
catch (...)
{
@@ -625,11 +627,11 @@ BOOST_FIXTURE_TEST_CASE(SwitchActiveAndStandby, PerTestFixture)
BOOST_CHECK(SharedTestData::instance.backupServiceReplicaMgmt->isActive() == false);
// Switch the active to standby.
- SharedTestData::instance.serviceReplicaMgmt->standby(AsteriskSCF::Operations::createContext());
+ SharedTestData::instance.serviceReplicaMgmt->standby(createContext());
BOOST_CHECK(SharedTestData::instance.serviceReplicaMgmt->isActive() == false);
// Switch back to active.
- SharedTestData::instance.serviceReplicaMgmt->activate(AsteriskSCF::Operations::createContext());
+ SharedTestData::instance.serviceReplicaMgmt->activate(createContext());
BOOST_CHECK(SharedTestData::instance.serviceReplicaMgmt->isActive() == true);
}
catch (...)
@@ -650,7 +652,7 @@ BOOST_FIXTURE_TEST_CASE(BackupEndpointLocatorActive, PerTestFixture)
IceUtil::ThreadControl::sleep(IceUtil::Time::milliSeconds(1000));
// Make the backup active.
- SharedTestData::instance.backupServiceReplicaMgmt->activate(AsteriskSCF::Operations::createContext());
+ SharedTestData::instance.backupServiceReplicaMgmt->activate(createContext());
BOOST_CHECK(SharedTestData::instance.backupServiceReplicaMgmt->isActive() == true);
// Do a lookup on it now that it's active.
@@ -662,7 +664,7 @@ BOOST_FIXTURE_TEST_CASE(BackupEndpointLocatorActive, PerTestFixture)
BOOST_CHECK(seq[0]->getId() == lookupVal);
// Set the backup back into standby mode.
- SharedTestData::instance.backupServiceReplicaMgmt->standby(AsteriskSCF::Operations::createContext());
+ SharedTestData::instance.backupServiceReplicaMgmt->standby(createContext());
BOOST_CHECK(SharedTestData::instance.backupServiceReplicaMgmt->isActive() == false);
}
@@ -702,13 +704,13 @@ BOOST_FIXTURE_TEST_CASE(FailoverRouteSession, PerTestFixture)
BOOST_CHECK(SharedTestData::instance.serviceReplicaMgmt->isActive() == true);
BOOST_CHECK(SharedTestData::instance.backupServiceReplicaMgmt->isActive() == false);
- SharedTestData::instance.componentTest->setTestMode(AsteriskSCF::Operations::createContext(), "RouteSessionFailover");
+ SharedTestData::instance.componentTest->setTestMode(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(AsteriskSCF::Operations::createContext(), "102", 0, 0, Ice::Current());
+ SessionPrx session = session101Endpoint->createSession(createContext(), "102", 0, 0, Ice::Current());
BOOST_CHECK(session != 0);
SharedTestData::instance.mBridgeConnected = false;
@@ -717,7 +719,7 @@ BOOST_FIXTURE_TEST_CASE(FailoverRouteSession, PerTestFixture)
// 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(AsteriskSCF::Operations::createContext(), session, "102", 0, session->getCaller(), session->getRedirections());
+ SharedTestData::instance.sessionRouter->begin_routeSession(createContext(), session, "102", 0, session->getCaller(), session->getRedirections());
for (int counter=0; SharedTestData::instance.endpointLocator->mLookupCalled == false; counter++)
{
@@ -742,11 +744,11 @@ BOOST_FIXTURE_TEST_CASE(FailoverRouteSession, PerTestFixture)
SharedTestData::instance.endpointLocator->mLookupCalled = false;
// Switch standby component to active.
- SharedTestData::instance.serviceReplicaMgmt->activate(AsteriskSCF::Operations::createContext());
+ SharedTestData::instance.serviceReplicaMgmt->activate(createContext());
BOOST_CHECK(SharedTestData::instance.serviceReplicaMgmt->isActive() == true);
// Let the backup session router try to route using same operationId.
- SharedTestData::instance.backupSessionRouter->routeSession(AsteriskSCF::Operations::createContext(), session, "102", 0, session->getCaller(), session->getRedirections());
+ SharedTestData::instance.backupSessionRouter->routeSession(createContext(), session, "102", 0, session->getCaller(), session->getRedirections());
// The lookup should not be done again.
BOOST_CHECK(!SharedTestData::instance.endpointLocator->mLookupCalled);
@@ -754,7 +756,7 @@ BOOST_FIXTURE_TEST_CASE(FailoverRouteSession, PerTestFixture)
BOOST_CHECK(SharedTestData::instance.mBridgeConnected == true);
// Set the backup back into standby mode.
- SharedTestData::instance.backupServiceReplicaMgmt->standby(AsteriskSCF::Operations::createContext());
+ SharedTestData::instance.backupServiceReplicaMgmt->standby(createContext());
BOOST_CHECK(SharedTestData::instance.backupServiceReplicaMgmt->isActive() == false);
}
catch (...)
@@ -789,20 +791,20 @@ BOOST_FIXTURE_TEST_CASE(FailoverConnectBridgedSessWithDest, PerTestFixture)
BOOST_CHECK(SharedTestData::instance.serviceReplicaMgmt->isActive() == true);
BOOST_CHECK(SharedTestData::instance.backupServiceReplicaMgmt->isActive() == false);
- SharedTestData::instance.componentTest->setTestMode(AsteriskSCF::Operations::createContext(), "ConnectBridgedSessWithDestFailover");
+ SharedTestData::instance.componentTest->setTestMode(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(AsteriskSCF::Operations::createContext(), "102", 0, 0, Ice::Current());
+ SessionPrx session = session101Endpoint->createSession(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(AsteriskSCF::Operations::createContext(), session, "102", 0, session->getCaller(), session->getRedirections());
+ SharedTestData::instance.sessionRouter->routeSession(createContext(), session, "102", 0, session->getCaller(), session->getRedirections());
BridgePrx bridge = session->getBridge();
BOOST_CHECK(bridge != 0);
@@ -810,7 +812,7 @@ BOOST_FIXTURE_TEST_CASE(FailoverConnectBridgedSessWithDest, PerTestFixture)
// Now transfer to a new extension. In our test mode, this operation will never complete.
- SharedTestData::instance.sessionRouter->begin_connectBridgedSessionsWithDestination(AsteriskSCF::Operations::createContext(), session, "103", true, 0);
+ SharedTestData::instance.sessionRouter->begin_connectBridgedSessionsWithDestination(createContext(), session, "103", true, 0);
for (int counter=0; SharedTestData::instance.mSessionReplaced == false; counter++)
{
@@ -837,11 +839,11 @@ BOOST_FIXTURE_TEST_CASE(FailoverConnectBridgedSessWithDest, PerTestFixture)
IceUtil::ThreadControl::sleep(IceUtil::Time::milliSeconds(1000));
// Switch standby component to active.
- SharedTestData::instance.serviceReplicaMgmt->activate(AsteriskSCF::Operations::createContext());
+ SharedTestData::instance.serviceReplicaMgmt->activate(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(AsteriskSCF::Operations::createContext(), session, "103", true, 0);
+ SharedTestData::instance.backupSessionRouter->connectBridgedSessionsWithDestination(createContext(), session, "103", true, 0);
// The lookup should not be done again.
BOOST_CHECK(SharedTestData::instance.endpointLocator->mLookupCalled == false);
@@ -850,7 +852,7 @@ BOOST_FIXTURE_TEST_CASE(FailoverConnectBridgedSessWithDest, PerTestFixture)
BOOST_CHECK(SharedTestData::instance.mSessionReplaced == false);
// Set the backup back into standby mode.
- SharedTestData::instance.backupServiceReplicaMgmt->standby(AsteriskSCF::Operations::createContext());
+ SharedTestData::instance.backupServiceReplicaMgmt->standby(createContext());
BOOST_CHECK(SharedTestData::instance.backupServiceReplicaMgmt->isActive() == false);
}
catch (...)
-----------------------------------------------------------------------
--
asterisk-scf/integration/routing.git
More information about the asterisk-scf-commits
mailing list