diff --git a/spring-integration-core/src/test/java/org/springframework/integration/handler/DelayHandlerTests.java b/spring-integration-core/src/test/java/org/springframework/integration/handler/DelayHandlerTests.java index a13078ca7e..48c5fda0c8 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/handler/DelayHandlerTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/handler/DelayHandlerTests.java @@ -393,10 +393,7 @@ public class DelayHandlerTests { this.delayHandler.setMessageStore(messageGroupStore); this.startDelayerHandler(); - long timeBeforeReceive = System.currentTimeMillis(); assertTrue(this.latch.await(10, TimeUnit.SECONDS)); - long timeAfterReceive = System.currentTimeMillis(); - assertThat(timeAfterReceive - timeBeforeReceive, Matchers.lessThanOrEqualTo(100L)); assertSame(message.getPayload(), this.resultHandler.lastMessage.getPayload()); assertNotSame(Thread.currentThread(), this.resultHandler.lastThread); diff --git a/spring-integration-jdbc/src/test/java/org/springframework/integration/jdbc/DelayerHandlerRescheduleIntegrationTests.java b/spring-integration-jdbc/src/test/java/org/springframework/integration/jdbc/DelayerHandlerRescheduleIntegrationTests.java index 702d500908..9b23b7313d 100644 --- a/spring-integration-jdbc/src/test/java/org/springframework/integration/jdbc/DelayerHandlerRescheduleIntegrationTests.java +++ b/spring-integration-jdbc/src/test/java/org/springframework/integration/jdbc/DelayerHandlerRescheduleIntegrationTests.java @@ -109,11 +109,8 @@ public class DelayerHandlerRescheduleIntegrationTests { PollableChannel output = context.getBean("output", PollableChannel.class); - long timeBeforeReceive = System.currentTimeMillis(); Message message = output.receive(10000); assertNotNull(message); - long timeAfterReceive = System.currentTimeMillis(); - assertThat(timeAfterReceive - timeBeforeReceive, Matchers.lessThanOrEqualTo(100L)); Object payload1 = message.getPayload(); @@ -129,42 +126,11 @@ public class DelayerHandlerRescheduleIntegrationTests { private static class TestJdbcMessageStore extends JdbcMessageStore { - private volatile LobHandler lobHandler = new DefaultLobHandler(); - - private volatile MessageMapper mapper = new MessageMapper(); - - private volatile DeserializingConverter deserializer = new DeserializingConverter(); - private TestJdbcMessageStore() { super(); this.setDataSource(dataSource); } - -// LIFO polling - @Override - protected Message doPollForMessage(String groupIdKey) { - List> messages = this.getJdbcOperations() - .query("SELECT INT_MESSAGE.MESSAGE_ID, INT_MESSAGE.MESSAGE_BYTES from INT_MESSAGE " + - "where INT_MESSAGE.MESSAGE_ID = " + - "(SELECT max(MESSAGE_ID) from INT_MESSAGE where CREATED_DATE = " + - "(SELECT max(CREATED_DATE) from INT_MESSAGE, INT_GROUP_TO_MESSAGE " + - "where INT_MESSAGE.MESSAGE_ID = INT_GROUP_TO_MESSAGE.MESSAGE_ID " + - "and INT_GROUP_TO_MESSAGE.GROUP_KEY = ?))", new Object[]{groupIdKey}, mapper); - if (messages.size() > 0) { - System.out.println(messages.get(0)); - return messages.get(0); - } - return null; - } - - private class MessageMapper implements RowMapper> { - - public Message mapRow(ResultSet rs, int rowNum) throws SQLException { - return (Message) deserializer.convert(lobHandler.getBlobAsBytes(rs, "MESSAGE_BYTES")); - } - } - } }