Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

TypeAnnotationsTest.java 1.2KB

1234567891011121314151617181920212223242526272829303132333435
  1. /* *******************************************************************
  2. * Copyright (c) 2004 IBM
  3. * All rights reserved.
  4. * This program and the accompanying materials are made available
  5. * under the terms of the Eclipse Public License v1.0
  6. * which accompanies this distribution and is available at
  7. * http://www.eclipse.org/legal/epl-v10.html
  8. *
  9. * Contributors:
  10. * Andy Clement - initial implementation
  11. * ******************************************************************/
  12. package org.aspectj.apache.bcel.classfile.tests;
  13. import org.aspectj.apache.bcel.classfile.JavaClass;
  14. import org.aspectj.apache.bcel.generic.ClassGen;
  15. import org.aspectj.apache.bcel.generic.annotation.AnnotationGen;
  16. public class TypeAnnotationsTest extends BcelTestCase {
  17. protected void setUp() throws Exception {
  18. super.setUp();
  19. }
  20. public void testMarkerAnnotationsOnTypes() throws ClassNotFoundException {
  21. JavaClass clazz = getClassFromJar("MarkedType");
  22. ClassGen cg = new ClassGen(clazz);
  23. AnnotationGen[] annotations = cg.getAnnotations();
  24. assertTrue("Should be a MarkerAnnotation and a MarkerAnnotationInvisible - but found: "+annotations.length,annotations.length==2);
  25. }
  26. }