Skip to content

Commit

Permalink
Let CI run with JDK 11 and 17.
Browse files Browse the repository at this point in the history
  • Loading branch information
uhafner committed Aug 11, 2022
1 parent 6c86c10 commit 56c0339
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 9 deletions.
8 changes: 5 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on:
push:
branches:
- master
- main
pull_request:

jobs:
Expand All @@ -12,17 +13,18 @@ jobs:
strategy:
matrix:
platform: [ubuntu-latest, macos-latest, windows-latest]
jdk: [11, 17]

runs-on: ${{ matrix.platform }}
name: on ${{ matrix.platform }}
name: on ${{ matrix.platform }} with JDK ${{ matrix.jdk }}

steps:
- uses: actions/checkout@v3
- name: Set up JDK 11
- name: Set up JDK ${{ matrix.jdk }}
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '11'
java-version: '${{ matrix.jdk }}'
check-latest: true
cache: 'maven'
- name: Build with Maven
Expand Down
21 changes: 15 additions & 6 deletions src/test/java/edu/hm/hafner/analysis/DuplicationGroupTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
*/
class DuplicationGroupTest extends SerializableTest<DuplicationGroup> {
/**
* Serializes an code duplication to a file. Use this method in case the properties have been changed and the
* Serializes a code duplication to a file. Use this method in case the properties have been changed and the
* readResolve method has been adapted accordingly so that the old serialization still can be read.
*
* @param args
Expand Down Expand Up @@ -105,10 +105,19 @@ void shouldReferenceAllDuplications() {

@Test
void shouldObeyEqualsContract() {
EqualsVerifier
.forClass(DuplicationGroup.class)
.withOnlyTheseFields("codeFragment").suppress(Warning.NONFINAL_FIELDS)
.withPrefabValues(TreeString.class, TreeString.valueOf("One"), TreeString.valueOf("Two"))
.verify();
try (IssueBuilder builder = new IssueBuilder()) {
LineRangeList red = new LineRangeList();
red.add(new LineRange(1));
LineRangeList blue = new LineRangeList();
blue.add(new LineRange(2));
EqualsVerifier
.forClass(DuplicationGroup.class)
.withOnlyTheseFields("codeFragment")
.withPrefabValues(LineRangeList.class, red, blue)
.withPrefabValues(Issue.class, builder.setFileName("red").build(), builder.setFileName("blue").build())
.withPrefabValues(TreeString.class, TreeString.valueOf("red"), TreeString.valueOf("blue"))
.suppress(Warning.NONFINAL_FIELDS)
.verify();
}
}
}

0 comments on commit 56c0339

Please sign in to comment.