use of org.springframework.integration.mongodb.rules.MongoDbAvailable in project spring-integration by spring-projects.
the class ConfigurableMongoDbMessageGroupStoreTests method messageGroupStoreLazyLoadPerformance.
@Test
@Ignore("The performance test. Enough slow. Also needs the release strategy changed to size() == 1000")
@MongoDbAvailable
public void messageGroupStoreLazyLoadPerformance() throws Exception {
cleanupCollections(new SimpleMongoDbFactory(new MongoClient(), "test"));
StopWatch watch = new StopWatch("Lazy-Load Performance");
int sequenceSize = 1000;
performLazyLoadEagerTest(watch, sequenceSize, true);
performLazyLoadEagerTest(watch, sequenceSize, false);
// System. out .println(watch.prettyPrint()); // checkstyle
}
use of org.springframework.integration.mongodb.rules.MongoDbAvailable in project spring-integration by spring-projects.
the class ConfigurableMongoDbMessageGroupStoreTests method testWithCustomConverter.
@Test
@MongoDbAvailable
public void testWithCustomConverter() throws Exception {
this.cleanupCollections(new SimpleMongoDbFactory(new MongoClient(), "test"));
ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext("ConfigurableMongoDbMessageStore-CustomConverter.xml", this.getClass());
context.refresh();
TestGateway gateway = context.getBean(TestGateway.class);
String result = gateway.service("foo");
assertEquals("FOO", result);
context.close();
}
use of org.springframework.integration.mongodb.rules.MongoDbAvailable in project spring-integration by spring-projects.
the class MongoDbMessageStoreClaimCheckIntegrationTests method stringPayload.
@Test
@MongoDbAvailable
public void stringPayload() throws Exception {
MongoDbFactory mongoDbFactory = new SimpleMongoDbFactory(new MongoClient(), "test");
MongoDbMessageStore messageStore = new MongoDbMessageStore(mongoDbFactory);
messageStore.afterPropertiesSet();
ClaimCheckInTransformer checkin = new ClaimCheckInTransformer(messageStore);
ClaimCheckOutTransformer checkout = new ClaimCheckOutTransformer(messageStore);
Message<?> originalMessage = MessageBuilder.withPayload("test1").build();
Message<?> claimCheckMessage = checkin.transform(originalMessage);
assertEquals(originalMessage.getHeaders().getId(), claimCheckMessage.getPayload());
Message<?> checkedOutMessage = checkout.transform(claimCheckMessage);
assertEquals(claimCheckMessage.getPayload(), checkedOutMessage.getHeaders().getId());
assertEquals(originalMessage.getPayload(), checkedOutMessage.getPayload());
assertEquals(originalMessage, checkedOutMessage);
}
use of org.springframework.integration.mongodb.rules.MongoDbAvailable in project spring-integration by spring-projects.
the class MongoDbMessageStoreClaimCheckIntegrationTests method objectPayloadConfigurable.
@Test
@MongoDbAvailable
public void objectPayloadConfigurable() throws Exception {
MongoDbFactory mongoDbFactory = new SimpleMongoDbFactory(new MongoClient(), "test");
ConfigurableMongoDbMessageStore messageStore = new ConfigurableMongoDbMessageStore(mongoDbFactory);
GenericApplicationContext testApplicationContext = TestUtils.createTestApplicationContext();
testApplicationContext.refresh();
messageStore.setApplicationContext(testApplicationContext);
messageStore.afterPropertiesSet();
ClaimCheckInTransformer checkin = new ClaimCheckInTransformer(messageStore);
ClaimCheckOutTransformer checkout = new ClaimCheckOutTransformer(messageStore);
Beverage payload = new Beverage();
payload.setName("latte");
payload.setShots(3);
payload.setIced(false);
Message<?> originalMessage = MessageBuilder.withPayload(payload).build();
Message<?> claimCheckMessage = checkin.transform(originalMessage);
assertEquals(originalMessage.getHeaders().getId(), claimCheckMessage.getPayload());
Message<?> checkedOutMessage = checkout.transform(claimCheckMessage);
assertEquals(originalMessage.getPayload(), checkedOutMessage.getPayload());
assertEquals(claimCheckMessage.getPayload(), checkedOutMessage.getHeaders().getId());
assertEquals(originalMessage, checkedOutMessage);
}
use of org.springframework.integration.mongodb.rules.MongoDbAvailable in project spring-integration by spring-projects.
the class MongoDbMessageStoreClaimCheckIntegrationTests method objectPayload.
@Test
@MongoDbAvailable
public void objectPayload() throws Exception {
MongoDbFactory mongoDbFactory = new SimpleMongoDbFactory(new MongoClient(), "test");
MongoDbMessageStore messageStore = new MongoDbMessageStore(mongoDbFactory);
messageStore.afterPropertiesSet();
ClaimCheckInTransformer checkin = new ClaimCheckInTransformer(messageStore);
ClaimCheckOutTransformer checkout = new ClaimCheckOutTransformer(messageStore);
Beverage payload = new Beverage();
payload.setName("latte");
payload.setShots(3);
payload.setIced(false);
Message<?> originalMessage = MessageBuilder.withPayload(payload).build();
Message<?> claimCheckMessage = checkin.transform(originalMessage);
assertEquals(originalMessage.getHeaders().getId(), claimCheckMessage.getPayload());
Message<?> checkedOutMessage = checkout.transform(claimCheckMessage);
assertEquals(originalMessage.getPayload(), checkedOutMessage.getPayload());
assertEquals(claimCheckMessage.getPayload(), checkedOutMessage.getHeaders().getId());
assertEquals(originalMessage, checkedOutMessage);
}
Aggregations