-
Notifications
You must be signed in to change notification settings - Fork 885
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CASSJAVA-40: Driver testing against Java 21 #1999
base: 4.x
Are you sure you want to change the base?
Changes from all commits
33fc6f1
9122c6d
6c04c94
a0f7563
8228938
faa18fd
62e1246
29666ba
1cfa0aa
5767fdb
c34f45a
6a98e15
e983360
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -35,7 +35,7 @@ pipeline { | |
axes { | ||
axis { | ||
name 'TEST_JAVA_VERSION' | ||
values '[email protected]', '[email protected]', 'openjdk@17' | ||
values '[email protected]', '[email protected]', 'openjdk@17', '[email protected]' | ||
} | ||
axis { | ||
name 'SERVER_VERSION' | ||
|
@@ -67,7 +67,7 @@ pipeline { | |
def executeTests() { | ||
def testJavaMajorVersion = (TEST_JAVA_VERSION =~ /@(?:1\.)?(\d+)/)[0][1] | ||
sh """ | ||
container_id=\$(docker run -td -e TEST_JAVA_VERSION=${TEST_JAVA_VERSION} -e SERVER_VERSION=${SERVER_VERSION} -e TEST_JAVA_MAJOR_VERSION=${testJavaMajorVersion} -v \$(pwd):/home/docker/cassandra-java-driver apache.jfrog.io/cassan-docker/apache/cassandra-java-driver-testing-ubuntu2204 'sleep 2h') | ||
container_id=\$(docker run -td -e TEST_JAVA_VERSION=${TEST_JAVA_VERSION} -e SERVER_VERSION=${SERVER_VERSION} -e TEST_JAVA_MAJOR_VERSION=${testJavaMajorVersion} -v \$(pwd):/home/docker/cassandra-java-driver janehe158/cassandra-java-driver-dev-env 'sleep 2h') | ||
docker exec --user root \$container_id bash -c \"sudo bash /home/docker/cassandra-java-driver/ci/create-user.sh docker \$(id -u) \$(id -g) /home/docker/cassandra-java-driver\" | ||
docker exec --user docker \$container_id './cassandra-java-driver/ci/run-tests.sh' | ||
( nohup docker stop \$container_id >/dev/null 2>/dev/null & ) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,6 +18,7 @@ | |
package com.datastax.oss.driver.internal.core.util; | ||
|
||
import edu.umd.cs.findbugs.annotations.NonNull; | ||
import java.util.Random; | ||
import java.util.concurrent.ThreadLocalRandom; | ||
|
||
public class ArrayUtils { | ||
|
@@ -77,7 +78,7 @@ public static <ElementT> void shuffleHead(@NonNull ElementT[] elements, int n) { | |
* Fisher-Yates shuffle</a> | ||
*/ | ||
public static <ElementT> void shuffleHead( | ||
@NonNull ElementT[] elements, int n, @NonNull ThreadLocalRandom random) { | ||
@NonNull ElementT[] elements, int n, @NonNull Random random) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Mockito says they can no longer support mocking of |
||
if (n > elements.length) { | ||
throw new ArrayIndexOutOfBoundsException( | ||
String.format( | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -79,7 +79,7 @@ public class QueryTraceFetcherTest { | |
@Mock private NettyOptions nettyOptions; | ||
@Mock private EventExecutorGroup adminEventExecutorGroup; | ||
@Mock private EventExecutor eventExecutor; | ||
@Mock private InetAddress address; | ||
private InetAddress address = InetAddress.getLoopbackAddress(); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Mockito can no longer mock |
||
|
||
@Captor private ArgumentCaptor<SimpleStatement> statementCaptor; | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,6 +31,7 @@ | |
import java.util.Arrays; | ||
import java.util.Collection; | ||
import java.util.Collections; | ||
import java.util.HashMap; | ||
import java.util.LinkedHashMap; | ||
import java.util.List; | ||
import java.util.Locale; | ||
|
@@ -409,7 +410,16 @@ protected void processLine(String line, int logLevel) { | |
executor.setStreamHandler(streamHandler); | ||
executor.setWatchdog(watchDog); | ||
|
||
int retValue = executor.execute(cli); | ||
int retValue; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I modified There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can be reverted once #2000 is merged. |
||
if (System.getProperty("testJavaHome") != null) { | ||
// Set PATH and JAVA_HOME to enable ccm to find the correct java | ||
Map<String, String> env = new HashMap<>(System.getenv()); | ||
env.put("PATH", System.getProperty("testJavaHome") + "/bin:" + env.get("PATH")); | ||
env.put("JAVA_HOME", System.getProperty("testJavaHome")); | ||
retValue = executor.execute(cli, env); | ||
} else { | ||
retValue = executor.execute(cli); | ||
} | ||
if (retValue != 0) { | ||
LOG.error("Non-zero exit code ({}) returned from executing ccm command: {}", retValue, cli); | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was required by CCM right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change should be reverted together with the CcmBridge changes when your PR-2000 is merged.