Skip to content

Commit

Permalink
INT-3311,INT-3377: Update Spring-* Dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
Artem Bilan authored and garyrussell committed Apr 24, 2014
1 parent 4c495a3 commit d2e83e8
Show file tree
Hide file tree
Showing 13 changed files with 75 additions and 79 deletions.
12 changes: 6 additions & 6 deletions build.gradle
Expand Up @@ -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'
Expand Down Expand Up @@ -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'
}
Expand Down
Expand Up @@ -23,6 +23,8 @@
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;

Expand All @@ -37,17 +39,18 @@
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;
Expand All @@ -58,9 +61,6 @@
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.
Expand Down Expand Up @@ -129,7 +129,8 @@ public void setApplicationContext(ApplicationContext applicationContext) throws
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());
Expand All @@ -144,11 +145,11 @@ public void afterPropertiesSet() throws Exception {

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) {
Expand Down
Expand Up @@ -21,7 +21,6 @@
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;
Expand Down Expand Up @@ -91,10 +90,10 @@ public boolean isPriorityEnabled() {
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
Expand Down
Expand Up @@ -55,13 +55,13 @@
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;
Expand Down Expand Up @@ -182,9 +182,9 @@ public void afterPropertiesSet() throws Exception {

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
Expand Down Expand Up @@ -457,7 +457,7 @@ private class MessageReadingMongoConverter extends MappingMongoConverter {

public MessageReadingMongoConverter(MongoDbFactory mongoDbFactory,
MappingContext<? extends MongoPersistentEntity<?>, MongoPersistentProperty> mappingContext) {
super(mongoDbFactory, mappingContext);
super(new DefaultDbRefResolver(mongoDbFactory), mappingContext);
}

@Override
Expand Down
Expand Up @@ -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;
Expand All @@ -42,7 +43,7 @@ public void evaluate() throws Throwable {
MongoDbAvailable mongoAvailable = method.getAnnotation(MongoDbAvailable.class);
if (mongoAvailable != null) {
try {
Mongo mongo = new Mongo();
Mongo mongo = new MongoClient();
mongo.getDatabaseNames();
}
catch (Exception e) {
Expand Down
Expand Up @@ -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.
*
Expand All @@ -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;
}
Expand Down Expand Up @@ -144,7 +144,7 @@ public static class TestMongoConverter extends MappingMongoConverter {
public TestMongoConverter(
MongoDbFactory mongoDbFactory,
MappingContext<? extends MongoPersistentEntity<?>, MongoPersistentProperty> mappingContext) {
super(mongoDbFactory, mappingContext);
super(new DefaultDbRefResolver(mongoDbFactory), mappingContext);
}

@Override
Expand Down
Expand Up @@ -22,7 +22,7 @@
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;
Expand Down Expand Up @@ -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);
Expand All @@ -63,7 +63,7 @@ public void testNonExistingEmptyMessageGroup() throws Exception{
@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);
Expand All @@ -83,7 +83,7 @@ public void testMessageGroupWithAddedMessagePrimitiveGroupId() throws Exception{
@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();
Expand All @@ -109,7 +109,7 @@ public void testMessageGroupWithAddedMessageUUIDGroupIdAndUUIDHeader() throws Ex
@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");
Expand All @@ -121,7 +121,7 @@ public void testCountMessagesInGroup() throws Exception{
@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");
Expand All @@ -141,7 +141,7 @@ public void testPollMessages() throws Exception{
@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);
Expand Down Expand Up @@ -177,7 +177,7 @@ public void testSameMessageMultipleGroupsPoll() throws Exception{
@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");
Expand Down Expand Up @@ -214,7 +214,7 @@ public void testSameMessageMultipleGroupsRemove() throws Exception{
@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);
Expand Down Expand Up @@ -243,7 +243,7 @@ public void testMessageGroupUpdatedDateChangesWithEachAddedMessage() throws Exce
@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);
Expand All @@ -267,7 +267,7 @@ public void testMessageGroupMarkingMessage() throws Exception{
@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();

Expand All @@ -290,7 +290,7 @@ public void testRemoveMessageGroup() throws Exception{
@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);
Expand All @@ -305,7 +305,7 @@ public void testCompleteMessageGroup() throws Exception{
@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);
Expand All @@ -320,7 +320,7 @@ public void testLastReleasedSequenceNumber() throws Exception{
@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);
Expand All @@ -339,7 +339,7 @@ public void testRemoveMessageFromTheGroup() throws Exception{
@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();

Expand All @@ -364,7 +364,7 @@ public void testMultipleMessageStores() throws Exception{
@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();

Expand Down Expand Up @@ -438,7 +438,7 @@ public void testMessageGroupIterator() throws Exception{


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();
Expand Down Expand Up @@ -466,7 +466,7 @@ protected void testWithAggregatorWithShutdown(String config) throws Exception{
@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);
Expand Down

0 comments on commit d2e83e8

Please sign in to comment.