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 6.9KB

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