Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,9 @@ public abstract class AbstractClientCompatibilityTest extends IgniteCompatibilit
/** Version 2.15.0. */
protected static final IgniteProductVersion VER_2_15_0 = IgniteProductVersion.fromString("2.15.0");

/** Version 2.16.0. */
protected static final IgniteProductVersion VER_2_16_0 = IgniteProductVersion.fromString("2.16.0");

/** Version 2.18.0. */
protected static final IgniteProductVersion VER_2_18_0 = IgniteProductVersion.fromString("2.18.0");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,21 +81,28 @@ public class JavaThinCompatibilityStoragePathTest extends AbstractClientCompatib

/** {@inheritDoc} */
@Override public void testOldClientToCurrentServer() throws Exception {
assumeTrue("Cluster state API exists only from 2.9.0 release", ver.compareTo(VER_2_9_0) >= 0);
assumeVersionSupported();

super.testOldClientToCurrentServer();
}

/** {@inheritDoc} */
@Override public void testCurrentClientToOldServer() throws Exception {
assumeVersionSupported();

super.testCurrentClientToOldServer();
}

/** Skips the test if the old version doesn't support the cluster state API or the current JDK. */
private void assumeVersionSupported() {
int majorJavaVer = U.majorJavaVersion(U.jdkVersion());

if (majorJavaVer >= 17)
if (majorJavaVer >= 21)
assumeTrue("JDK 21 support is available starting with release 2.16.0", ver.compareTo(VER_2_16_0) >= 0);
else if (majorJavaVer >= 17)
assumeTrue("JDK 17 support is available starting with release 2.13.0", ver.compareTo(VER_2_13_0) >= 0);
else
assumeTrue("Cluster state API exists only from 2.9.0 release", ver.compareTo(VER_2_9_0) >= 0);

super.testCurrentClientToOldServer();
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,11 @@ public class JavaThinCompatibilityTest extends AbstractClientCompatibilityTest {

int majorJavaVer = U.majorJavaVersion(U.jdkVersion());

if (majorJavaVer > 11) {
if (majorJavaVer >= 21) {
Assume.assumeTrue("Skipped on jdk " + U.jdkVersion(),
VER_2_16_0.compareTo(IgniteProductVersion.fromString(verFormatted)) <= 0);
}
else if (majorJavaVer > 11) {
Assume.assumeTrue("Skipped on jdk " + U.jdkVersion(),
VER_2_12_0.compareTo(IgniteProductVersion.fromString(verFormatted)) < 0);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,11 @@ private static void executeSql(IgniteEx igniteEx, String sql) {

int majorJavaVer = U.majorJavaVersion(U.jdkVersion());

if (majorJavaVer > 11) {
if (majorJavaVer >= 21) {
Assume.assumeTrue("Skipped on jdk " + U.jdkVersion(),
VER_2_16_0.compareTo(IgniteProductVersion.fromString(verFormatted)) <= 0);
}
else if (majorJavaVer > 11) {
Assume.assumeTrue("Skipped on jdk " + U.jdkVersion(),
VER_2_12_0.compareTo(IgniteProductVersion.fromString(verFormatted)) < 0);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ public void testSecondaryIndexesMigration_2_7_6() throws Exception {

/** */
@Test
@SkipTestIfIsJdkNewer(17)
public void testSecondaryIndexesMigration_2_13_0() throws Exception {
// 2.13.0 - version with _KEY unwrapping, but before index processing moved to the core module.
doTestStartupWithOldVersion("2.13.0", () -> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
import org.junit.runners.Parameterized;

import static org.apache.ignite.compatibility.IgniteReleasedVersion.VER_2_12_0;
import static org.apache.ignite.compatibility.IgniteReleasedVersion.VER_2_16_0;
import static org.apache.ignite.compatibility.IgniteReleasedVersion.VER_2_6_0;
import static org.apache.ignite.compatibility.IgniteReleasedVersion.since;
import static org.apache.ignite.testframework.GridTestUtils.cartesianProduct;
Expand Down Expand Up @@ -112,7 +113,11 @@ public static Collection<Object[]> runConfig() {
public void testQueryOldIndex() throws Exception {
int majorJavaVer = U.majorJavaVersion(U.jdkVersion());

if (majorJavaVer > 11) {
if (majorJavaVer >= 21) {
Assume.assumeTrue("Skipped on jdk " + U.jdkVersion(),
VER_2_16_0.compareTo(IgniteReleasedVersion.fromString(igniteVer)) <= 0);
}
else if (majorJavaVer > 11) {
Assume.assumeTrue("Skipped on jdk " + U.jdkVersion(),
VER_2_12_0.compareTo(IgniteReleasedVersion.fromString(igniteVer)) < 0);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
import org.junit.runners.Parameterized;

import static org.apache.ignite.compatibility.IgniteReleasedVersion.VER_2_12_0;
import static org.apache.ignite.compatibility.IgniteReleasedVersion.VER_2_16_0;
import static org.apache.ignite.compatibility.IgniteReleasedVersion.VER_2_6_0;
import static org.apache.ignite.compatibility.IgniteReleasedVersion.since;
import static org.apache.ignite.testframework.GridTestUtils.cartesianProduct;
Expand Down Expand Up @@ -83,7 +84,11 @@ public static Collection<Object[]> runConfig() {
public void testQueryOldInlinedIndex() throws Exception {
int majorJavaVer = U.majorJavaVersion(U.jdkVersion());

if (majorJavaVer > 11) {
if (majorJavaVer >= 21) {
Assume.assumeTrue("Skipped on jdk " + U.jdkVersion(),
VER_2_16_0.compareTo(IgniteReleasedVersion.fromString(igniteVer)) <= 0);
}
else if (majorJavaVer > 11) {
Assume.assumeTrue("Skipped on jdk " + U.jdkVersion(),
VER_2_12_0.compareTo(IgniteReleasedVersion.fromString(igniteVer)) < 0);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
import org.junit.runners.Parameterized;

import static org.apache.ignite.compatibility.IgniteReleasedVersion.VER_2_12_0;
import static org.apache.ignite.compatibility.IgniteReleasedVersion.VER_2_16_0;
import static org.apache.ignite.compatibility.IgniteReleasedVersion.VER_2_1_0;
import static org.apache.ignite.compatibility.IgniteReleasedVersion.VER_2_3_0;
import static org.apache.ignite.compatibility.IgniteReleasedVersion.since;
Expand Down Expand Up @@ -104,7 +105,11 @@ public static Collection<Object[]> parameters() {
public void testNodeStartByOldVersionPersistenceData() throws Exception {
int majorJavaVer = U.majorJavaVersion(U.jdkVersion());

if (majorJavaVer > 11) {
if (majorJavaVer >= 21) {
Assume.assumeTrue("Skipped on jdk " + U.jdkVersion(),
VER_2_16_0.compareTo(IgniteReleasedVersion.fromString(version)) <= 0);
}
else if (majorJavaVer > 11) {
Assume.assumeTrue("Skipped on jdk " + U.jdkVersion(),
VER_2_12_0.compareTo(IgniteReleasedVersion.fromString(version)) < 0);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ public void testOldNodeRejected() throws Exception {

GridTestUtils.assertThrows(
log,
() -> startGrid("old-node", OLD_VERSION.toString(), new ConfigurationClosure()),
() -> startGrid("old-node", OLD_VERSION.toString(), new ConfigurationClosure(client)),
AssertionError.class,
null
);
Expand All @@ -94,7 +94,15 @@ public void testOldNodeRejected() throws Exception {
}

/** Setup node closure. */
private class ConfigurationClosure implements IgniteInClosure<IgniteConfiguration> {
private static class ConfigurationClosure implements IgniteInClosure<IgniteConfiguration> {
/** */
private final boolean client;

/** @param client Client mode flag. */
ConfigurationClosure(boolean client) {
this.client = client;
}

/** {@inheritDoc} */
@Override public void apply(IgniteConfiguration cfg) {
cfg.setClientMode(client);
Expand Down
Loading