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

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