INT-3311,INT-3377: Update Spring-* Dependencies

JIRA: https://jira.spring.io/browse/INT-3377
      https://jira.spring.io/browse/INT-3311

Resolve SD-Mongo deprecations
This commit is contained in:
Artem Bilan
2014-04-24 10:49:03 +03:00
committed by Gary Russell
parent 4c495a3bf5
commit d2e83e8280
13 changed files with 75 additions and 79 deletions

View File

@@ -59,7 +59,7 @@ subprojects { subproject ->
ext {
activeMqVersion = '5.9.0'
aspectjVersion = '1.8.0.M1'
aspectjVersion = '1.8.0'
apacheSshdVersion = '0.10.1'
commonsDbcpVersion = '1.4'
commonsIoVersion = '2.4'
@@ -99,14 +99,14 @@ subprojects { subproject ->
slf4jVersion = "1.7.6"
smackVersion = '3.2.1'
springAmqpVersion = project.hasProperty('springAmqpVersion') ? project.springAmqpVersion : '1.3.1.RELEASE'
springDataMongoVersion = '1.1.1.RELEASE'
springDataMongoVersion = '1.4.2.RELEASE'
springDataRedisVersion = '1.2.1.RELEASE'
springGemfireVersion = '1.3.1.RELEASE'
springSecurityVersion = '3.1.3.RELEASE'
springSocialTwitterVersion = '1.1.0.RC1'
springGemfireVersion = '1.3.4.RELEASE'
springSecurityVersion = '3.2.3.RELEASE'
springSocialTwitterVersion = '1.1.0.RELEASE'
springRetryVersion = '1.0.3.RELEASE'
springVersion = project.hasProperty('springVersion') ? project.springVersion : '4.0.3.RELEASE'
springWsVersion = '2.1.1.RELEASE'
springWsVersion = '2.1.4.RELEASE'
xmlUnitVersion = '1.5'
xstreamVersion = '1.4.7'
}

View File

@@ -23,6 +23,8 @@ import java.util.Map;
import java.util.Set;
import java.util.UUID;
import com.mongodb.DB;
import com.mongodb.MongoException;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -37,17 +39,18 @@ import org.springframework.core.convert.converter.GenericConverter;
import org.springframework.core.serializer.support.DeserializingConverter;
import org.springframework.core.serializer.support.SerializingConverter;
import org.springframework.dao.DataAccessException;
import org.springframework.data.domain.Sort;
import org.springframework.data.mongodb.MongoDbFactory;
import org.springframework.data.mongodb.core.DbCallback;
import org.springframework.data.mongodb.core.FindAndModifyOptions;
import org.springframework.data.mongodb.core.IndexOperations;
import org.springframework.data.mongodb.core.MongoTemplate;
import org.springframework.data.mongodb.core.convert.CustomConversions;
import org.springframework.data.mongodb.core.convert.DefaultDbRefResolver;
import org.springframework.data.mongodb.core.convert.MappingMongoConverter;
import org.springframework.data.mongodb.core.index.Index;
import org.springframework.data.mongodb.core.mapping.MongoMappingContext;
import org.springframework.data.mongodb.core.query.Criteria;
import org.springframework.data.mongodb.core.query.Order;
import org.springframework.data.mongodb.core.query.Query;
import org.springframework.data.mongodb.core.query.Update;
import org.springframework.integration.store.BasicMessageGroupStore;
@@ -58,9 +61,6 @@ import org.springframework.messaging.Message;
import org.springframework.messaging.MessageHeaders;
import org.springframework.util.Assert;
import com.mongodb.DB;
import com.mongodb.MongoException;
/**
* The abstract MongoDB {@link BasicMessageGroupStore} implementation to provide configuration for common options
* for implementations of this class.
@@ -129,7 +129,8 @@ public abstract class AbstractConfigurableMongoDbMessageStore implements BasicMe
public void afterPropertiesSet() throws Exception {
if (this.mongoTemplate == null) {
if (this.mappingMongoConverter == null) {
this.mappingMongoConverter = new MappingMongoConverter(this.mongoDbFactory, new MongoMappingContext());
this.mappingMongoConverter = new MappingMongoConverter(new DefaultDbRefResolver(this.mongoDbFactory),
new MongoMappingContext());
this.mappingMongoConverter.setApplicationContext(this.applicationContext);
List<Object> customConverters = new ArrayList<Object>();
customConverters.add(new MongoDbMessageBytesConverter());
@@ -144,11 +145,11 @@ public abstract class AbstractConfigurableMongoDbMessageStore implements BasicMe
IndexOperations indexOperations = this.mongoTemplate.indexOps(this.collectionName);
indexOperations.ensureIndex(new Index(MessageDocumentFields.MESSAGE_ID, Order.ASCENDING));
indexOperations.ensureIndex(new Index(MessageDocumentFields.MESSAGE_ID, Sort.Direction.ASC));
indexOperations.ensureIndex(new Index(MessageDocumentFields.GROUP_ID, Order.ASCENDING)
.on(MessageDocumentFields.LAST_MODIFIED_TIME, Order.DESCENDING)
.on(MessageDocumentFields.SEQUENCE, Order.DESCENDING));
indexOperations.ensureIndex(new Index(MessageDocumentFields.GROUP_ID, Sort.Direction.ASC)
.on(MessageDocumentFields.LAST_MODIFIED_TIME, Sort.Direction.DESC)
.on(MessageDocumentFields.SEQUENCE, Sort.Direction.DESC));
}
public Message<?> getMessage(UUID id) {

View File

@@ -21,7 +21,6 @@ import org.springframework.data.mongodb.MongoDbFactory;
import org.springframework.data.mongodb.core.MongoTemplate;
import org.springframework.data.mongodb.core.convert.MappingMongoConverter;
import org.springframework.data.mongodb.core.index.Index;
import org.springframework.data.mongodb.core.query.Order;
import org.springframework.data.mongodb.core.query.Query;
import org.springframework.integration.IntegrationMessageHeaderAccessor;
import org.springframework.integration.store.MessageGroup;
@@ -91,10 +90,10 @@ public class MongoDbChannelMessageStore extends AbstractConfigurableMongoDbMessa
public void afterPropertiesSet() throws Exception {
super.afterPropertiesSet();
this.mongoTemplate.indexOps(this.collectionName)
.ensureIndex(new Index(MessageDocumentFields.GROUP_ID, Order.ASCENDING)
.on(MessageDocumentFields.PRIORITY, Order.DESCENDING)
.on(MessageDocumentFields.LAST_MODIFIED_TIME, Order.ASCENDING)
.on(MessageDocumentFields.SEQUENCE, Order.ASCENDING));
.ensureIndex(new Index(MessageDocumentFields.GROUP_ID, Sort.Direction.ASC)
.on(MessageDocumentFields.PRIORITY, Sort.Direction.DESC)
.on(MessageDocumentFields.LAST_MODIFIED_TIME, Sort.Direction.ASC)
.on(MessageDocumentFields.SEQUENCE, Sort.Direction.ASC));
}
@Override

View File

@@ -55,13 +55,13 @@ import org.springframework.data.mongodb.core.FindAndModifyOptions;
import org.springframework.data.mongodb.core.IndexOperations;
import org.springframework.data.mongodb.core.MongoTemplate;
import org.springframework.data.mongodb.core.convert.CustomConversions;
import org.springframework.data.mongodb.core.convert.DefaultDbRefResolver;
import org.springframework.data.mongodb.core.convert.MappingMongoConverter;
import org.springframework.data.mongodb.core.index.Index;
import org.springframework.data.mongodb.core.mapping.MongoMappingContext;
import org.springframework.data.mongodb.core.mapping.MongoPersistentEntity;
import org.springframework.data.mongodb.core.mapping.MongoPersistentProperty;
import org.springframework.data.mongodb.core.query.Criteria;
import org.springframework.data.mongodb.core.query.Order;
import org.springframework.data.mongodb.core.query.Query;
import org.springframework.data.mongodb.core.query.Update;
import org.springframework.integration.history.MessageHistory;
@@ -182,9 +182,9 @@ public class MongoDbMessageStore extends AbstractMessageGroupStore
IndexOperations indexOperations = this.template.indexOps(this.collectionName);
indexOperations.ensureIndex(new Index(GROUP_ID_KEY, Order.ASCENDING)
.on(GROUP_UPDATE_TIMESTAMP_KEY, Order.DESCENDING)
.on(SEQUENCE, Order.DESCENDING));
indexOperations.ensureIndex(new Index(GROUP_ID_KEY, Sort.Direction.ASC)
.on(GROUP_UPDATE_TIMESTAMP_KEY, Sort.Direction.DESC)
.on(SEQUENCE, Sort.Direction.DESC));
}
@Override
@@ -457,7 +457,7 @@ public class MongoDbMessageStore extends AbstractMessageGroupStore
public MessageReadingMongoConverter(MongoDbFactory mongoDbFactory,
MappingContext<? extends MongoPersistentEntity<?>, MongoPersistentProperty> mappingContext) {
super(mongoDbFactory, mappingContext);
super(new DefaultDbRefResolver(mongoDbFactory), mappingContext);
}
@Override

View File

@@ -16,6 +16,7 @@
package org.springframework.integration.mongodb.rules;
import com.mongodb.MongoClient;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.junit.rules.MethodRule;
@@ -42,7 +43,7 @@ public final class MongoDbAvailableRule implements MethodRule {
MongoDbAvailable mongoAvailable = method.getAnnotation(MongoDbAvailable.class);
if (mongoAvailable != null) {
try {
Mongo mongo = new Mongo();
Mongo mongo = new MongoClient();
mongo.getDatabaseNames();
}
catch (Exception e) {

View File

@@ -16,19 +16,19 @@
package org.springframework.integration.mongodb.rules;
import com.mongodb.DBObject;
import com.mongodb.MongoClient;
import org.junit.Rule;
import org.springframework.data.mapping.context.MappingContext;
import org.springframework.data.mongodb.MongoDbFactory;
import org.springframework.data.mongodb.core.MongoTemplate;
import org.springframework.data.mongodb.core.SimpleMongoDbFactory;
import org.springframework.data.mongodb.core.convert.DefaultDbRefResolver;
import org.springframework.data.mongodb.core.convert.MappingMongoConverter;
import org.springframework.data.mongodb.core.mapping.MongoPersistentEntity;
import org.springframework.data.mongodb.core.mapping.MongoPersistentProperty;
import com.mongodb.DBObject;
import com.mongodb.Mongo;
/**
* Convenience base class that enables unit test methods to rely upon the {@link MongoDbAvailable} annotation.
*
@@ -42,7 +42,7 @@ public abstract class MongoDbAvailableTests {
protected MongoDbFactory prepareMongoFactory(String... additionalCollectionsToDrop) throws Exception {
MongoDbFactory mongoDbFactory = new SimpleMongoDbFactory(new Mongo(), "test");
MongoDbFactory mongoDbFactory = new SimpleMongoDbFactory(new MongoClient(), "test");
cleanupCollections(mongoDbFactory, additionalCollectionsToDrop);
return mongoDbFactory;
}
@@ -144,7 +144,7 @@ public abstract class MongoDbAvailableTests {
public TestMongoConverter(
MongoDbFactory mongoDbFactory,
MappingContext<? extends MongoPersistentEntity<?>, MongoPersistentProperty> mappingContext) {
super(mongoDbFactory, mappingContext);
super(new DefaultDbRefResolver(mongoDbFactory), mappingContext);
}
@Override

View File

@@ -22,7 +22,7 @@ import java.util.Iterator;
import java.util.Properties;
import java.util.UUID;
import com.mongodb.Mongo;
import com.mongodb.MongoClient;
import org.junit.Test;
import org.springframework.context.support.ClassPathXmlApplicationContext;
@@ -52,7 +52,7 @@ public abstract class AbstractMongoDbMessageGroupStoreTests extends MongoDbAvail
@Test
@MongoDbAvailable
public void testNonExistingEmptyMessageGroup() throws Exception{
this.cleanupCollections(new SimpleMongoDbFactory(new Mongo(), "test"));
this.cleanupCollections(new SimpleMongoDbFactory(new MongoClient(), "test"));
MessageGroupStore store = getMessageGroupStore();
MessageGroup messageGroup = store.getMessageGroup(1);
assertNotNull(messageGroup);
@@ -63,7 +63,7 @@ public abstract class AbstractMongoDbMessageGroupStoreTests extends MongoDbAvail
@Test
@MongoDbAvailable
public void testMessageGroupWithAddedMessagePrimitiveGroupId() throws Exception{
this.cleanupCollections(new SimpleMongoDbFactory(new Mongo(), "test"));
this.cleanupCollections(new SimpleMongoDbFactory(new MongoClient(), "test"));
MessageGroupStore store = this.getMessageGroupStore();
MessageStore messageStore = this.getMessageStore();
MessageGroup messageGroup = store.getMessageGroup(1);
@@ -83,7 +83,7 @@ public abstract class AbstractMongoDbMessageGroupStoreTests extends MongoDbAvail
@Test
@MongoDbAvailable
public void testMessageGroupWithAddedMessageUUIDGroupIdAndUUIDHeader() throws Exception{
this.cleanupCollections(new SimpleMongoDbFactory(new Mongo(), "test"));
this.cleanupCollections(new SimpleMongoDbFactory(new MongoClient(), "test"));
MessageGroupStore store = this.getMessageGroupStore();
MessageStore messageStore = this.getMessageStore();
Object id = UUID.randomUUID();
@@ -109,7 +109,7 @@ public abstract class AbstractMongoDbMessageGroupStoreTests extends MongoDbAvail
@Test
@MongoDbAvailable
public void testCountMessagesInGroup() throws Exception{
this.cleanupCollections(new SimpleMongoDbFactory(new Mongo(), "test"));
this.cleanupCollections(new SimpleMongoDbFactory(new MongoClient(), "test"));
MessageGroupStore store = this.getMessageGroupStore();
Message<?> messageA = new GenericMessage<String>("A");
Message<?> messageB = new GenericMessage<String>("B");
@@ -121,7 +121,7 @@ public abstract class AbstractMongoDbMessageGroupStoreTests extends MongoDbAvail
@Test
@MongoDbAvailable
public void testPollMessages() throws Exception{
this.cleanupCollections(new SimpleMongoDbFactory(new Mongo(), "test"));
this.cleanupCollections(new SimpleMongoDbFactory(new MongoClient(), "test"));
MessageGroupStore store = this.getMessageGroupStore();
Message<?> messageA = new GenericMessage<String>("A");
Message<?> messageB = new GenericMessage<String>("B");
@@ -141,7 +141,7 @@ public abstract class AbstractMongoDbMessageGroupStoreTests extends MongoDbAvail
@Test
@MongoDbAvailable
public void testSameMessageMultipleGroupsPoll() throws Exception{
this.cleanupCollections(new SimpleMongoDbFactory(new Mongo(), "test"));
this.cleanupCollections(new SimpleMongoDbFactory(new MongoClient(), "test"));
MessageGroupStore store = this.getMessageGroupStore();
Message<?> messageA = new GenericMessage<String>("A");
store.addMessageToGroup(1, messageA);
@@ -177,7 +177,7 @@ public abstract class AbstractMongoDbMessageGroupStoreTests extends MongoDbAvail
@Test
@MongoDbAvailable
public void testSameMessageMultipleGroupsRemove() throws Exception{
this.cleanupCollections(new SimpleMongoDbFactory(new Mongo(), "test"));
this.cleanupCollections(new SimpleMongoDbFactory(new MongoClient(), "test"));
MessageGroupStore store = this.getMessageGroupStore();
Message<?> messageA = new GenericMessage<String>("A");
@@ -214,7 +214,7 @@ public abstract class AbstractMongoDbMessageGroupStoreTests extends MongoDbAvail
@Test
@MongoDbAvailable
public void testMessageGroupUpdatedDateChangesWithEachAddedMessage() throws Exception{
this.cleanupCollections(new SimpleMongoDbFactory(new Mongo(), "test"));
this.cleanupCollections(new SimpleMongoDbFactory(new MongoClient(), "test"));
MessageGroupStore store = this.getMessageGroupStore();
MessageGroup messageGroup = store.getMessageGroup(1);
@@ -243,7 +243,7 @@ public abstract class AbstractMongoDbMessageGroupStoreTests extends MongoDbAvail
@Test
@MongoDbAvailable
public void testMessageGroupMarkingMessage() throws Exception{
this.cleanupCollections(new SimpleMongoDbFactory(new Mongo(), "test"));
this.cleanupCollections(new SimpleMongoDbFactory(new MongoClient(), "test"));
MessageGroupStore store = this.getMessageGroupStore();
MessageGroup messageGroup = store.getMessageGroup(1);
@@ -267,7 +267,7 @@ public abstract class AbstractMongoDbMessageGroupStoreTests extends MongoDbAvail
@Test
@MongoDbAvailable
public void testRemoveMessageGroup() throws Exception{
this.cleanupCollections(new SimpleMongoDbFactory(new Mongo(), "test"));
this.cleanupCollections(new SimpleMongoDbFactory(new MongoClient(), "test"));
MessageGroupStore store = this.getMessageGroupStore();
MessageStore messageStore = this.getMessageStore();
@@ -290,7 +290,7 @@ public abstract class AbstractMongoDbMessageGroupStoreTests extends MongoDbAvail
@Test
@MongoDbAvailable
public void testCompleteMessageGroup() throws Exception{
this.cleanupCollections(new SimpleMongoDbFactory(new Mongo(), "test"));
this.cleanupCollections(new SimpleMongoDbFactory(new MongoClient(), "test"));
MessageGroupStore store = this.getMessageGroupStore();
MessageGroup messageGroup = store.getMessageGroup(1);
@@ -305,7 +305,7 @@ public abstract class AbstractMongoDbMessageGroupStoreTests extends MongoDbAvail
@Test
@MongoDbAvailable
public void testLastReleasedSequenceNumber() throws Exception{
this.cleanupCollections(new SimpleMongoDbFactory(new Mongo(), "test"));
this.cleanupCollections(new SimpleMongoDbFactory(new MongoClient(), "test"));
MessageGroupStore store = this.getMessageGroupStore();
MessageGroup messageGroup = store.getMessageGroup(1);
@@ -320,7 +320,7 @@ public abstract class AbstractMongoDbMessageGroupStoreTests extends MongoDbAvail
@Test
@MongoDbAvailable
public void testRemoveMessageFromTheGroup() throws Exception{
this.cleanupCollections(new SimpleMongoDbFactory(new Mongo(), "test"));
this.cleanupCollections(new SimpleMongoDbFactory(new MongoClient(), "test"));
MessageGroupStore store = this.getMessageGroupStore();
MessageGroup messageGroup = store.getMessageGroup(1);
@@ -339,7 +339,7 @@ public abstract class AbstractMongoDbMessageGroupStoreTests extends MongoDbAvail
@MongoDbAvailable
public void testMultipleMessageStores() throws Exception{
this.cleanupCollections(new SimpleMongoDbFactory(new Mongo(), "test"));
this.cleanupCollections(new SimpleMongoDbFactory(new MongoClient(), "test"));
MessageGroupStore store1 = this.getMessageGroupStore();
MessageGroupStore store2 = this.getMessageGroupStore();
@@ -364,7 +364,7 @@ public abstract class AbstractMongoDbMessageGroupStoreTests extends MongoDbAvail
@Test
@MongoDbAvailable
public void testMessageGroupIterator() throws Exception{
this.cleanupCollections(new SimpleMongoDbFactory(new Mongo(), "test"));
this.cleanupCollections(new SimpleMongoDbFactory(new MongoClient(), "test"));
MessageGroupStore store1 = this.getMessageGroupStore();
MessageGroupStore store2 = this.getMessageGroupStore();
@@ -438,7 +438,7 @@ public abstract class AbstractMongoDbMessageGroupStoreTests extends MongoDbAvail
protected void testWithAggregatorWithShutdown(String config) throws Exception{
this.cleanupCollections(new SimpleMongoDbFactory(new Mongo(), "test"));
this.cleanupCollections(new SimpleMongoDbFactory(new MongoClient(), "test"));
ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext(config, this.getClass());
context.refresh();
@@ -466,7 +466,7 @@ public abstract class AbstractMongoDbMessageGroupStoreTests extends MongoDbAvail
@Test
@MongoDbAvailable
public void testWithMessageHistory() throws Exception{
this.cleanupCollections(new SimpleMongoDbFactory(new Mongo(), "test"));
this.cleanupCollections(new SimpleMongoDbFactory(new MongoClient(), "test"));
MessageGroupStore store = this.getMessageGroupStore();
store.getMessageGroup(1);

View File

@@ -15,16 +15,13 @@
*/
package org.springframework.integration.mongodb.store;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertThat;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.*;
import java.io.Serializable;
import java.util.Properties;
import java.util.UUID;
import com.mongodb.MongoClient;
import org.hamcrest.Matchers;
import org.junit.Test;
@@ -42,8 +39,6 @@ import org.springframework.messaging.MessagingException;
import org.springframework.messaging.support.ErrorMessage;
import org.springframework.messaging.support.GenericMessage;
import com.mongodb.Mongo;
/**
*
* @author Mark Fisher
@@ -58,7 +53,7 @@ public abstract class AbstractMongoDbMessageStoreTests extends MongoDbAvailableT
@Test
@MongoDbAvailable
public void testAddGetWithStringPayload() throws Exception {
cleanupCollections(new SimpleMongoDbFactory(new Mongo(), "test"));
cleanupCollections(new SimpleMongoDbFactory(new MongoClient(), "test"));
MessageStore store = getMessageStore();
Message<?> messageToStore = MessageBuilder.withPayload("Hello").build();
store.addMessage(messageToStore);
@@ -73,7 +68,7 @@ public abstract class AbstractMongoDbMessageStoreTests extends MongoDbAvailableT
@Test
@MongoDbAvailable
public void testAddThenRemoveWithStringPayload() throws Exception {
cleanupCollections(new SimpleMongoDbFactory(new Mongo(), "test"));
cleanupCollections(new SimpleMongoDbFactory(new MongoClient(), "test"));
MessageStore store = getMessageStore();
Message<?> messageToStore = MessageBuilder.withPayload("Hello").build();
store.addMessage(messageToStore);
@@ -88,7 +83,7 @@ public abstract class AbstractMongoDbMessageStoreTests extends MongoDbAvailableT
@Test
@MongoDbAvailable
public void testAddGetWithObjectDefaultConstructorPayload() throws Exception {
cleanupCollections(new SimpleMongoDbFactory(new Mongo(), "test"));
cleanupCollections(new SimpleMongoDbFactory(new MongoClient(), "test"));
MessageStore store = getMessageStore();
Person p = new Person();
p.setFname("John");
@@ -106,7 +101,7 @@ public abstract class AbstractMongoDbMessageStoreTests extends MongoDbAvailableT
@Test
@MongoDbAvailable
public void testWithMessageHistory() throws Exception{
cleanupCollections(new SimpleMongoDbFactory(new Mongo(), "test"));
cleanupCollections(new SimpleMongoDbFactory(new MongoClient(), "test"));
MessageStore store = getMessageStore();
Foo foo = new Foo();
foo.setName("foo");
@@ -144,7 +139,7 @@ public abstract class AbstractMongoDbMessageStoreTests extends MongoDbAvailableT
@Test
@MongoDbAvailable
public void testInt3153SequenceDetails() throws Exception{
cleanupCollections(new SimpleMongoDbFactory(new Mongo(), "test"));
cleanupCollections(new SimpleMongoDbFactory(new MongoClient(), "test"));
MessageStore store = getMessageStore();
Message<?> messageToStore = MessageBuilder.withPayload("test")
.pushSequenceDetails(UUID.randomUUID(), 1, 1)

View File

@@ -20,7 +20,7 @@ import static org.junit.Assert.*;
import java.util.Map;
import com.mongodb.DBObject;
import com.mongodb.Mongo;
import com.mongodb.MongoClient;
import org.hamcrest.Matchers;
import org.junit.Test;
@@ -50,7 +50,7 @@ public class ConfigurableMongoDbMessageGroupStoreTests extends AbstractMongoDbMe
*/
@Override
protected ConfigurableMongoDbMessageStore getMessageGroupStore() throws Exception {
MongoDbFactory mongoDbFactory = new SimpleMongoDbFactory(new Mongo(), "test");
MongoDbFactory mongoDbFactory = new SimpleMongoDbFactory(new MongoClient(), "test");
ConfigurableMongoDbMessageStore mongoDbMessageStore = new ConfigurableMongoDbMessageStore(mongoDbFactory);
GenericApplicationContext testApplicationContext = TestUtils.createTestApplicationContext();
testApplicationContext.refresh();
@@ -76,7 +76,7 @@ public class ConfigurableMongoDbMessageGroupStoreTests extends AbstractMongoDbMe
@Test
@MongoDbAvailable
public void testWithCustomConverter() throws Exception {
this.cleanupCollections(new SimpleMongoDbFactory(new Mongo(), "test"));
this.cleanupCollections(new SimpleMongoDbFactory(new MongoClient(), "test"));
ClassPathXmlApplicationContext context =
new ClassPathXmlApplicationContext("ConfigurableMongoDbMessageStore-CustomConverter.xml", this.getClass());
context.refresh();
@@ -90,7 +90,7 @@ public class ConfigurableMongoDbMessageGroupStoreTests extends AbstractMongoDbMe
@Test
@MongoDbAvailable
public void testPriorityChannel() throws Exception {
this.cleanupCollections(new SimpleMongoDbFactory(new Mongo(), "test"));
this.cleanupCollections(new SimpleMongoDbFactory(new MongoClient(), "test"));
ClassPathXmlApplicationContext context =
new ClassPathXmlApplicationContext("ConfigurableMongoDbMessageStore-CustomConverter.xml", this.getClass());
context.refresh();

View File

@@ -16,14 +16,14 @@
package org.springframework.integration.mongodb.store;
import com.mongodb.MongoClient;
import org.springframework.context.support.GenericApplicationContext;
import org.springframework.data.mongodb.MongoDbFactory;
import org.springframework.data.mongodb.core.SimpleMongoDbFactory;
import org.springframework.integration.store.MessageStore;
import org.springframework.integration.test.util.TestUtils;
import com.mongodb.Mongo;
/**
* @author Amol Nayak
* @author Artem Bilan
@@ -32,7 +32,7 @@ public class ConfigurableMongoDbMessageStoreTests extends AbstractMongoDbMessage
@Override
protected MessageStore getMessageStore() throws Exception {
MongoDbFactory mongoDbFactory = new SimpleMongoDbFactory(new Mongo(), "test");
MongoDbFactory mongoDbFactory = new SimpleMongoDbFactory(new MongoClient(), "test");
ConfigurableMongoDbMessageStore mongoDbMessageStore = new ConfigurableMongoDbMessageStore(mongoDbFactory);
GenericApplicationContext testApplicationContext = TestUtils.createTestApplicationContext();
testApplicationContext.refresh();

View File

@@ -15,7 +15,7 @@
*/
package org.springframework.integration.mongodb.store;
import com.mongodb.Mongo;
import com.mongodb.MongoClient;
import org.junit.Test;
import org.springframework.data.mongodb.core.SimpleMongoDbFactory;
@@ -32,7 +32,7 @@ public class MongoDbMessageGroupStoreTests extends AbstractMongoDbMessageGroupSt
@Override
protected MongoDbMessageStore getMessageGroupStore() throws Exception {
MongoDbMessageStore mongoDbMessageStore = new MongoDbMessageStore( new SimpleMongoDbFactory(new Mongo(), "test"));
MongoDbMessageStore mongoDbMessageStore = new MongoDbMessageStore( new SimpleMongoDbFactory(new MongoClient(), "test"));
mongoDbMessageStore.afterPropertiesSet();
return mongoDbMessageStore;
}

View File

@@ -16,10 +16,11 @@
package org.springframework.integration.mongodb.store;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.*;
import java.io.Serializable;
import com.mongodb.MongoClient;
import org.junit.Test;
import org.springframework.data.mongodb.MongoDbFactory;
@@ -31,8 +32,6 @@ import org.springframework.integration.transformer.ClaimCheckInTransformer;
import org.springframework.integration.transformer.ClaimCheckOutTransformer;
import org.springframework.messaging.Message;
import com.mongodb.Mongo;
/**
* @author Mark Fisher
* @author Artem Bilan
@@ -42,7 +41,7 @@ public class MongoDbMessageStoreClaimCheckIntegrationTests extends MongoDbAvaila
@Test
@MongoDbAvailable
public void stringPayload() throws Exception {
MongoDbFactory mongoDbFactory = new SimpleMongoDbFactory(new Mongo(), "test");
MongoDbFactory mongoDbFactory = new SimpleMongoDbFactory(new MongoClient(), "test");
MongoDbMessageStore messageStore = new MongoDbMessageStore(mongoDbFactory);
messageStore.afterPropertiesSet();
ClaimCheckInTransformer checkin = new ClaimCheckInTransformer(messageStore);
@@ -59,7 +58,7 @@ public class MongoDbMessageStoreClaimCheckIntegrationTests extends MongoDbAvaila
@Test
@MongoDbAvailable
public void objectPayload() throws Exception {
MongoDbFactory mongoDbFactory = new SimpleMongoDbFactory(new Mongo(), "test");
MongoDbFactory mongoDbFactory = new SimpleMongoDbFactory(new MongoClient(), "test");
MongoDbMessageStore messageStore = new MongoDbMessageStore(mongoDbFactory);
messageStore.afterPropertiesSet();
ClaimCheckInTransformer checkin = new ClaimCheckInTransformer(messageStore);
@@ -80,7 +79,7 @@ public class MongoDbMessageStoreClaimCheckIntegrationTests extends MongoDbAvaila
@Test
@MongoDbAvailable
public void stringPayloadConfigurable() throws Exception {
MongoDbFactory mongoDbFactory = new SimpleMongoDbFactory(new Mongo(), "test");
MongoDbFactory mongoDbFactory = new SimpleMongoDbFactory(new MongoClient(), "test");
ConfigurableMongoDbMessageStore messageStore = new ConfigurableMongoDbMessageStore(mongoDbFactory);
messageStore.afterPropertiesSet();
ClaimCheckInTransformer checkin = new ClaimCheckInTransformer(messageStore);
@@ -97,7 +96,7 @@ public class MongoDbMessageStoreClaimCheckIntegrationTests extends MongoDbAvaila
@Test
@MongoDbAvailable
public void objectPayloadConfigurable() throws Exception {
MongoDbFactory mongoDbFactory = new SimpleMongoDbFactory(new Mongo(), "test");
MongoDbFactory mongoDbFactory = new SimpleMongoDbFactory(new MongoClient(), "test");
ConfigurableMongoDbMessageStore messageStore = new ConfigurableMongoDbMessageStore(mongoDbFactory);
messageStore.afterPropertiesSet();
ClaimCheckInTransformer checkin = new ClaimCheckInTransformer(messageStore);

View File

@@ -15,10 +15,11 @@
*/
package org.springframework.integration.mongodb.store;
import com.mongodb.MongoClient;
import org.springframework.data.mongodb.core.SimpleMongoDbFactory;
import org.springframework.integration.store.MessageStore;
import com.mongodb.Mongo;
/**
* @author Mark Fisher
* @author Oleg Zhurakousky
@@ -29,7 +30,7 @@ public class MongoDbMessageStoreTests extends AbstractMongoDbMessageStoreTests {
@Override
protected MessageStore getMessageStore() throws Exception {
MongoDbMessageStore mongoDbMessageStore = new MongoDbMessageStore(new SimpleMongoDbFactory(new Mongo(), "test"));
MongoDbMessageStore mongoDbMessageStore = new MongoDbMessageStore(new SimpleMongoDbFactory(new MongoClient(), "test"));
mongoDbMessageStore.afterPropertiesSet();
return mongoDbMessageStore;
}