polishing Jdbc tests hoping to avoid intermittent failures
This commit is contained in:
Oleg Zhurakousky
2011-11-29 09:51:03 -05:00
parent c22ef922a5
commit d2920c3145
3 changed files with 5 additions and 5 deletions

View File

@@ -27,7 +27,7 @@
<bean id="storeQueue" class="org.springframework.integration.store.MessageGroupQueue">
<constructor-arg ref="messageStore" />
<constructor-arg value="input-queue" />
<constructor-arg value="JdbcMessageStoreChannelIntegrationTests" />
<property name="storeLock" ref="lock" />
</bean>

View File

@@ -27,7 +27,7 @@
<bean id="queue" class="org.springframework.integration.store.MessageGroupQueue">
<constructor-arg ref="messageStore" />
<constructor-arg value="input-queue" />
<constructor-arg value="JdbcMessageStoreChannelTests" />
</bean>
<service-activator id="service-activator" input-channel="input" output-channel="output" xmlns="http://www.springframework.org/schema/integration">

View File

@@ -58,7 +58,7 @@ public class JdbcMessageStoreChannelTests {
input.send(new GenericMessage<String>("foo"));
Service.await(10000);
assertEquals(1, Service.messages.size());
assertEquals(0, messageStore.getMessageGroup("input-queue").size());
assertEquals(0, messageStore.getMessageGroup("JdbcMessageStoreChannelTests").size());
}
@Test
@@ -69,7 +69,7 @@ public class JdbcMessageStoreChannelTests {
Service.await(10000);
assertEquals(1, Service.messages.size());
// After a rollback in the poller the message is still waiting to be delivered
assertEquals(1, messageStore.getMessageGroup("input-queue").size());
assertEquals(1, messageStore.getMessageGroup("JdbcMessageStoreChannelTests").size());
}
@Test
@@ -87,7 +87,7 @@ public class JdbcMessageStoreChannelTests {
// So no activation
assertEquals(0, Service.messages.size());
// But inside the transaction the message is still there
assertEquals(1, messageStore.getMessageGroup("input-queue").size());
assertEquals(1, messageStore.getMessageGroup("JdbcMessageStoreChannelTests").size());
}
public static class Service {