Add exception for timeout - easier to read failure in test
This commit is contained in:
@@ -26,7 +26,6 @@ import org.springframework.integration.support.MessageBuilder;
|
|||||||
import org.springframework.jdbc.core.JdbcOperations;
|
import org.springframework.jdbc.core.JdbcOperations;
|
||||||
import org.springframework.jdbc.core.JdbcTemplate;
|
import org.springframework.jdbc.core.JdbcTemplate;
|
||||||
import org.springframework.jdbc.core.RowMapper;
|
import org.springframework.jdbc.core.RowMapper;
|
||||||
import org.springframework.jdbc.core.namedparam.MapSqlParameterSource;
|
|
||||||
import org.springframework.jdbc.core.namedparam.SqlParameterSource;
|
import org.springframework.jdbc.core.namedparam.SqlParameterSource;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -26,7 +26,6 @@ import java.util.concurrent.TimeUnit;
|
|||||||
import org.junit.Before;
|
import org.junit.Before;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
import org.junit.runner.RunWith;
|
import org.junit.runner.RunWith;
|
||||||
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.integration.MessageChannel;
|
import org.springframework.integration.MessageChannel;
|
||||||
import org.springframework.integration.message.GenericMessage;
|
import org.springframework.integration.message.GenericMessage;
|
||||||
@@ -97,7 +96,9 @@ public class JdbcMessageStoreChannelTests {
|
|||||||
latch = new CountDownLatch(count);
|
latch = new CountDownLatch(count);
|
||||||
}
|
}
|
||||||
public static void await(long timeout) throws InterruptedException {
|
public static void await(long timeout) throws InterruptedException {
|
||||||
latch.await(timeout, TimeUnit.MILLISECONDS);
|
if (!latch.await(timeout, TimeUnit.MILLISECONDS)) {
|
||||||
|
throw new IllegalStateException("Timed out waiting for message");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
public String echo(String input) {
|
public String echo(String input) {
|
||||||
messages.add(input);
|
messages.add(input);
|
||||||
|
|||||||
Reference in New Issue
Block a user