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.

Ajc182Tests.java 1.7KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. /*******************************************************************************
  2. * Copyright (c) 2014 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.ajc182;
  12. import java.io.File;
  13. import junit.framework.Test;
  14. import org.aspectj.apache.bcel.classfile.JavaClass;
  15. import org.aspectj.apache.bcel.classfile.Method;
  16. import org.aspectj.apache.bcel.classfile.annotation.RuntimeInvisTypeAnnos;
  17. import org.aspectj.testing.XMLBasedAjcTestCase;
  18. /**
  19. * @author Andy Clement
  20. */
  21. public class Ajc182Tests extends org.aspectj.testing.XMLBasedAjcTestCase {
  22. public void testInvisTypeAnnos_440983() throws ClassNotFoundException {
  23. runTest("invis type annos");
  24. JavaClass jc = getClassFrom(ajc.getSandboxDirectory(), "Code");
  25. Method m = getMethodStartsWith(jc, "xxx");
  26. RuntimeInvisTypeAnnos rita = (RuntimeInvisTypeAnnos)getAttributeStartsWith(m.getCode().getAttributes(),"RuntimeInvisibleTypeAnnotations");
  27. assertEquals("AnnotationGen:[Anno #0 {}]",rita.getTypeAnnotations()[0].getAnnotation().toString());
  28. }
  29. public void testInvisTypeAnnos_440983_2() throws ClassNotFoundException {
  30. runTest("invis type annos 2");
  31. }
  32. // ---
  33. public static Test suite() {
  34. return XMLBasedAjcTestCase.loadSuite(Ajc182Tests.class);
  35. }
  36. @Override
  37. protected File getSpecFile() {
  38. return getClassResource("tests.xml");
  39. }
  40. }