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.

XMLBasedAjcTestCaseForJava18Only.java 1.3KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. /* *******************************************************************
  2. * Copyright (c) 2022 Contributors
  3. * All rights reserved.
  4. * This program and the accompanying materials are made available
  5. * under the terms of the Eclipse Public License v 2.0
  6. * which accompanies this distribution and is available at
  7. * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt
  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 XMLBasedAjcTestCaseForJava18Only extends XMLBasedAjcTestCase {
  17. @Override
  18. public void setUp() throws Exception {
  19. // Activate this block after upgrading to JDT Core Java 19
  20. throw new IllegalStateException(
  21. "These tests need a Java 18 level AspectJ compiler " +
  22. "(e.g. because they use version-specific preview features). " +
  23. "This compiler does not support preview features of a previous version anymore."
  24. );
  25. // Activate this block before upgrading to JDT Core Java 19
  26. /*
  27. if (!LangUtil.is18VMOrGreater() || LangUtil.is19VMOrGreater()) {
  28. throw new IllegalStateException(
  29. "These tests should be run on Java 18 only " +
  30. "(e.g. because they use version-specific preview features)"
  31. );
  32. }
  33. super.setUp();
  34. */
  35. }
  36. }