[java-support] branch master updated: JPAR-104 - allow tests to check for Java 11 or later
Ian Young
ian at iay.org.uk
Mon Jan 28 10:48:54 EST 2019
This is an automated email from the git hooks/post-receive script.
iay pushed a commit to branch master
in repository java-support.
View the commit online:
http://git.shibboleth.net/view/?p=java-support.git;a=commit;h=2d442d53c890eb969be99e23ade999bdab35565a
The following commit(s) were added to refs/heads/master by this push:
new 2d442d5 JPAR-104 - allow tests to check for Java 11 or later
2d442d5 is described below
commit 2d442d53c890eb969be99e23ade999bdab35565a
Author: Ian Young <ian at iay.org.uk>
AuthorDate: Mon Jan 28 15:48:48 2019 +0000
JPAR-104 - allow tests to check for Java 11 or later
---
.../utilities/java/support/testing/TestSupport.java | 14 ++++++++++++--
.../utilities/java/support/testing/TestSupportTest.java | 7 +++++++
2 files changed, 19 insertions(+), 2 deletions(-)
diff --git a/src/test/java/net/shibboleth/utilities/java/support/testing/TestSupport.java b/src/test/java/net/shibboleth/utilities/java/support/testing/TestSupport.java
index 5e82788..0088991 100644
--- a/src/test/java/net/shibboleth/utilities/java/support/testing/TestSupport.java
+++ b/src/test/java/net/shibboleth/utilities/java/support/testing/TestSupport.java
@@ -129,13 +129,23 @@ public class TestSupport {
}
/**
- * Indicates whether the tests are running under Java 8 or a later
+ * Indicates whether the tests are running under Java 9 or a later
* version.
*
- * @return <code>true</code> if the runtime environment is Java 8 or later
+ * @return <code>true</code> if the runtime environment is Java 9 or later
*/
public static boolean isJavaV9OrLater() {
return getJavaVersion(System.getProperty("java.version")) >= 9;
}
+ /**
+ * Indicates whether the tests are running under Java 11 or a later
+ * version.
+ *
+ * @return <code>true</code> if the runtime environment is Java 11 or later
+ */
+ public static boolean isJavaV11OrLater() {
+ return getJavaVersion(System.getProperty("java.version")) >= 11;
+ }
+
}
diff --git a/src/test/java/net/shibboleth/utilities/java/support/testing/TestSupportTest.java b/src/test/java/net/shibboleth/utilities/java/support/testing/TestSupportTest.java
index cc987f1..1e60286 100644
--- a/src/test/java/net/shibboleth/utilities/java/support/testing/TestSupportTest.java
+++ b/src/test/java/net/shibboleth/utilities/java/support/testing/TestSupportTest.java
@@ -25,6 +25,12 @@ public class TestSupportTest {
}
@Test
+ public void isJavaV11OrLater() {
+ // answer for current runtime can be true or false, just not an exception
+ TestSupport.isJavaV11OrLater();
+ }
+
+ @Test
public void getJavaVersion() {
// test against some real versions
Assert.assertEquals(TestSupport.getJavaVersion("1.6.0_65-b14-468"), 6);
@@ -33,6 +39,7 @@ public class TestSupportTest {
Assert.assertEquals(TestSupport.getJavaVersion("9"), 9);
Assert.assertEquals(TestSupport.getJavaVersion("9.0.1"), 9);
Assert.assertEquals(TestSupport.getJavaVersion("10+43"), 10); // Java 10 RC
+ Assert.assertEquals(TestSupport.getJavaVersion("11.0.2"), 11);
}
}
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the commits
mailing list