-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Backport JAVA_23 and JAVA_24 JRE constants
Resolves #3918.
- Loading branch information
1 parent
1cf2e6f
commit 7b2f7c6
Showing
10 changed files
with
366 additions
and
183 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
104 changes: 104 additions & 0 deletions
104
...iter-api/src/testFixtures/java/org/junit/jupiter/api/condition/JavaVersionPredicates.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,104 @@ | ||
/* | ||
* Copyright 2015-2024 the original author or authors. | ||
* | ||
* All rights reserved. This program and the accompanying materials are | ||
* made available under the terms of the Eclipse Public License v2.0 which | ||
* accompanies this distribution and is available at | ||
* | ||
* https://www.eclipse.org/legal/epl-v20.html | ||
*/ | ||
|
||
package org.junit.jupiter.api.condition; | ||
|
||
public class JavaVersionPredicates { | ||
|
||
private static final String JAVA_VERSION = System.getProperty("java.version"); | ||
|
||
static boolean onJava8() { | ||
return JAVA_VERSION.startsWith("1.8"); | ||
} | ||
|
||
static boolean onJava9() { | ||
return JAVA_VERSION.startsWith("9"); | ||
} | ||
|
||
static boolean onJava10() { | ||
return JAVA_VERSION.startsWith("10"); | ||
} | ||
|
||
static boolean onJava11() { | ||
return JAVA_VERSION.startsWith("11"); | ||
} | ||
|
||
static boolean onJava12() { | ||
return JAVA_VERSION.startsWith("12"); | ||
} | ||
|
||
static boolean onJava13() { | ||
return JAVA_VERSION.startsWith("13"); | ||
} | ||
|
||
static boolean onJava14() { | ||
return JAVA_VERSION.startsWith("14"); | ||
} | ||
|
||
static boolean onJava15() { | ||
return JAVA_VERSION.startsWith("15"); | ||
} | ||
|
||
static boolean onJava16() { | ||
return JAVA_VERSION.startsWith("16"); | ||
} | ||
|
||
static boolean onJava17() { | ||
return JAVA_VERSION.startsWith("17"); | ||
} | ||
|
||
static boolean onJava18() { | ||
return JAVA_VERSION.startsWith("18"); | ||
} | ||
|
||
static boolean onJava19() { | ||
return JAVA_VERSION.startsWith("19"); | ||
} | ||
|
||
static boolean onJava20() { | ||
return JAVA_VERSION.startsWith("20"); | ||
} | ||
|
||
static boolean onJava21() { | ||
return JAVA_VERSION.startsWith("21"); | ||
} | ||
|
||
static boolean onJava22() { | ||
return JAVA_VERSION.startsWith("22"); | ||
} | ||
|
||
static boolean onJava23() { | ||
return JAVA_VERSION.startsWith("23"); | ||
} | ||
|
||
static boolean onJava24() { | ||
return JAVA_VERSION.startsWith("24"); | ||
} | ||
|
||
static boolean onKnownVersion() { | ||
return onJava8() // | ||
|| onJava9() // | ||
|| onJava10() // | ||
|| onJava11() // | ||
|| onJava12() // | ||
|| onJava13() // | ||
|| onJava14() // | ||
|| onJava15() // | ||
|| onJava16() // | ||
|| onJava17() // | ||
|| onJava18() // | ||
|| onJava19() // | ||
|| onJava20() // | ||
|| onJava21() // | ||
|| onJava22() // | ||
|| onJava23() // | ||
|| onJava24(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.