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.

AnnotationsBinaryWeaving.java 2.1KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. /*******************************************************************************
  2. * Copyright (c) 2004 IBM
  3. * All rights reserved. This program and the accompanying materials
  4. * are made available under the terms of the Common Public License v1.0
  5. * which accompanies this distribution, and is available at
  6. * http://www.eclipse.org/legal/cpl-v10.html
  7. *
  8. * Contributors:
  9. * Andy Clement - initial API and implementation
  10. *******************************************************************************/
  11. package org.aspectj.systemtest.ajc150;
  12. import java.io.File;
  13. import junit.framework.Test;
  14. import org.aspectj.testing.XMLBasedAjcTestCase;
  15. /**
  16. * Annotations, the rules/tests:
  17. *
  18. * 1. cannot make ITD (C,M or F) on an annotation
  19. * 2. cannot use declare parents to change the super type of an annotation
  20. * 3. cannot use decp to make an annotation type implement an interface
  21. * 4. cannot use decp to dec java.lang.annotation.Annotation as the parent of any type
  22. * 5. cannot extend set of values in an annotation via an ITD like construct
  23. * 6. Compilation error if you explicitly identify an Annotation type.
  24. * 7. Lint warning if a non-explicit type pattern would match an annotation type.
  25. */
  26. public class AnnotationsBinaryWeaving extends XMLBasedAjcTestCase {
  27. public static Test suite() {
  28. return XMLBasedAjcTestCase.loadSuite(AnnotationsBinaryWeaving.class);
  29. }
  30. protected File getSpecFile() {
  31. return new File("../tests/src/org/aspectj/systemtest/ajc150/ajc150.xml");
  32. }
  33. // Cannot make ITD (c/m/f) on an annotation
  34. public void test001_itdsOnAnnotationsNotAllowed() {
  35. runTest("no itds on annotation types");
  36. }
  37. // Deals with the cases where an explicit type is specified and it is an annotation type
  38. public void test002_decpOnAnnotationNotAllowed_errors() {
  39. runTest("no declare parents on annotation types");
  40. }
  41. //Deals with the cases where an wild type pattern is specified and it hits an annotation type
  42. public void test004_decpOnAnnotationNotAllowed_xlints() {
  43. runTest("declare parents wildcards matching annotation types");
  44. }
  45. }