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.

XMLBasedAjcTestCaseForJava14Only.java 983B

12345678910111213141516171819202122232425262728293031
  1. /* *******************************************************************
  2. * Copyright (c) 2021 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. package org.aspectj.testing;
  10. import org.aspectj.util.LangUtil;
  11. /**
  12. * Makes sure tests are running on the right level of JDK.
  13. *
  14. * @author Alexander Kriegisch
  15. */
  16. public abstract class XMLBasedAjcTestCaseForJava14Only extends XMLBasedAjcTestCase {
  17. @Override
  18. public void runTest(String title) {
  19. if (!LangUtil.is14VMOrGreater() || LangUtil.is15VMOrGreater()) {
  20. throw new IllegalStateException(
  21. "These tests should be run on Java 14 only " +
  22. "(e.g. because they use version-specific preview features)"
  23. );
  24. }
  25. super.runTest(title);
  26. }
  27. }