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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  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 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.ajc150;
  12. import org.aspectj.testing.XMLBasedAjcTestCase;
  13. import junit.framework.Test;
  14. /**
  15. * Annotations, the rules/tests:
  16. *
  17. * 1. cannot make ITD (C,M or F) on an annotation
  18. * 2. cannot use declare parents to change the super type of an annotation
  19. * 3. cannot use decp to make an annotation type implement an interface
  20. * 4. cannot use decp to dec java.lang.annotation.Annotation as the parent of any type
  21. * 5. cannot extend set of values in an annotation via an ITD like construct
  22. * 6. Compilation error if you explicitly identify an Annotation type.
  23. * 7. Lint warning if a non-explicit type pattern would match an annotation type.
  24. */
  25. public class AnnotationsBinaryWeaving extends XMLBasedAjcTestCase {
  26. public static Test suite() {
  27. return XMLBasedAjcTestCase.loadSuite(AnnotationsBinaryWeaving.class);
  28. }
  29. protected java.net.URL getSpecFile() {
  30. return getClassResource("ajc150.xml");
  31. }
  32. // Cannot make ITD (c/m/f) on an annotation
  33. public void test001_itdsOnAnnotationsNotAllowed() {
  34. runTest("no itds on annotation types");
  35. }
  36. // Deals with the cases where an explicit type is specified and it is an annotation type
  37. public void test002_decpOnAnnotationNotAllowed_errors() {
  38. runTest("no declare parents on annotation types");
  39. }
  40. //Deals with the cases where an wild type pattern is specified and it hits an annotation type
  41. public void test004_decpOnAnnotationNotAllowed_xlints() {
  42. runTest("declare parents wildcards matching annotation types");
  43. }
  44. }