Skip to content

Commit d3928b0

Browse files
committed
1 parent 5dfe57d commit d3928b0

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

spring-integration-redis/src/test/java/org/springframework/integration/redis/store/DelayerHandlerRescheduleIntegrationTests.java

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2013-2015 the original author or authors.
2+
* Copyright 2013-2017 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
55
* the License. You may obtain a copy of the License at
@@ -22,6 +22,7 @@
2222
import java.util.UUID;
2323
import java.util.concurrent.TimeUnit;
2424

25+
import org.apache.log4j.Level;
2526
import org.junit.Rule;
2627
import org.junit.Test;
2728

@@ -34,6 +35,7 @@
3435
import org.springframework.integration.store.MessageGroup;
3536
import org.springframework.integration.store.MessageGroupStore;
3637
import org.springframework.integration.support.MessageBuilder;
38+
import org.springframework.integration.test.rule.Log4jLevelAdjuster;
3739
import org.springframework.integration.test.support.LongRunningIntegrationTest;
3840
import org.springframework.messaging.Message;
3941
import org.springframework.messaging.MessageChannel;
@@ -52,6 +54,10 @@ public class DelayerHandlerRescheduleIntegrationTests extends RedisAvailableTest
5254
@Rule
5355
public LongRunningIntegrationTest longTests = new LongRunningIntegrationTest();
5456

57+
@Rule
58+
public Log4jLevelAdjuster adjuster = new Log4jLevelAdjuster(Level.DEBUG, "org.springframework.integration",
59+
"org.springframework.data.redis");
60+
5561
@Test
5662
@RedisAvailable
5763
public void testDelayerHandlerRescheduleWithRedisMessageStore() throws Exception {
@@ -75,7 +81,7 @@ public void testDelayerHandlerRescheduleWithRedisMessageStore() throws Exception
7581
(ThreadPoolTaskScheduler) IntegrationContextUtils.getTaskScheduler(context);
7682
taskScheduler.shutdown();
7783
taskScheduler.getScheduledExecutor().awaitTermination(10, TimeUnit.SECONDS);
78-
context.destroy();
84+
context.close();
7985

8086
try {
8187
context.getBean("input", MessageChannel.class);
@@ -114,13 +120,13 @@ public void testDelayerHandlerRescheduleWithRedisMessageStore() throws Exception
114120

115121
assertEquals(1, messageStore.getMessageGroupCount());
116122
int n = 0;
117-
while (n++ < 100 && messageStore.messageGroupSize(delayerMessageGroupId) > 0) {
123+
while (n++ < 200 && messageStore.messageGroupSize(delayerMessageGroupId) > 0) {
118124
Thread.sleep(100);
119125
}
120126
assertEquals(0, messageStore.messageGroupSize(delayerMessageGroupId));
121127

122128
messageStore.removeMessageGroup(delayerMessageGroupId);
123-
context.destroy();
129+
context.close();
124130
}
125131

126132
}

0 commit comments

Comments
 (0)