]> source.dussan.org Git - aspectj.git/commitdiff
Add intermediate test class that ensures the tests are on J9
authorAndy Clement <aclement@pivotal.io>
Wed, 14 Feb 2018 20:40:22 +0000 (12:40 -0800)
committerAndy Clement <aclement@pivotal.io>
Wed, 14 Feb 2018 20:40:22 +0000 (12:40 -0800)
testing/newsrc/org/aspectj/testing/XMLBasedAjcTestCaseForJava9OrLater.java [new file with mode: 0644]

diff --git a/testing/newsrc/org/aspectj/testing/XMLBasedAjcTestCaseForJava9OrLater.java b/testing/newsrc/org/aspectj/testing/XMLBasedAjcTestCaseForJava9OrLater.java
new file mode 100644 (file)
index 0000000..826cf55
--- /dev/null
@@ -0,0 +1,31 @@
+/* *******************************************************************
+ * Copyright (c) 2018 Contributors
+ * All rights reserved. 
+ * This program and the accompanying materials are made available 
+ * under the terms of the Eclipse Public License v1.0 
+ * which accompanies this distribution and is available at 
+ * http://www.eclipse.org/legal/epl-v10.html 
+ *  
+ * Contributors: 
+ *     Andy Clement
+ * ******************************************************************/
+package org.aspectj.testing;
+
+/**
+ * Makes sure tests are running on the right level of JDK.
+ * 
+ * @author Andy Clement
+ */
+public abstract class XMLBasedAjcTestCaseForJava9OrLater extends XMLBasedAjcTestCase {
+
+       @Override
+       public void runTest(String title) {
+               // Check we are on Java9
+               String property = System.getProperty("java.version");
+               if (!property.startsWith("9")) {
+                       throw new IllegalStateException("These tests should be run on Java 9 or later");
+               }
+               super.runTest(title);
+       }
+       
+}