Permalink
Browse files

INT-2556 - Fix Test JpaPollingChannelAdapterTests

  • Loading branch information...
1 parent f564204 commit 1b03c40abc21734c229ff44a2f2c6a691cb394d6 Gunnar Hillert committed with garyrussell May 14, 2012
@@ -114,7 +114,7 @@ public void testWithEntityClass() throws Exception {
assertNotNull(message);
assertNotNull(message.getPayload());
- assertNotNull(message.getPayload() instanceof Collection<?>);
+ assertTrue(message.getPayload() instanceof Collection<?>);
Collection<?> primeNumbers = message.getPayload();
@@ -157,7 +157,7 @@ public void testWithJpaQuery() throws Exception {
assertNotNull(message);
assertNotNull(message.getPayload());
- assertNotNull(message.getPayload() instanceof Collection<?>);
+ assertTrue(message.getPayload() instanceof Collection<?>);
Collection<?> primeNumbers = message.getPayload();
@@ -201,7 +201,7 @@ public void testWithJpaQueryAndMaxResults() throws Exception {
assertNotNull(message);
assertNotNull(message.getPayload());
- assertNotNull(message.getPayload() instanceof Collection<?>);
+ assertTrue(message.getPayload() instanceof Collection<?>);
Collection<?> primeNumbers = message.getPayload();
@@ -244,7 +244,7 @@ public void testWithJpaQueryOneResultOnly() throws Exception {
assertNotNull(message);
assertNotNull(message.getPayload());
- assertNotNull(message.getPayload() instanceof Collection<?>);
+ assertTrue(message.getPayload() instanceof Collection<?>);
Collection<?> students = message.getPayload();
@@ -293,7 +293,7 @@ public void testWithJpaQueryAndDelete() throws Exception {
assertNotNull("Message is null.", message);
assertNotNull(message.getPayload());
- assertNotNull(message.getPayload() instanceof Collection<?>);
+ assertTrue(message.getPayload() instanceof Collection<?>);
Collection<?> students = message.getPayload();
@@ -376,7 +376,7 @@ public void testWithJpaQueryAndDeletePerRow() throws Exception {
assertNotNull("Message is null.", message);
assertNotNull(message.getPayload());
- assertNotNull(message.getPayload() instanceof Collection<?>);
+ assertTrue(message.getPayload() instanceof Collection<?>);
Collection<?> students = message.getPayload();
@@ -423,7 +423,7 @@ public void testWithNativeSqlQuery() throws Exception {
assertNotNull(message);
assertNotNull(message.getPayload());
- assertNotNull(message.getPayload() instanceof Collection<?>);
+ assertTrue(message.getPayload() instanceof Collection<?>);
Collection<?> students = message.getPayload();
@@ -466,7 +466,7 @@ public void testWithNamedQuery() throws Exception {
assertNotNull(message);
assertNotNull(message.getPayload());
- assertNotNull(message.getPayload() instanceof Collection<?>);
+ assertTrue(message.getPayload() instanceof Collection<?>);
Collection<?> students = message.getPayload();
@@ -33,12 +33,12 @@
private static final BlockingQueue<Message<Collection<?>>> MESSAGES = new LinkedBlockingQueue<Message<Collection<?>>>();
- public void receive(Message<Collection<?>>message) {
+ public synchronized void receive(Message<Collection<?>>message) {
logger.info("Service Activator received Message: " + message);
MESSAGES.add(message);
}
- public Message<Collection<?>> poll(long timeoutInMillis) throws InterruptedException {
+ public synchronized Message<Collection<?>> poll(long timeoutInMillis) throws InterruptedException {
return MESSAGES.poll(timeoutInMillis, TimeUnit.MILLISECONDS);
}

0 comments on commit 1b03c40

Please sign in to comment.