INT-4240: Redis Delayer Test Diagnostics

https://jira.spring.io/browse/INT-4240
This commit is contained in:
Gary Russell
2017-03-08 15:18:49 -05:00
parent 2ca05b3c44
commit 6a883281f4
2 changed files with 9 additions and 3 deletions

View File

@@ -20,7 +20,7 @@
<delayer id="#{T (org.springframework.integration.redis.store.DelayerHandlerRescheduleIntegrationTests).DELAYER_ID}"
input-channel="input"
output-channel="output"
default-delay="10000"
default-delay="5000"
message-store="messageStore"/>
</beans:beans>

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2013-2016 the original author or authors.
* Copyright 2013-2017 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -24,6 +24,7 @@ import static org.junit.Assert.fail;
import java.util.concurrent.TimeUnit;
import org.apache.log4j.Level;
import org.junit.Rule;
import org.junit.Test;
@@ -36,6 +37,7 @@ import org.springframework.integration.redis.rules.RedisAvailableTests;
import org.springframework.integration.store.MessageGroup;
import org.springframework.integration.store.MessageGroupStore;
import org.springframework.integration.support.MessageBuilder;
import org.springframework.integration.test.rule.Log4jLevelAdjuster;
import org.springframework.integration.test.support.LongRunningIntegrationTest;
import org.springframework.messaging.Message;
import org.springframework.messaging.MessageChannel;
@@ -54,6 +56,10 @@ public class DelayerHandlerRescheduleIntegrationTests extends RedisAvailableTest
@Rule
public LongRunningIntegrationTest longTests = new LongRunningIntegrationTest();
@Rule
public Log4jLevelAdjuster adjuster = new Log4jLevelAdjuster(Level.DEBUG, "org.springframework.integration",
"org.springframework.data.redis");
@Test
@RedisAvailable
public void testDelayerHandlerRescheduleWithRedisMessageStore() throws Exception {
@@ -116,7 +122,7 @@ public class DelayerHandlerRescheduleIntegrationTests extends RedisAvailableTest
assertEquals(1, messageStore.getMessageGroupCount());
int n = 0;
while (n++ < 100 && messageStore.messageGroupSize(delayerMessageGroupId) > 0) {
while (n++ < 200 && messageStore.messageGroupSize(delayerMessageGroupId) > 0) {
Thread.sleep(100);
}
assertEquals(0, messageStore.messageGroupSize(delayerMessageGroupId));