INT-3895: Fix MonitorTests Race Condition
JIRA: https://jira.spring.io/browse/INT-3895 * `@Ignore` `DelayerUsageTests.testDelayWithCustomScheduler()` as very weak test. (We can consider it to remove at all: doesn't test anything from our side) * Add `LogAdjustingTestSupport` diagnostic to the `OutboundGatewayFunctionTests` Tentative commit to see more logs from Travis Additional diagnostics More STOMP Diagnostics
This commit is contained in:
committed by
Gary Russell
parent
fc0af2fed6
commit
1cc1b2ef79
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2013 the original author or authors.
|
||||
* Copyright 2002-2015 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.
|
||||
@@ -20,15 +20,17 @@ import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertNotNull;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
import org.junit.Ignore;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Qualifier;
|
||||
import org.springframework.integration.support.MessageBuilder;
|
||||
import org.springframework.messaging.Message;
|
||||
import org.springframework.messaging.MessageChannel;
|
||||
import org.springframework.messaging.PollableChannel;
|
||||
import org.springframework.messaging.support.GenericMessage;
|
||||
import org.springframework.integration.support.MessageBuilder;
|
||||
import org.springframework.test.context.ContextConfiguration;
|
||||
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
|
||||
|
||||
@@ -41,19 +43,23 @@ import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
|
||||
@ContextConfiguration
|
||||
public class DelayerUsageTests {
|
||||
|
||||
@Autowired @Qualifier("inputA")
|
||||
@Autowired
|
||||
@Qualifier("inputA")
|
||||
private MessageChannel inputA;
|
||||
|
||||
@Autowired
|
||||
private MessageChannel delayerInsideChain;
|
||||
|
||||
@Autowired @Qualifier("outputA")
|
||||
@Autowired
|
||||
@Qualifier("outputA")
|
||||
private PollableChannel outputA;
|
||||
|
||||
@Autowired @Qualifier("inputB")
|
||||
@Autowired
|
||||
@Qualifier("inputB")
|
||||
private MessageChannel inputB;
|
||||
|
||||
@Autowired @Qualifier("outputB1")
|
||||
@Autowired
|
||||
@Qualifier("outputB1")
|
||||
private PollableChannel outputB1;
|
||||
|
||||
@Autowired
|
||||
@@ -64,7 +70,7 @@ public class DelayerUsageTests {
|
||||
|
||||
|
||||
@Test
|
||||
public void testDelayWithDefaultScheduler(){
|
||||
public void testDelayWithDefaultScheduler() {
|
||||
long start = System.currentTimeMillis();
|
||||
inputA.send(new GenericMessage<String>("Hello"));
|
||||
assertNotNull(outputA.receive(10000));
|
||||
@@ -72,7 +78,7 @@ public class DelayerUsageTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testDelayWithDefaultSchedulerCustomDelayHeader(){
|
||||
public void testDelayWithDefaultSchedulerCustomDelayHeader() {
|
||||
MessageBuilder<String> builder = MessageBuilder.withPayload("Hello");
|
||||
// set custom delay header
|
||||
builder.setHeader("foo", 2000);
|
||||
@@ -83,7 +89,8 @@ public class DelayerUsageTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testDelayWithCustomScheduler(){
|
||||
@Ignore("Enough wonky test based on the timeout and hardware")
|
||||
public void testDelayWithCustomScheduler() {
|
||||
long start = System.currentTimeMillis();
|
||||
inputB.send(new GenericMessage<String>("1"));
|
||||
inputB.send(new GenericMessage<String>("2"));
|
||||
@@ -107,7 +114,7 @@ public class DelayerUsageTests {
|
||||
}
|
||||
|
||||
@Test //INT-1132
|
||||
public void testDelayerInsideChain(){
|
||||
public void testDelayerInsideChain() {
|
||||
long start = System.currentTimeMillis();
|
||||
delayerInsideChain.send(new GenericMessage<String>("Hello"));
|
||||
Message<?> message = outputA.receive(10000);
|
||||
@@ -126,10 +133,13 @@ public class DelayerUsageTests {
|
||||
assertEquals("test", message.getPayload());
|
||||
}
|
||||
|
||||
public static class SampleService{
|
||||
public static class SampleService {
|
||||
|
||||
public String processMessage(String message) throws Exception {
|
||||
Thread.sleep(500);
|
||||
return message;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user