Skip to content

Commit d851a8d

Browse files
committed
Modernize CI
This commit: 1. Switches to GitHub Actions because Travis CI no longer offers Java < 9 (resolves fakemongo#356) 2. Adds Java 8-15 support 3. Drops Java 6 support. See https://bugs.java.com/bugdatabase/view_bug.do?bug_id=JDK-8028563
1 parent 7301aa1 commit d851a8d

File tree

5 files changed

+36
-27
lines changed

5 files changed

+36
-27
lines changed

Diff for: .github/workflows/ci.yml

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
name: CI
2+
on: [push, pull_request]
3+
jobs:
4+
test:
5+
strategy:
6+
matrix:
7+
java: [7, 8, 9, 10, 11, 12, 13, 14, 15]
8+
runs-on: ubuntu-latest
9+
steps:
10+
- name: Checkout
11+
uses: actions/checkout@v2
12+
- name: Set up Java
13+
uses: actions/setup-java@v1
14+
with:
15+
java-version: ${{ matrix.java }}
16+
- name: Test
17+
run: mvn clean install

Diff for: .travis.yml

-16
This file was deleted.

Diff for: pom.xml

+17-9
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,9 @@
4545

4646
<properties>
4747
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
48-
<scala.version>2.11.6</scala.version>
48+
<scala.version>2.11.12</scala.version>
4949
<version.surefire>2.18.1</version.surefire>
50+
<java.version>1.7</java.version>
5051

5152
<!-- Jacoco -->
5253
<jacoco.destFile.unit>${project.build.directory}/jacoco-unit.exec</jacoco.destFile.unit>
@@ -104,6 +105,11 @@
104105
<artifactId>geojson-jackson</artifactId>
105106
<version>1.2</version>
106107
</dependency>
108+
<dependency>
109+
<groupId>javax.xml.bind</groupId>
110+
<artifactId>jaxb-api</artifactId>
111+
<version>2.3.1</version>
112+
</dependency>
107113

108114
<!-- Scope Test -->
109115
<dependency>
@@ -213,8 +219,8 @@
213219
<artifactId>maven-compiler-plugin</artifactId>
214220
<version>3.2</version>
215221
<configuration>
216-
<source>1.6</source>
217-
<target>1.6</target>
222+
<source>${java.version}</source>
223+
<target>${java.version}</target>
218224
<encoding>UTF-8</encoding>
219225
<testExcludes>
220226
<exclude>com/github/fakemongo/PerfTest.java</exclude>
@@ -236,7 +242,7 @@
236242
<plugin>
237243
<groupId>org.jacoco</groupId>
238244
<artifactId>jacoco-maven-plugin</artifactId>
239-
<version>0.7.5.201505241946</version>
245+
<version>0.8.6</version>
240246
<executions>
241247
<execution>
242248
<goals>
@@ -294,20 +300,21 @@
294300
<configuration>
295301
<javacArgs>
296302
<javacArg>-source</javacArg>
297-
<javacArg>1.6</javacArg>
303+
<javacArg>${java.version}</javacArg>
298304
<javacArg>-target</javacArg>
299-
<javacArg>1.6</javacArg>
305+
<javacArg>${java.version}</javacArg>
300306
</javacArgs>
301307
<jvmArgs>
302308
<jvmArg>-Xms64m</jvmArg>
303309
<jvmArg>-Xmx1024m</jvmArg>
304310
<!--jvmArg>-Dscala.timings=true</jvmArg -->
305311
</jvmArgs>
306312
<args>
307-
<arg>-target:jvm-1.6</arg>
313+
<arg>-target:jvm-${java.version}</arg>
308314
<arg>-unchecked</arg>
309315
<arg>-deprecation</arg>
310316
<arg>-feature</arg>
317+
<arg>-nobootcp</arg>
311318
</args>
312319
<!--<recompileMode>incremental</recompileMode>-->
313320
<!--<useZincServer>false</useZincServer>-->
@@ -339,6 +346,7 @@
339346
<version>2.10.3</version>
340347
<configuration>
341348
<excludePackageNames>com.mongodb:com.github.fakemongo.impl</excludePackageNames>
349+
<source>${java.version}</source>
342350
</configuration>
343351
<executions>
344352
<execution>
@@ -490,8 +498,8 @@
490498
<artifactId>maven-compiler-plugin</artifactId>
491499
<version>3.2</version>
492500
<configuration>
493-
<source>1.6</source>
494-
<target>1.6</target>
501+
<source>${java.version}</source>
502+
<target>${java.version}</target>
495503
<encoding>UTF-8</encoding>
496504
<testIncludes>
497505
<include>com/github/fakemongo/PerfTest.java</include>

Diff for: src/main/java/com/github/fakemongo/junit/FongoRule.java

+1
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ public class FongoRule extends ExternalResource {
6363
* @param serverVersion version of the server to use for fongo.
6464
* @param realMongo set to true if you want to use a real mongoDB.
6565
* @param mongoClientIfReal real client to use if realMongo si true.
66+
* @param codecRegistry the codec registry used by fongo.
6667
*/
6768
public FongoRule(final String dbName, final ServerVersion serverVersion, final boolean realMongo, final MongoClient mongoClientIfReal, final CodecRegistry codecRegistry) {
6869
this.dbName = dbName;

Diff for: src/main/java/com/mongodb/FongoDBCollection.java

+1-2
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@
4444
import org.bson.types.ObjectId;
4545
import org.slf4j.Logger;
4646
import org.slf4j.LoggerFactory;
47-
import sun.reflect.generics.reflectiveObjects.NotImplementedException;
4847

4948

5049
import static com.mongodb.assertions.Assertions.isTrueArgument;
@@ -1211,7 +1210,7 @@ BulkWriteResult executeBulkWriteOperation(final boolean ordered, final Boolean b
12111210
}
12121211
}
12131212
} else {
1214-
throw new NotImplementedException();
1213+
throw new UnsupportedOperationException();
12151214
}
12161215
idx++;
12171216
}

0 commit comments

Comments
 (0)