use of org.apache.rocketmq.test.factory.TagMessage in project rocketmq-rocketmq-all-4.1.0-incubating by lirenzuo.
the class MulTagSubIT method testNoMatch.
@Test
public void testNoMatch() {
String[] tags = { "jueyin1", "jueyin2", "jueyin3" };
String subExpress = "no_match";
int msgSize = 10;
TagMessage tagMessage = new TagMessage(tags, topic, msgSize);
RMQNormalConsumer consumer = getConsumer(nsAddr, topic, subExpress, new RMQNormalListner());
producer.send(tagMessage.getMixedTagMessages());
Assert.assertEquals("Not all sent succeeded", msgSize * tags.length, producer.getAllUndupMsgBody().size());
TestUtils.waitForSeconds(5);
assertThat(VerifyUtils.getFilterdMessage(producer.getAllMsgBody(), consumer.getListner().getAllMsgBody()).size()).isEqualTo(0);
}
use of org.apache.rocketmq.test.factory.TagMessage in project rocketmq-rocketmq-all-4.1.0-incubating by lirenzuo.
the class MulTagSubIT method testSubThreeTabAndMatchTwo.
@Test
public void testSubThreeTabAndMatchTwo() {
String[] tags = { "jueyin1", "jueyin2", "jueyin3" };
String subExpress = String.format("%s||%s", tags[0], tags[1]);
int msgSize = 10;
TagMessage tagMessage = new TagMessage(tags, topic, msgSize);
RMQNormalConsumer consumer = getConsumer(nsAddr, topic, subExpress, new RMQNormalListner());
producer.send(tagMessage.getMixedTagMessages());
Assert.assertEquals("Not all sent succeeded", msgSize * tags.length, producer.getAllUndupMsgBody().size());
consumer.getListner().waitForMessageConsume(tagMessage.getMessageBodyByTag(tags[0], tags[1]), consumeTime);
assertThat(VerifyUtils.getFilterdMessage(producer.getAllMsgBody(), consumer.getListner().getAllMsgBody())).containsExactlyElementsIn(tagMessage.getMessageBodyByTag(tags[0], tags[1]));
}
use of org.apache.rocketmq.test.factory.TagMessage in project rocketmq by apache.
the class MulTagSubIT method testSubTwoTabAndMatchTwo.
@Test
public void testSubTwoTabAndMatchTwo() {
String[] tags = { "jueyin1", "jueyin2" };
String subExpress = String.format("%s||%s", tags[0], tags[1]);
int msgSize = 10;
TagMessage tagMessage = new TagMessage(tags, topic, msgSize);
RMQNormalConsumer consumer = getConsumer(nsAddr, topic, subExpress, new RMQNormalListener());
producer.send(tagMessage.getMixedTagMessages());
Assert.assertEquals("Not all sent succeeded", msgSize * tags.length, producer.getAllUndupMsgBody().size());
consumer.getListener().waitForMessageConsume(producer.getAllMsgBody(), consumeTime);
assertThat(VerifyUtils.getFilterdMessage(producer.getAllMsgBody(), consumer.getListener().getAllMsgBody())).containsExactlyElementsIn(tagMessage.getAllTagMessageBody());
}
use of org.apache.rocketmq.test.factory.TagMessage in project rocketmq by apache.
the class MulTagSubIT method testSubThreeTabAndMatchTwo.
@Test
public void testSubThreeTabAndMatchTwo() {
String[] tags = { "jueyin1", "jueyin2", "jueyin3" };
String subExpress = String.format("%s||%s", tags[0], tags[1]);
int msgSize = 10;
TagMessage tagMessage = new TagMessage(tags, topic, msgSize);
RMQNormalConsumer consumer = getConsumer(nsAddr, topic, subExpress, new RMQNormalListener());
producer.send(tagMessage.getMixedTagMessages());
Assert.assertEquals("Not all sent succeeded", msgSize * tags.length, producer.getAllUndupMsgBody().size());
consumer.getListener().waitForMessageConsume(tagMessage.getMessageBodyByTag(tags[0], tags[1]), consumeTime);
assertThat(VerifyUtils.getFilterdMessage(producer.getAllMsgBody(), consumer.getListener().getAllMsgBody())).containsExactlyElementsIn(tagMessage.getMessageBodyByTag(tags[0], tags[1]));
}
use of org.apache.rocketmq.test.factory.TagMessage in project rocketmq by apache.
the class MulTagSubIT method testNoMatch.
@Test
public void testNoMatch() {
String[] tags = { "jueyin1", "jueyin2", "jueyin3" };
String subExpress = "no_match";
int msgSize = 10;
TagMessage tagMessage = new TagMessage(tags, topic, msgSize);
RMQNormalConsumer consumer = getConsumer(nsAddr, topic, subExpress, new RMQNormalListener());
producer.send(tagMessage.getMixedTagMessages());
Assert.assertEquals("Not all sent succeeded", msgSize * tags.length, producer.getAllUndupMsgBody().size());
TestUtils.waitForSeconds(5);
assertThat(VerifyUtils.getFilterdMessage(producer.getAllMsgBody(), consumer.getListener().getAllMsgBody()).size()).isEqualTo(0);
}
Aggregations