Skip to content

Commit

Permalink
Merge pull request #438 from ghillert/INT-2556
Browse files Browse the repository at this point in the history
  • Loading branch information
garyrussell committed May 14, 2012
2 parents f564204 + 1b03c40 commit 2486f0c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
Expand Up @@ -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();

Expand Down Expand Up @@ -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();

Expand Down Expand Up @@ -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();

Expand Down Expand Up @@ -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();

Expand Down Expand Up @@ -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();

Expand Down Expand Up @@ -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();

Expand Down Expand Up @@ -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();

Expand Down Expand Up @@ -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();

Expand Down
Expand Up @@ -33,12 +33,12 @@ public final class Consumer {

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);
}

Expand Down

0 comments on commit 2486f0c

Please sign in to comment.