clearing thread-local queue before each test method

This commit is contained in:
Mark Fisher
2010-04-29 19:29:16 +00:00
parent 785ad231bd
commit 2feb6bf81c

View File

@@ -24,6 +24,7 @@ import static org.junit.Assert.assertTrue;
import java.util.ArrayList;
import java.util.List;
import org.junit.Before;
import org.junit.Test;
import org.springframework.integration.core.Message;
@@ -34,6 +35,16 @@ import org.springframework.integration.message.StringMessage;
*/
public class ThreadLocalChannelTests {
@Before
public void clearThreadLocalQueue() {
ThreadLocalChannel channel = new ThreadLocalChannel();
Message<?> result = null;
do {
result = channel.receive(0);
} while (result != null);
}
@Test
public void testSendAndReceive() {
ThreadLocalChannel channel = new ThreadLocalChannel();