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.

AptTests.java 1.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. /*******************************************************************************
  2. * Copyright (c) 2014,2018 Contributors
  3. * All rights reserved. This program and the accompanying materials
  4. * are made available under the terms of the Eclipse Public License v1.0
  5. * which accompanies this distribution, and is available at
  6. * http://www.eclipse.org/legal/epl-v10.html
  7. *
  8. * Contributors:
  9. * Andy Clement - initial API and implementation
  10. *******************************************************************************/
  11. package org.aspectj.systemtest.apt;
  12. import org.aspectj.testing.XMLBasedAjcTestCase;
  13. import org.aspectj.util.LangUtil;
  14. import junit.framework.Test;
  15. /**
  16. * Annotation processing tool tests.
  17. *
  18. * @author Sergey Stupin.
  19. */
  20. public class AptTests extends XMLBasedAjcTestCase {
  21. public void testAptWithSpecifiedProcessor() {
  22. if (LangUtil.is9VMOrGreater()) {
  23. return;
  24. }
  25. runTest("annotation processing with specified processor");
  26. }
  27. /**
  28. * SPI - http://docs.oracle.com/javase/tutorial/sound/SPI-intro.html
  29. */
  30. public void testAptUsingSPI() {
  31. if (LangUtil.is9VMOrGreater()) {
  32. return;
  33. }
  34. runTest("annotation processing in action using SPI");
  35. }
  36. public void testDisabledApt() {
  37. if (LangUtil.is11VMOrGreater()) {
  38. // javax.annotation.Generated not in Java11
  39. return;
  40. }
  41. runTest("disabled annotation processing");
  42. }
  43. public void testAptWithJavaFilesAsAspects() {
  44. runTest("annotation processing generating java files with aspects");
  45. }
  46. public static Test suite() {
  47. return XMLBasedAjcTestCase.loadSuite(AptTests.class);
  48. }
  49. @Override
  50. protected java.net.URL getSpecFile() {
  51. return getClassResource("apt-spec.xml");
  52. }
  53. }