-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
273 additions
and
68 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
# Java Maven CircleCI 2.0 configuration file | ||
# | ||
# Check https://circleci.com/docs/2.0/language-java/ for more details | ||
# | ||
version: 2 | ||
|
||
references: | ||
build: &build | ||
working_directory: ~/repo | ||
|
||
environment: | ||
# Customize the JVM maximum heap limit | ||
MAVEN_OPTS: -Xmx2048m | ||
JACOCO: false | ||
|
||
steps: | ||
- checkout | ||
|
||
# Download and cache dependencies | ||
- restore_cache: | ||
keys: | ||
- v2-dependencies-{{ checksum "pom.xml" }} | ||
# fallback to using the latest cache if no exact match is found | ||
- v2-dependencies- | ||
|
||
- run: | ||
name: Go Offline with Maven | ||
command: mvn verify -DskipTests | ||
|
||
- save_cache: | ||
paths: | ||
- ~/.m2 | ||
key: v2-dependencies-{{ checksum "pom.xml" }} | ||
|
||
# run tests! | ||
- run: | ||
name: Run integration tests | ||
command: mvn verify | ||
|
||
workflows: | ||
version: 2 | ||
integration-tests: | ||
jobs: | ||
- zulu-6 | ||
- zulu-7 | ||
- zulu-8 | ||
- zulu-9 | ||
- zulu-11 | ||
|
||
jobs: | ||
zulu-6: | ||
docker: | ||
- image: wavesoftware/circleci-zulujdk:6 | ||
<<: *build | ||
zulu-7: | ||
docker: | ||
- image: wavesoftware/circleci-zulujdk:7 | ||
<<: *build | ||
zulu-8: | ||
docker: | ||
- image: wavesoftware/circleci-zulujdk:8 | ||
<<: *build | ||
zulu-9: | ||
docker: | ||
- image: wavesoftware/circleci-zulujdk:9 | ||
<<: *build | ||
zulu-11: | ||
docker: | ||
- image: wavesoftware/circleci-zulujdk:11 | ||
<<: *build | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,24 @@ | ||
language: java | ||
dist: trusty | ||
before_script: mvn dependency:go-offline | ||
script: mvn clean verify --fail-at-end | ||
notifications: | ||
email: | ||
on_failure: true | ||
on_failure: change | ||
matrix: | ||
include: | ||
# Performance testing | ||
- jdk: openjdk7 | ||
env: JACOCO=false | ||
- jdk: openjdk8 | ||
env: JACOCO=false | ||
# Quality testing | ||
- jdk: openjdk7 | ||
env: JACOCO=true | ||
- jdk: openjdk8 | ||
env: JACOCO=true COVERALLS=true | ||
- jdk: oraclejdk8 | ||
env: JACOCO=true | ||
- jdk: openjdk8 | ||
env: JACOCO=true SONAR=publish | ||
script: mvn clean verify sonar:sonar --fail-at-end | ||
# Quality testing | ||
- jdk: oraclejdk8 | ||
env: JACOCO=true COVERALLS=true | ||
- jdk: oraclejdk8 | ||
env: JACOCO=true SONAR=publish | ||
script: mvn clean verify sonar:sonar --fail-at-end | ||
# Performance testing | ||
- jdk: openjdk7 | ||
env: JACOCO=false | ||
- jdk: openjdk8 | ||
env: JACOCO=false | ||
- jdk: oraclejdk9 | ||
env: JACOCO=false | ||
- jdk: oraclejdk11 | ||
env: JACOCO=false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
/* | ||
* Copyright (c) 2018 Wave Software | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package pl.wavesoftware.testing; | ||
|
||
/** | ||
* @author <a href="mailto:krzysztof.suszynski@wavesoftware.pl">Krzysztof Suszynski</a> | ||
* @since 2018-12-29 | ||
*/ | ||
public final class JavaVersion implements Comparable<JavaVersion> { | ||
private final int major; | ||
|
||
private JavaVersion(int major) { | ||
this.major = major; | ||
} | ||
|
||
public static JavaVersion get() { | ||
return new JavaVersion(getMajor()); | ||
} | ||
|
||
public static JavaVersion of(int major) { | ||
return new JavaVersion(major); | ||
} | ||
|
||
private static int getMajor() { | ||
String version = System.getProperty("java.version"); | ||
if (version.startsWith("1.")) { | ||
version = version.substring(2); | ||
} | ||
// Allow these formats: | ||
// 1.8.0_72-ea | ||
// 9-ea | ||
// 9 | ||
// 9.0.1 | ||
int dotPos = version.indexOf('.'); | ||
int dashPos = version.indexOf('-'); | ||
return Integer.parseInt(version.substring( | ||
0, | ||
dotPos > -1 | ||
? dotPos | ||
: dashPos > -1 | ||
? dashPos : 1 | ||
)); | ||
} | ||
|
||
public boolean greaterOrEqual(JavaVersion other) { | ||
return compareTo(other) >= 0; | ||
} | ||
|
||
@Override | ||
public int compareTo(JavaVersion other) { | ||
return this.major - other.major; | ||
} | ||
} |
Oops, something went wrong.