Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,11 @@ public Message receive(Destination destination, long timeout) {
return context.createConsumer(destination).receive(timeout);
}

@Override
public boolean shouldTestReceiveNoWait() {
return true;
}

@Override
public Message receiveNoWait(Destination destination) {
return context.createConsumer(destination).receiveNoWait();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,11 @@ public Message receive(Destination destination, long timeout) throws JMSExceptio
return session.createConsumer(destination).receive(timeout);
}

@Override
public boolean shouldTestReceiveNoWait() {
return false;
}

@Override
public Message receiveNoWait(Destination destination) throws JMSException {
return session.createConsumer(destination).receiveNoWait();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,5 +58,7 @@ interface BrokerFacade {

Message receive(Destination destination, long timeout) throws Exception;

boolean shouldTestReceiveNoWait();

Message receiveNoWait(Destination destination) throws Exception;
}
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,9 @@ public void testQueueSendReceiveOnTracedThread() throws Exception {

@Test
public void testQueueSendReceiveNoWaitOnTracedThread() throws Exception {
if (!brokerFacade.shouldTestReceiveNoWait()) {
return;
}
final Queue queue = createQueue();
testQueueSendReceiveOnTracedThread(() -> brokerFacade.receiveNoWait(queue), queue, true);
}
Expand All @@ -130,6 +133,9 @@ public void testQueueSendReceiveOnNonTracedThread() throws Exception {

@Test
public void testQueueSendReceiveNoWaitOnNonTracedThread() throws Exception {
if (!brokerFacade.shouldTestReceiveNoWait()) {
return;
}
final Queue queue = createQueue();
testQueueSendReceiveOnNonTracedThread(() -> brokerFacade.receiveNoWait(queue), queue, true);
}
Expand Down