doPublish(3, oid);
assertEquals("wrong number of updates received", 3, this.updateInterceptor.waitOnUpdate(500L));
this.updateInterceptor.clear();
String getOid = "__cmd:client/" + this.sessionName + "/?dispatcherActive=one,two,three";
MsgUnit[] msg = this.glob.getXmlBlasterAccess().get(new GetKey(this.glob, getOid), new GetQos(this.glob));
assertEquals("wrong number of messages returned", 1, msg.length);
for (int i=0; i < msg.length; i++) {
log.info("testActivationFlag: dispatcherActive: (" + i + ") : '" + msg[i].getContentStr() + "'");
assertEquals("wrong return value", "true", msg[i].getContentStr());
}
getOid = "__cmd:client/" + this.sessionName + "/?dispatcherActive=false";
doPublish(-1, getOid);
getOid = "__cmd:client/" + this.sessionName + "/?dispatcherActive";
msg = this.glob.getXmlBlasterAccess().get(new GetKey(this.glob, getOid), new GetQos(this.glob));
assertEquals("wrong number of messages returned", 1, msg.length);
for (int i=0; i < msg.length; i++) {
log.info("testActivationFlag: dispatcherActive (result): (" + i + ") : '" + msg[i].getContentStr() + "'");
assertEquals("wrong return value", "false", msg[i].getContentStr());
}
doPublish(4, oid);
doPublish(5, oid);
int numArrived = this.updateInterceptor.waitOnUpdate(2000L);
assertEquals("wrong number of messages arrived", 0, numArrived);
getOid = "__cmd:client/" + this.sessionName + "/?dispatcherActive=true";
doPublish(-1, getOid);
getOid = "__cmd:client/" + this.sessionName + "/?dispatcherActive";
msg = this.glob.getXmlBlasterAccess().get(new GetKey(this.glob, getOid), new GetQos(this.glob));
assertEquals("wrong number of messages returned", 1, msg.length);
for (int i=0; i < msg.length; i++) {
log.info("testActivationFlag: dispatcherActive (result): (" + i + ") : '" + msg[i].getContentStr() + "'");
assertEquals("wrong return value", "true", msg[i].getContentStr());
}