Skip to content

Commit

Permalink
Merge pull request #14 from l0s/13_build-on-newer-jdks
Browse files Browse the repository at this point in the history
Support building on newer JDKs
  • Loading branch information
RavenVSS authored Aug 3, 2023
2 parents 130f0d5 + 0983e08 commit 6e46fbf
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 21 deletions.
7 changes: 5 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,17 @@ on:
jobs:
build:
runs-on: ubuntu-20.04
strategy:
matrix:
version: [8, 11, 17, 20]
steps:
# checkout
- uses: actions/checkout@v3
- name: set up JDK 8
- name: set up JDK
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: 8
java-version: ${{ matrix.version }}

# build project and run all tests & checks
- name: Maven Verify
Expand Down
39 changes: 26 additions & 13 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -64,18 +64,22 @@
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
</repository>
</distributionManagement>

<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.junit</groupId>
<artifactId>junit-bom</artifactId>
<version>${junit-jupiter.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<dependency>
<groupId>org.junit</groupId>
<artifactId>junit-bom</artifactId>
<version>${junit-jupiter.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.28</version>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<dependency>
<groupId>org.awaitility</groupId>
Expand All @@ -92,7 +96,13 @@
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<version>2.15.0</version>
<version>3.5.13</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-junit-jupiter</artifactId>
<version>4.11.0</version> <!-- Newer versions are incompatible with JDK 8 -->
<scope>test</scope>
</dependency>
<dependency>
Expand Down Expand Up @@ -209,7 +219,7 @@
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.8.4</version>
<version>0.8.6</version>
<executions>
<execution>
<goals>
Expand Down Expand Up @@ -257,6 +267,9 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.9.1</version>
<configuration>
<source>8</source>
</configuration>
<executions>
<execution>
<id>attach-javadocs</id>
Expand Down
8 changes: 5 additions & 3 deletions src/test/java/com/antkorwin/xsync/CollisionDetectorTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,16 @@
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Nested;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import org.mockito.Mock;
import org.mockito.junit.jupiter.MockitoExtension;

import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.Mockito.mock;


@ExtendWith(MockitoExtension.class)
class CollisionDetectorTest {

@Mock
private XMutexFactory<Integer> factory;
private MutexSorter<Integer> sorter;

Expand All @@ -21,7 +24,6 @@ class CollisionDetecting {

@BeforeEach
void setUp() {
factory = mock(XMutexFactory.class);
sorter = new MutexSorter<>(factory);
}

Expand Down
5 changes: 2 additions & 3 deletions src/test/java/com/antkorwin/xsync/MultiKeysXSyncTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
import com.jupiter.tools.stress.test.concurrency.ExecutionMode;
import com.jupiter.tools.stress.test.concurrency.StressTestRunner;
import org.junit.jupiter.api.Test;
import sun.reflect.generics.reflectiveObjects.NotImplementedException;

import static org.assertj.core.api.Assertions.assertThat;

Expand Down Expand Up @@ -326,14 +325,14 @@ void throwExceptionInFunction() {
try {
xsync.evaluate(Arrays.asList(123L), () -> {
// nop
throw new NotImplementedException();
throw new UnsupportedOperationException();
});
} catch (Exception e) {
exception = e;
}

assertThat(exception).isNotNull();
assertThat(exception.getClass()).isEqualTo(NotImplementedException.class);
assertThat(exception.getClass()).isEqualTo(UnsupportedOperationException.class);
}


Expand Down

0 comments on commit 6e46fbf

Please sign in to comment.