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.6KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  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 java.io.File;
  13. import org.aspectj.testing.XMLBasedAjcTestCase;
  14. import org.aspectj.util.LangUtil;
  15. import junit.framework.Test;
  16. /**
  17. * Annotation processing tool tests.
  18. *
  19. * @author Sergey Stupin.
  20. */
  21. public class AptTests extends XMLBasedAjcTestCase {
  22. public void testAptWithSpecifiedProcessor() {
  23. if (LangUtil.is19VMOrGreater()) {
  24. return;
  25. }
  26. runTest("annotation processing with specified processor");
  27. }
  28. /**
  29. * SPI - http://docs.oracle.com/javase/tutorial/sound/SPI-intro.html
  30. */
  31. public void testAptUsingSPI() {
  32. if (LangUtil.is19VMOrGreater()) {
  33. return;
  34. }
  35. runTest("annotation processing in action using SPI");
  36. }
  37. public void testDisabledApt() {
  38. runTest("disabled annotation processing");
  39. }
  40. public void testAptWithJavaFilesAsAspects() {
  41. runTest("annotation processing generating java files with aspects");
  42. }
  43. public static Test suite() {
  44. return XMLBasedAjcTestCase.loadSuite(AptTests.class);
  45. }
  46. @Override
  47. protected File getSpecFile() {
  48. return getClassResource("apt-spec.xml");
  49. }
  50. }