From 8d96f629e3c0a32b1f7b593a6b1e71d28d5bbd59 Mon Sep 17 00:00:00 2001 From: Mark Paluch Date: Fri, 8 Apr 2016 11:29:35 +0200 Subject: [PATCH 1/2] DATAMONGO-1411 - Enable MongoDB build on TravisCI. Prepare issue branch. --- pom.xml | 2 +- spring-data-mongodb-cross-store/pom.xml | 4 ++-- spring-data-mongodb-distribution/pom.xml | 2 +- spring-data-mongodb-log4j/pom.xml | 2 +- spring-data-mongodb/pom.xml | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/pom.xml b/pom.xml index 165903c30b..e41b55a67f 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ org.springframework.data spring-data-mongodb-parent - 1.10.0.BUILD-SNAPSHOT + 1.10.0.DATAMONGO-1411-SNAPSHOT pom Spring Data MongoDB diff --git a/spring-data-mongodb-cross-store/pom.xml b/spring-data-mongodb-cross-store/pom.xml index 6554045e11..03c487316c 100644 --- a/spring-data-mongodb-cross-store/pom.xml +++ b/spring-data-mongodb-cross-store/pom.xml @@ -6,7 +6,7 @@ org.springframework.data spring-data-mongodb-parent - 1.10.0.BUILD-SNAPSHOT + 1.10.0.DATAMONGO-1411-SNAPSHOT ../pom.xml @@ -48,7 +48,7 @@ org.springframework.data spring-data-mongodb - 1.10.0.BUILD-SNAPSHOT + 1.10.0.DATAMONGO-1411-SNAPSHOT diff --git a/spring-data-mongodb-distribution/pom.xml b/spring-data-mongodb-distribution/pom.xml index 2d02722262..7006438c86 100644 --- a/spring-data-mongodb-distribution/pom.xml +++ b/spring-data-mongodb-distribution/pom.xml @@ -13,7 +13,7 @@ org.springframework.data spring-data-mongodb-parent - 1.10.0.BUILD-SNAPSHOT + 1.10.0.DATAMONGO-1411-SNAPSHOT ../pom.xml diff --git a/spring-data-mongodb-log4j/pom.xml b/spring-data-mongodb-log4j/pom.xml index ee5e3336db..d357ed999c 100644 --- a/spring-data-mongodb-log4j/pom.xml +++ b/spring-data-mongodb-log4j/pom.xml @@ -5,7 +5,7 @@ org.springframework.data spring-data-mongodb-parent - 1.10.0.BUILD-SNAPSHOT + 1.10.0.DATAMONGO-1411-SNAPSHOT ../pom.xml diff --git a/spring-data-mongodb/pom.xml b/spring-data-mongodb/pom.xml index edfa519fad..f22cef8ee1 100644 --- a/spring-data-mongodb/pom.xml +++ b/spring-data-mongodb/pom.xml @@ -11,7 +11,7 @@ org.springframework.data spring-data-mongodb-parent - 1.10.0.BUILD-SNAPSHOT + 1.10.0.DATAMONGO-1411-SNAPSHOT ../pom.xml From 2acc373458e700b13b2cfd11f332b8789dec4353 Mon Sep 17 00:00:00 2001 From: Mark Paluch Date: Fri, 8 Apr 2016 11:28:20 +0200 Subject: [PATCH 2/2] DATAMONGO-1411 - Enable MongoDB build on TravisCI. Builds on TravisCI cause successful DNS reverse lookups for the used ServerAddresses so it's not reliable to check for the host part. Added missing author tags to the test. TravisCI supports as of now only MongoDB 2.4.2 when adding the MongoDB service to the config section. It's therefore required to upgrade the server. apt-get also starts the MongoDB server which is not obvious. Upgrade of profiles, removed promoted snapshot-versions, renamed mongo32-next to mongo32, added mongo33-next build profile. Original pull request: #358. --- .travis.yml | 19 +++++++++++++++-- pom.xml | 17 +++++++++++---- .../config/MongoNamespaceReplicaSetTests.java | 21 ++++++++++++++----- 3 files changed, 46 insertions(+), 11 deletions(-) diff --git a/.travis.yml b/.travis.yml index 0e651dc58a..fd3e646ae0 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,13 +3,28 @@ language: java jdk: - oraclejdk8 -services: - - mongodb +before_script: + - mongod --version env: matrix: - PROFILE=ci - PROFILE=mongo-next + - PROFILE=mongo3 + - PROFILE=mongo3-next + - PROFILE=mongo31 + - PROFILE=mongo32 + - PROFILE=mongo33-next + +# Current MongoDB version is 2.4.2 as of 2016-04, see https://github.com/travis-ci/travis-ci/issues/3694 +# apt-get starts a MongoDB instance so it's not started using before_script +addons: + apt: + sources: + - mongodb-3.2-precise + packages: + - mongodb-org-server + - mongodb-org-shell sudo: false diff --git a/pom.xml b/pom.xml index e41b55a67f..4a37c488ad 100644 --- a/pom.xml +++ b/pom.xml @@ -107,7 +107,7 @@ mongo-next - 2.14.0-SNAPSHOT + 2.15.0-SNAPSHOT @@ -148,16 +148,25 @@ mongo31 - 3.1.0 + 3.1.1 - mongo32-next + mongo32 - 3.2.0-SNAPSHOT + 3.2.2 + + + + + + + mongo33-next + + 3.3.0-SNAPSHOT diff --git a/spring-data-mongodb/src/test/java/org/springframework/data/mongodb/config/MongoNamespaceReplicaSetTests.java b/spring-data-mongodb/src/test/java/org/springframework/data/mongodb/config/MongoNamespaceReplicaSetTests.java index f3e15aec48..f76e768930 100644 --- a/spring-data-mongodb/src/test/java/org/springframework/data/mongodb/config/MongoNamespaceReplicaSetTests.java +++ b/spring-data-mongodb/src/test/java/org/springframework/data/mongodb/config/MongoNamespaceReplicaSetTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2011-2012 the original author or authors. + * Copyright 2011-2016 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,6 +20,7 @@ import static org.junit.Assert.*; import java.net.InetAddress; +import java.util.ArrayList; import java.util.List; import org.junit.Ignore; @@ -37,6 +38,13 @@ import com.mongodb.Mongo; import com.mongodb.ServerAddress; +/** + * + * @author Mark Pollack + * @author Oliver Gierke + * @author Thomas Darimont + * @author Mark Paluch + */ @RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration public class MongoNamespaceReplicaSetTests { @@ -70,10 +78,13 @@ public void testParsingWithPropertyPlaceHolder() throws Exception { assertThat(replicaSetSeeds, is(notNullValue())); assertThat(replicaSetSeeds, hasSize(3)); - assertThat( - replicaSetSeeds, - hasItems(new ServerAddress("192.168.174.130", 27017), new ServerAddress("192.168.174.130", 27018), - new ServerAddress("192.168.174.130", 27019))); + + List ports = new ArrayList(); + for (ServerAddress replicaSetSeed : replicaSetSeeds) { + ports.add(replicaSetSeed.getPort()); + } + + assertThat(ports, hasItems(27017, 27018, 27019)); } @Test