Skip to content

Commit aa49fcd

Browse files
committed
introduce openjdk17 compile compatibility
1 parent 44c761e commit aa49fcd

File tree

7 files changed

+57
-34
lines changed

7 files changed

+57
-34
lines changed

.travis.yml

+1-4
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,10 @@
11
# more details for build customization see http://docs.travis-ci.com/user/customizing-the-build/
22
language: java
33

4-
# use the container based infrastructure on travis
5-
sudo: false
6-
74
jdk:
85
- openjdk8
96
- openjdk11
10-
- openjdk15
7+
- openjdk17
118

129
# enable cache to stop downloading all maven plugins every time
1310
cache:

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
GCViewer 1.36
22
=============
33

4-
[![Build Status](https://travis-ci.com/chewiebug/GCViewer.svg?branch=develop)](https://travis-ci.com/chewiebug/GCViewer)
4+
[![Build Status](https://app.travis-ci.com/chewiebug/GCViewer.svg?branch=develop)](https://app.travis-ci.com/chewiebug/GCViewer)
55
[![codecov.io](https://codecov.io/github/chewiebug/GCViewer/coverage.svg?branch=develop)](https://codecov.io/github/chewiebug/GCViewer?branch=develop)
66

77
GCViewer is a little tool that visualizes verbose GC output

pom.xml

+36-19
Original file line numberDiff line numberDiff line change
@@ -198,13 +198,13 @@
198198

199199
<properties>
200200
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
201-
<junit.version>4.13.1</junit.version>
202-
<hamcrest.version>1.3</hamcrest.version>
203-
<mockito.version>1.10.19</mockito.version>
201+
<junit.version>4.13.2</junit.version>
202+
<hamcrest.version>2.2</hamcrest.version>
203+
<mockito.version>4.3.1</mockito.version>
204204
<jdk.source.version>1.8</jdk.source.version>
205205
<jdk.target.version>1.8</jdk.target.version>
206206
<tools.maven.plugin.version>1.4</tools.maven.plugin.version>
207-
<jacoco.maven.plugin.version>0.8.6</jacoco.maven.plugin.version>
207+
<jacoco.maven.plugin.version>0.8.7</jacoco.maven.plugin.version>
208208
<maven.source.plugin.version>3.0.1</maven.source.plugin.version>
209209
<maven.javadoc.plugin.version>3.0.1</maven.javadoc.plugin.version>
210210
<maven.gpg.plugin.version>1.6</maven.gpg.plugin.version>
@@ -219,7 +219,7 @@
219219
<!-- https://issues.apache.org/jira/browse/MRELEASE-1013 -->
220220
<maven.scm.plugin.version>1.10.0</maven.scm.plugin.version>
221221
<maven.deploy.plugin.version>2.8.2</maven.deploy.plugin.version>
222-
<maven.jdeps.plugin.version>3.1.1</maven.jdeps.plugin.version>
222+
<maven.jdeps.plugin.version>3.1.2</maven.jdeps.plugin.version>
223223
<nexus.staging.maven.plugin.version>1.6.8</nexus.staging.maven.plugin.version>
224224
</properties>
225225

@@ -239,13 +239,13 @@
239239
</dependency>
240240
<dependency>
241241
<groupId>org.hamcrest</groupId>
242-
<artifactId>hamcrest-library</artifactId>
242+
<artifactId>hamcrest</artifactId>
243243
<version>${hamcrest.version}</version>
244244
<scope>test</scope>
245245
</dependency>
246246
<dependency>
247247
<groupId>org.mockito</groupId>
248-
<artifactId>mockito-all</artifactId>
248+
<artifactId>mockito-core</artifactId>
249249
<version>${mockito.version}</version>
250250
<scope>test</scope>
251251
</dependency>
@@ -432,22 +432,22 @@
432432
<artifactId>maven-site-plugin</artifactId>
433433
<version>3.7.1</version>
434434
</plugin>
435+
<plugin>
436+
<artifactId>maven-jdeps-plugin</artifactId>
437+
<version>${maven.jdeps.plugin.version}</version>
438+
<executions>
439+
<execution>
440+
<goals>
441+
<goal>jdkinternals</goal> <!-- verify main classes -->
442+
<goal>test-jdkinternals</goal> <!-- verify test classes -->
443+
</goals>
444+
</execution>
445+
</executions>
446+
</plugin>
435447
</plugins>
436448
</pluginManagement>
437449

438450
<plugins>
439-
<plugin>
440-
<artifactId>maven-jdeps-plugin</artifactId>
441-
<version>${maven.jdeps.plugin.version}</version>
442-
<executions>
443-
<execution>
444-
<goals>
445-
<goal>jdkinternals</goal> <!-- verify main classes -->
446-
<goal>test-jdkinternals</goal> <!-- verify test classes -->
447-
</goals>
448-
</execution>
449-
</executions>
450-
</plugin>
451451
<plugin>
452452
<groupId>org.codehaus.mojo</groupId>
453453
<artifactId>buildnumber-maven-plugin</artifactId>
@@ -557,6 +557,23 @@
557557
</build>
558558

559559
<profiles>
560+
<profile>
561+
<id>jdk9plus-build</id>
562+
<activation>
563+
<jdk>[9,17]</jdk>
564+
</activation>
565+
<build>
566+
<plugins>
567+
<plugin>
568+
<artifactId>maven-jdeps-plugin</artifactId>
569+
<configuration>
570+
<multiRelease>base</multiRelease>
571+
</configuration>
572+
</plugin>
573+
</plugins>
574+
</build>
575+
</profile>
576+
560577
<profile>
561578
<!-- Override plugin versions of Sonatype profile. This needs
562579
to be done here because profiles are not inherited. -->

src/test/java/com/tagtraum/perf/gcviewer/GCViewerTest.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import static org.hamcrest.MatcherAssert.assertThat;
44
import static org.hamcrest.Matchers.is;
5-
import static org.mockito.Matchers.any;
5+
import static org.mockito.ArgumentMatchers.any;
66
import static org.mockito.Mockito.mock;
77
import static org.mockito.Mockito.never;
88
import static org.mockito.Mockito.verify;

src/test/java/com/tagtraum/perf/gcviewer/ctrl/impl/GCModelLoaderFactoryTest.java

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
package com.tagtraum.perf.gcviewer.ctrl.impl;
22

3+
import static org.hamcrest.CoreMatchers.instanceOf;
4+
import static org.hamcrest.MatcherAssert.assertThat;
5+
import static org.mockito.Mockito.mock;
6+
37
import com.tagtraum.perf.gcviewer.model.GCResource;
48
import com.tagtraum.perf.gcviewer.model.GcResourceFile;
59
import com.tagtraum.perf.gcviewer.model.GcResourceSeries;
610
import org.junit.Rule;
711
import org.junit.Test;
812
import org.junit.rules.ExpectedException;
913
import org.junit.runner.RunWith;
10-
import org.mockito.runners.MockitoJUnitRunner;
11-
12-
import static org.hamcrest.CoreMatchers.instanceOf;
13-
import static org.hamcrest.MatcherAssert.assertThat;
14-
import static org.mockito.Mockito.mock;
14+
import org.mockito.junit.MockitoJUnitRunner;
1515

1616
/**
1717
* @author martin.geldmacher

src/test/java/com/tagtraum/perf/gcviewer/ctrl/impl/GcSeriesLoaderTest.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
import org.junit.rules.ExpectedException;
3333
import org.junit.rules.TemporaryFolder;
3434
import org.junit.runner.RunWith;
35-
import org.mockito.runners.MockitoJUnitRunner;
35+
import org.mockito.junit.MockitoJUnitRunner;
3636

3737
@RunWith(MockitoJUnitRunner.class)
3838
public class GcSeriesLoaderTest {

src/test/java/com/tagtraum/perf/gcviewer/imp/TestDataReaderFacade.java

+12-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package com.tagtraum.perf.gcviewer.imp;
22

33
import static org.hamcrest.CoreMatchers.is;
4+
import static org.hamcrest.Matchers.greaterThanOrEqualTo;
45
import static org.junit.Assert.assertEquals;
56
import static org.junit.Assert.assertNotNull;
67
import static org.junit.Assert.assertThat;
@@ -89,9 +90,9 @@ public void loadModelIllegalArgument() throws Exception {
8990
}
9091
catch (DataReaderException e) {
9192
assertNotNull("cause", e.getCause());
92-
Class expectedClass;
93-
String javaVersion = System.getProperty("java.version");
94-
if (javaVersion.startsWith("14") || javaVersion.startsWith("15")) {
93+
Class<?> expectedClass;
94+
int javaMajorVersion = getJavaMajorVersion();
95+
if (javaMajorVersion > 13) {
9596
expectedClass = IOException.class;
9697
} else {
9798
expectedClass = IllegalArgumentException.class;
@@ -171,4 +172,12 @@ public void testLoadModelFromSeries() throws IOException, DataReaderException {
171172
GCModel result = dataReaderFacade.loadModel(series);
172173
assertThat(result.toString(), is(expectedModel.toString()));
173174
}
175+
176+
private int getJavaMajorVersion() {
177+
String javaVersion = System.getProperty("java.version");
178+
String[] javaVersionParts = javaVersion.split("\\.");
179+
assertThat("java version format", javaVersionParts.length, greaterThanOrEqualTo(1));
180+
return Integer.parseInt(javaVersionParts[0]);
181+
}
182+
174183
}

0 commit comments

Comments
 (0)