Commit 87c3781c authored by Michal 'vorner' Vaner's avatar Michal 'vorner' Vaner
Browse files

[2862] Subscribe and unsubscribe on MCCS

parent 02e0859b
......@@ -575,6 +575,20 @@ public:
/// \param id The id of request as returned by groupRecvMsgAsync.
void cancelAsyncRecv(const AsyncRecvRequestID& id);
/// \brief Subscribe to a group
///
/// Wrapper around the CCSession::subscribe.
void subscribe(const std::string& group) {
session_.subscribe(group, isc::cc::CC_INSTANCE_WILDCARD);
}
/// \brief Unsubscribe from a group.
///
/// Wrapper around the CCSession::unsubscribe.
void unsubscribe(const std::string& group) {
session_.unsubscribe(group, isc::cc::CC_INSTANCE_WILDCARD);
}
private:
ModuleSpec readModuleSpecification(const std::string& filename);
void startCheck();
......
......@@ -157,6 +157,17 @@ TEST_F(CCSessionTest, notifyNoParams) {
session.getMsgQueue()->get(1)->toWire();
}
// Try to subscribe and unsubscribe once again
TEST_F(CCSessionTest, subscribe) {
ModuleCCSession mccs(ccspecfile("spec1.spec"), session, NULL, NULL, false,
false);
EXPECT_FALSE(session.haveSubscription("A group", "*"));
mccs.subscribe("A group");
EXPECT_TRUE(session.haveSubscription("A group", "*"));
mccs.unsubscribe("A group");
EXPECT_FALSE(session.haveSubscription("A group", "*"));
}
TEST_F(CCSessionTest, createAnswer) {
ConstElementPtr answer;
answer = createAnswer();
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment