You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

XMLBasedAjcTestCaseForJava11OrLater.java 975B

12345678910111213141516171819202122232425262728293031
  1. /* *******************************************************************
  2. * Copyright (c) 2018 Contributors
  3. * All rights reserved.
  4. * This program and the accompanying materials are made available
  5. * under the terms of the Eclipse Public License v1.0
  6. * which accompanies this distribution and is available at
  7. * http://www.eclipse.org/legal/epl-v10.html
  8. *
  9. * Contributors:
  10. * Andy Clement
  11. * ******************************************************************/
  12. package org.aspectj.testing;
  13. /**
  14. * Makes sure tests are running on the right level of JDK.
  15. *
  16. * @author Andy Clement
  17. */
  18. public abstract class XMLBasedAjcTestCaseForJava11OrLater extends XMLBasedAjcTestCase {
  19. @Override
  20. public void runTest(String title) {
  21. // Check we are on Java11
  22. String property = System.getProperty("java.version");
  23. if (!property.startsWith("11")) {
  24. throw new IllegalStateException("These tests should be run on Java 11 or later");
  25. }
  26. super.runTest(title);
  27. }
  28. }