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.

Ajc1612Tests.java 7.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289
  1. /*******************************************************************************
  2. * Copyright (c) 2008 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.ajc1612;
  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.testing.XMLBasedAjcTestCase;
  17. /**
  18. * @author Andy Clement
  19. */
  20. public class Ajc1612Tests extends org.aspectj.testing.XMLBasedAjcTestCase {
  21. // public void testAnnoCopying_345515() {
  22. // runTest("anno copying");
  23. // }
  24. // public void testDoubleITDF() throws Exception {
  25. // runTest("double itdf");
  26. // }
  27. // public void testItdSplitCompilation_354683() throws Exception {
  28. // runTest("itd split compilation");
  29. // }
  30. public void testAnnotationFieldBindingOptimization_356612() throws Exception {
  31. runTest("annotation field binding optimization");
  32. }
  33. public void testAnnotationFieldBindingOptimization_356612_2() throws Exception {
  34. runTest("annotation field binding optimization - 2");
  35. }
  36. public void testThisAspectInstance_239649_1() throws Exception {
  37. // simple case
  38. runTest("thisAspectInstance - 1");
  39. }
  40. public void testThisAspectInstance_239649_2() throws Exception {
  41. // before advice toggling on/off through if called method
  42. runTest("thisAspectInstance - 2");
  43. }
  44. public void testThisAspectInstance_239649_3() throws Exception {
  45. // after advice toggling on/off through if called method
  46. runTest("thisAspectInstance - 3");
  47. }
  48. public void testThisAspectInstance_239649_4() throws Exception {
  49. // before advice, also using thisJoinPointStaticPart
  50. runTest("thisAspectInstance - 4");
  51. }
  52. public void testThisAspectInstance_239649_5() throws Exception {
  53. // before advice, also using thisJoinPoint
  54. runTest("thisAspectInstance - 5");
  55. }
  56. public void testThisAspectInstance_239649_6() throws Exception {
  57. // before advice, also using thisEnclosingJoinPointStaticPart
  58. runTest("thisAspectInstance - 6");
  59. }
  60. public void testThisAspectInstance_239649_7() throws Exception {
  61. // before advice, also using thisJoinPoint and thisJoinPointStaticPart
  62. runTest("thisAspectInstance - 7");
  63. }
  64. public void testThisAspectInstance_239649_8() throws Exception {
  65. // before advice, also using abstract aspects
  66. runTest("thisAspectInstance - 8");
  67. }
  68. public void testThisAspectInstance_239649_9() throws Exception {
  69. // before advice, also using abstract aspects 2
  70. runTest("thisAspectInstance - 9");
  71. }
  72. public void testThisAspectInstance_239649_10() throws Exception {
  73. // aspects in a package
  74. runTest("thisAspectInstance - 10");
  75. }
  76. public void testThisAspectInstance_239649_11() throws Exception {
  77. // non-singleton aspect - should be an error for now
  78. runTest("thisAspectInstance - 11");
  79. }
  80. public void testThisAspectInstance_239649_12() throws Exception {
  81. // arg binding and tjpsp
  82. runTest("thisAspectInstance - 12");
  83. }
  84. public void testThisAspectInstance_239649_13() throws Exception {
  85. // pass instance
  86. runTest("thisAspectInstance - 13");
  87. }
  88. public void testThisAspectInstance_239649_14() throws Exception {
  89. // multiple ifs
  90. runTest("thisAspectInstance - 14");
  91. }
  92. public void testThisAspectInstance_239649_15() throws Exception {
  93. // abstract aspects
  94. runTest("thisAspectInstance - 15");
  95. }
  96. // public void testVerifyPerthis() throws Exception {
  97. // runTest("verify perthis");
  98. // }
  99. public void testRangeForLocalVariables_353936() throws ClassNotFoundException {
  100. runTest("local variable tables");
  101. JavaClass jc = getClassFrom(ajc.getSandboxDirectory(), "X");
  102. Method[] meths = jc.getMethods();
  103. boolean checked = false;
  104. for (int i = 0; i < meths.length; i++) {
  105. Method method = meths[i];
  106. if (method.getName().equals("ajc$before$X$2$3444dde4")) {
  107. System.out.println(method.getName());
  108. System.out.println(stringify(method.getLocalVariableTable()));
  109. System.out.println(method.getCode().getLength());
  110. checked = true;
  111. assertEquals("LX; this(0) start=0 len=48", stringify(method.getLocalVariableTable(), 0));
  112. assertEquals("Lorg/aspectj/lang/JoinPoint; thisJoinPoint(1) start=0 len=48",
  113. stringify(method.getLocalVariableTable(), 1));
  114. assertEquals("I i(2) start=8 len=22", stringify(method.getLocalVariableTable(), 2));
  115. }
  116. }
  117. assertTrue(checked);
  118. }
  119. public void testEmptyPattern_pr352363() {
  120. runTest("empty pattern");
  121. }
  122. public void testGenericsIssue_pr351592() {
  123. runTest("generics issue");
  124. }
  125. public void testGenericsIssue_pr351592_2() {
  126. runTest("generics issue - 2");
  127. }
  128. public void testGenericsNpe_pr350800() {
  129. runTest("generics npe");
  130. }
  131. public void testGenericsNpe_pr350800_code() {
  132. runTest("generics npe - code");
  133. }
  134. public void testGenericsNpe_pr350800_3() {
  135. runTest("generics npe - 3");
  136. }
  137. public void testOrdering_pr349961() {
  138. runTest("ordering");
  139. }
  140. public void testOrdering_pr349961_2() {
  141. runTest("ordering - 2");
  142. }
  143. /*
  144. * public void testVerifyError_pr347395() { runTest("verifyerror - inline"); }
  145. */
  146. public void testDuplicateMethods_349398() {
  147. runTest("duplicate methods");
  148. }
  149. public void testBindingInts_347684() {
  150. runTest("binding ints");
  151. }
  152. public void testBindingInts_347684_2() {
  153. runTest("binding ints - 2");
  154. }
  155. public void testBindingInts_347684_3() {
  156. runTest("binding ints - 3");
  157. }
  158. public void testBindingInts_347684_4() {
  159. runTest("binding ints - 4");
  160. }
  161. public void testBindingInts_347684_5() {
  162. runTest("binding ints - 5");
  163. }
  164. public void testBindingInts_347684_6() {
  165. runTest("binding ints - 6");
  166. }
  167. public void testIncorrectAnnos_345172() {
  168. runTest("incorrect annos");
  169. }
  170. public void testIncorrectAnnos_345172_2() {
  171. runTest("incorrect annos 2");
  172. }
  173. public void testIncorrectAnnos_345172_3() {
  174. runTest("incorrect annos 3");
  175. }
  176. public void testSyntheticMethods_327867() {
  177. runTest("synthetic methods");
  178. }
  179. // public void testSignedJarLtw_328099() {
  180. // runTest("signed jar ltw");
  181. // }
  182. public void testVerifyError_315398() {
  183. runTest("verifyerror");
  184. }
  185. public void testVerifyError_315398_2() {
  186. runTest("verifyerror - 2");
  187. }
  188. public void testRawTypePointcut_327134() {
  189. runTest("rawtype pointcut");
  190. }
  191. public void testRawTypeWarning_335810() {
  192. runTest("rawtype warning");
  193. }
  194. // public void testDecpGenerics_344005() {
  195. // runTest("decp generics");
  196. // }
  197. public void testIllegalAccessError_343051() {
  198. runTest("illegalaccesserror");
  199. }
  200. public void testItitNpe_339974() {
  201. runTest("itit npe");
  202. }
  203. // public void testNoImportError_342605() {
  204. // runTest("noimporterror");
  205. // }
  206. public void testClashingLocalTypes_342323() {
  207. runTest("clashing local types");
  208. }
  209. public void testITIT_338175() {
  210. runTest("itit");
  211. }
  212. public void testThrowsClause_292239() {
  213. runTest("throws clause");
  214. }
  215. public void testThrowsClause_292239_2() {
  216. runTest("throws clause - 2");
  217. }
  218. // ---
  219. public static Test suite() {
  220. return XMLBasedAjcTestCase.loadSuite(Ajc1612Tests.class);
  221. }
  222. @Override
  223. protected File getSpecFile() {
  224. return new File("../tests/src/org/aspectj/systemtest/ajc1612/ajc1612.xml");
  225. }
  226. }