Skip to content

Commit c8fe02e

Browse files
mp911dechristophstrobl
authored andcommitted
DATAMONGO-1411 - Enable build on TravisCI.
We now start MongoDB server via apt-get instead of relying on the TravisCI managed 2.4.2 installation. Doing this we altered tests to just check on the port and not the host part of the URIs. Additionally we upgraded build profiles, removed promoted snapshot-versions, renamed mongo32-next to mongo32 and added mongo33-next build profile. Original pull request: #358
1 parent 32547db commit c8fe02e

File tree

3 files changed

+46
-11
lines changed

3 files changed

+46
-11
lines changed

.travis.yml

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,28 @@ language: java
33
jdk:
44
- oraclejdk8
55

6-
services:
7-
- mongodb
6+
before_script:
7+
- mongod --version
88

99
env:
1010
matrix:
1111
- PROFILE=ci
1212
- PROFILE=mongo-next
13+
- PROFILE=mongo3
14+
- PROFILE=mongo3-next
15+
- PROFILE=mongo31
16+
- PROFILE=mongo32
17+
- PROFILE=mongo33-next
18+
19+
# Current MongoDB version is 2.4.2 as of 2016-04, see https://github.com/travis-ci/travis-ci/issues/3694
20+
# apt-get starts a MongoDB instance so it's not started using before_script
21+
addons:
22+
apt:
23+
sources:
24+
- mongodb-3.2-precise
25+
packages:
26+
- mongodb-org-server
27+
- mongodb-org-shell
1328

1429
sudo: false
1530

pom.xml

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@
107107

108108
<id>mongo-next</id>
109109
<properties>
110-
<mongo>2.14.0-SNAPSHOT</mongo>
110+
<mongo>2.15.0-SNAPSHOT</mongo>
111111
</properties>
112112

113113
<repositories>
@@ -148,16 +148,25 @@
148148

149149
<id>mongo31</id>
150150
<properties>
151-
<mongo>3.1.0</mongo>
151+
<mongo>3.1.1</mongo>
152152
</properties>
153153

154154
</profile>
155155

156156
<profile>
157157

158-
<id>mongo32-next</id>
158+
<id>mongo32</id>
159159
<properties>
160-
<mongo>3.2.0-SNAPSHOT</mongo>
160+
<mongo>3.2.2</mongo>
161+
</properties>
162+
163+
</profile>
164+
165+
<profile>
166+
167+
<id>mongo33-next</id>
168+
<properties>
169+
<mongo>3.3.0-SNAPSHOT</mongo>
161170
</properties>
162171

163172
<repositories>

spring-data-mongodb/src/test/java/org/springframework/data/mongodb/config/MongoNamespaceReplicaSetTests.java

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2011-2012 the original author or authors.
2+
* Copyright 2011-2016 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -20,6 +20,7 @@
2020
import static org.junit.Assert.*;
2121

2222
import java.net.InetAddress;
23+
import java.util.ArrayList;
2324
import java.util.List;
2425

2526
import org.junit.Ignore;
@@ -37,6 +38,13 @@
3738
import com.mongodb.Mongo;
3839
import com.mongodb.ServerAddress;
3940

41+
/**
42+
*
43+
* @author Mark Pollack
44+
* @author Oliver Gierke
45+
* @author Thomas Darimont
46+
* @author Mark Paluch
47+
*/
4048
@RunWith(SpringJUnit4ClassRunner.class)
4149
@ContextConfiguration
4250
public class MongoNamespaceReplicaSetTests {
@@ -70,10 +78,13 @@ public void testParsingWithPropertyPlaceHolder() throws Exception {
7078

7179
assertThat(replicaSetSeeds, is(notNullValue()));
7280
assertThat(replicaSetSeeds, hasSize(3));
73-
assertThat(
74-
replicaSetSeeds,
75-
hasItems(new ServerAddress("192.168.174.130", 27017), new ServerAddress("192.168.174.130", 27018),
76-
new ServerAddress("192.168.174.130", 27019)));
81+
82+
List<Integer> ports = new ArrayList<Integer>();
83+
for (ServerAddress replicaSetSeed : replicaSetSeeds) {
84+
ports.add(replicaSetSeed.getPort());
85+
}
86+
87+
assertThat(ports, hasItems(27017, 27018, 27019));
7788
}
7889

7990
@Test

0 commit comments

Comments
 (0)