Skip to content

Commit

Permalink
apacheGH-37128: [Java] Bump CI job from JDK 18 to JDK 20 (apache#37125)
Browse files Browse the repository at this point in the history
### Rationale for this change

Our CI job should be testing the latest Java/Maven combo. It has currently fallen behind by 2 JDK releases (18 -> 20). Also, let's bump the maven version to the latest stable release.

We are also seeing some flaky CI jobs related to CycloneDx that only fails on the Java 18 CI job. Maybe this resolves it? For more details, see apache#36371

### What changes are included in this PR?

* Bump Java/Maven versions for one CI job

### Are these changes tested?

Relying on CI to test.

### Are there any user-facing changes?

No
* Closes: apache#37128

Authored-by: Dane Pitkin <[email protected]>
Signed-off-by: David Li <[email protected]>
  • Loading branch information
danepitkin authored Aug 14, 2023
1 parent b97e526 commit 239c23a
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 21 deletions.
16 changes: 8 additions & 8 deletions .github/workflows/java.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ jobs:
strategy:
fail-fast: false
matrix:
jdk: [8, 11, 17, 18]
jdk: [8, 11, 17, 20]
include:
- jdk: 8
title: AMD64 Debian 9 Java JDK 8 Maven 3.5.4
Expand All @@ -66,13 +66,13 @@ jobs:
maven: 3.6.2
image: debian-java
- jdk: 17
title: AMD64 Oracle Linux Server 8.5 Java JDK 17 Maven 3.8.5
maven: 3.8.5
image: oracle-java
- jdk: 18
title: AMD64 Oracle Linux Server 8.6 Java JDK 18 Maven 3.8.5
maven: 3.8.5
image: oracle-java
title: AMD64 Ubuntu 22.04 Java JDK 17 Maven 3.9.3
maven: 3.9.3
image: eclipse-java
- jdk: 20
title: AMD64 Ubuntu 22.04 Java JDK 20 Maven 3.9.3
maven: 3.9.3
image: eclipse-java
env:
JDK: ${{ matrix.jdk }}
MAVEN: ${{ matrix.maven }}
Expand Down
14 changes: 7 additions & 7 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -136,9 +136,9 @@ x-hierarchy:
- debian-go-cgo-python
- debian-java
- debian-js
- eclipse-java
- fedora-cpp:
- fedora-python
- oracle-java
- python-sdist
- ubuntu-cpp:
- ubuntu-cpp-static
Expand Down Expand Up @@ -1665,14 +1665,14 @@ services:
/arrow/ci/scripts/java_build.sh /arrow /build &&
/arrow/ci/scripts/java_test.sh /arrow /build"

oracle-java:
eclipse-java:
# Usage:
# docker-compose build oracle-java
# docker-compose run oracle-java
# docker-compose build eclipse-java
# docker-compose run eclipse-java
# Parameters:
# MAVEN: 3.8.5
# JDK: 17
image: ${ARCH}/maven:${MAVEN}-openjdk-${JDK}
# MAVEN: 3.9.3
# JDK: 17, 20
image: ${ARCH}/maven:${MAVEN}-eclipse-temurin-${JDK}
shm_size: *shm-size
volumes: *java-volumes
command: *java-command
Expand Down
4 changes: 2 additions & 2 deletions java/flight/flight-sql-jdbc-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -107,14 +107,14 @@
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<version>3.12.4</version>
<version>4.11.0</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-inline</artifactId>
<version>3.12.4</version>
<version>4.11.0</version>
<scope>test</scope>
</dependency>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ private MockedStatic<KeyStore> createKeyStoreStaticMock() {
if (method.getName().equals("getInstance")) {
return invocationOnMock.callRealMethod();
}
return invocationOnMock.getMock();
return method.invoke(invocationOnMock.getMock(), invocationOnMock.getArguments());
}
);
}
Expand All @@ -169,13 +169,15 @@ private MockedStatic<ClientAuthenticationUtils> createClientAuthenticationUtilsS
if (method.getName().equals("getCertificateInputStreamFromSystem")) {
return invocationOnMock.callRealMethod();
}
return invocationOnMock.getMock();
return method.invoke(invocationOnMock.getMock(), invocationOnMock.getArguments());
});
}

private void setOperatingSystemMock(MockedStatic<ClientAuthenticationUtils> clientAuthenticationUtilsMockedStatic,
boolean isWindows, boolean isMac) {
clientAuthenticationUtilsMockedStatic.when(ClientAuthenticationUtils::isMac).thenReturn(isMac);
Assert.assertEquals(ClientAuthenticationUtils.isMac(), isMac);
clientAuthenticationUtilsMockedStatic.when(ClientAuthenticationUtils::isWindows).thenReturn(isWindows);
Assert.assertEquals(ClientAuthenticationUtils.isWindows(), isWindows);
}
}
4 changes: 2 additions & 2 deletions java/flight/flight-sql-jdbc-driver/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -68,14 +68,14 @@
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<version>3.12.4</version>
<version>4.11.0</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-inline</artifactId>
<version>3.12.4</version>
<version>4.11.0</version>
<scope>test</scope>
</dependency>

Expand Down

0 comments on commit 239c23a

Please sign in to comment.