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.

Ajc11Tests.java 11KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483
  1. /* *******************************************************************
  2. * Copyright (c) 2004 IBM Corporation
  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. * ******************************************************************/
  10. package org.aspectj.systemtest.ajc11;
  11. import org.aspectj.testing.XMLBasedAjcTestCase;
  12. import org.aspectj.util.LangUtil;
  13. import junit.framework.Test;
  14. public class Ajc11Tests extends org.aspectj.testing.XMLBasedAjcTestCase {
  15. public static Test suite() {
  16. return XMLBasedAjcTestCase.loadSuite(Ajc11Tests.class);
  17. }
  18. protected java.net.URL getSpecFile() {
  19. return getClassResource("ajc11.xml");
  20. }
  21. public void test001() {
  22. runTest("declare interface extends class");
  23. }
  24. public void test002() {
  25. runTest("declare interface implements class");
  26. }
  27. public void test003() {
  28. runTest("declaring a private method on an inner interface");
  29. }
  30. public void test004() {
  31. runTest("CE expected when declaring fields on arrays");
  32. }
  33. public void test005() {
  34. runTest("signature of handler join point");
  35. }
  36. public void test006() {
  37. runTest("source locations within expressions");
  38. }
  39. public void test007() {
  40. runTest("crashes given method in declared method");
  41. }
  42. public void test008() {
  43. runTest("after returning advice on interface constructor");
  44. }
  45. public void test009() {
  46. runTest("after returning advice on interface constructor - error");
  47. }
  48. public void test010() {
  49. runTest("after advice on static call join point");
  50. }
  51. public void test011() {
  52. runTest("incompatible class change error");
  53. }
  54. public void test012() {
  55. runTest("simple cflow of method execution");
  56. }
  57. public void test013() {
  58. runTest("using instance as class reference to constant field");
  59. }
  60. public void test014() {
  61. runTest("interface self-reference in anonymous instance");
  62. }
  63. public void test015() {
  64. runTest("self-reference from (aspect-declared) method-local class");
  65. }
  66. public void test016() {
  67. runTest("expect CE for unterminated declare error");
  68. }
  69. public void test017() {
  70. runTest("expect CE for declaration collision between subaspects instead of domination order");
  71. }
  72. public void test018() {
  73. runTest("subtype pattern in dominates should pick out aspect subtypes");
  74. }
  75. public void test019() {
  76. runTest("subtype pattern in dominates will conflict with type pattern");
  77. }
  78. public void test020() {
  79. runTest("after returning advice on interface and implementation constructor");
  80. }
  81. public void test021() {
  82. runTest("after throwing advice with non-throwable formal");
  83. }
  84. public void test022() {
  85. runTest("declare array field using postfix");
  86. }
  87. public void test023() {
  88. runTest("prohibit declaring new aspect constructor with arguments");
  89. }
  90. public void test024() {
  91. runTest("prohibit declaring only aspect constructor with arguments");
  92. }
  93. public void test025() {
  94. runTest("declare class extends interface");
  95. }
  96. public void test026() {
  97. runTest("declare class implements class");
  98. }
  99. public void test027() {
  100. runTest("declare interface implements interface");
  101. }
  102. public void test028() {
  103. runTest("if and cflow arg binding");
  104. }
  105. public void test029() {
  106. runTest("circularity in declare dominates");
  107. }
  108. public void test030() {
  109. runTest("percflow code hangs compiler");
  110. }
  111. public void test031() {
  112. runTest("Verification error tracing constructor that takes arguments");
  113. }
  114. public void test032() {
  115. runTest("declared exceptions in inter-type decls");
  116. }
  117. public void test033() {
  118. runTest("Verify error on non-Throwable in declare soft");
  119. }
  120. public void test034() {
  121. runTest("inter-type fields with array types");
  122. }
  123. public void test035() {
  124. runTest("checking around join point for advice return type - numeric");
  125. }
  126. public void test036() {
  127. runTest("void around advice without proceed");
  128. }
  129. public void test037() {
  130. runTest("declaring method on superclass and subclass");
  131. }
  132. public void test038() {
  133. runTest("introducing final fields (simple)");
  134. }
  135. public void test039() {
  136. runTest("introducing final fields and using as constants");
  137. }
  138. public void test040() {
  139. runTest("introducing final fields and checking errors");
  140. }
  141. public void test041() {
  142. runTest("Static inner aspects cannot reference user defined pointcuts");
  143. }
  144. public void test042() {
  145. runTest("Static inner aspects cannot reference user defined pointcuts");
  146. }
  147. public void test043() {
  148. runTest("Declare precedence should not allow multiple * patterns");
  149. }
  150. public void test044() {
  151. runTest("VerifyError on accessing objects not accessible to the weaver");
  152. }
  153. public void test045() {
  154. runTest("aspect static initializers should run before instance constructed");
  155. }
  156. public void test046() {
  157. runTest("super call in intertype method declaration body causes VerifyError");
  158. }
  159. public void test047() {
  160. runTest("Error with certain combination of advice");
  161. }
  162. public void test048() {
  163. runTest("Pointcut adviceexecution() does not work");
  164. }
  165. public void test049() {
  166. runTest("problems with finalize call");
  167. }
  168. public void test050() {
  169. runTest("Negation of if pointcut does not work");
  170. }
  171. public void test051() {
  172. runTest("ajc reports error when encountering static declaration of nested classes");
  173. }
  174. public void test052() {
  175. runTest("can't use pointcuts defined in inner aspects ");
  176. }
  177. public void test053() {
  178. runTest("can't resolve nested public interfaces (also PR#32399)");
  179. }
  180. public void test054() {
  181. runTest("thisJoinPoint.getArgs() causes IncompatibleClassChangeError");
  182. }
  183. public void test055() {
  184. runTest("inter-type declaration of void field");
  185. }
  186. public void test056() {
  187. runTest("no such constructor for proceed argument (error)");
  188. }
  189. public void test057() {
  190. runTest("omnibus declare warning context with no initializer/constructor");
  191. }
  192. public void test058() {
  193. runTest("omnibus declare warning context");
  194. }
  195. public void test059() {
  196. runTest("cflow binding issues with ignoring state");
  197. }
  198. public void test060() {
  199. runTest("cflow binding -- original weaver crash");
  200. }
  201. public void test061() {
  202. runTest("type not imported in around advice");
  203. }
  204. public void test062() {
  205. runTest("type not imported in aspect");
  206. }
  207. public void test063() {
  208. runTest("class extending abstract aspect");
  209. }
  210. public void test064() {
  211. runTest("declare soft and throw statements");
  212. }
  213. public void test065() {
  214. runTest("inter-type declaration bug with abstract classes");
  215. }
  216. public void test066() {
  217. runTest("Inter type declaration to base class not seen by derived class");
  218. }
  219. public void test067() {
  220. runTest("Declare parents with intermediate ancestor");
  221. }
  222. public void test068() {
  223. runTest("Declare parents removing ancestor");
  224. }
  225. public void test069() {
  226. runTest("IllegalAccessError while accessing introduced variable / 1.1rc1");
  227. }
  228. public void test070() {
  229. runTest("implemented abstract pointcut");
  230. }
  231. public void test071() {
  232. runTest("privileged aspect main verify error");
  233. }
  234. public void test072() {
  235. runTest("Internal compiler error with thisJoinPoint.getStaticPart()");
  236. }
  237. public void test073() {
  238. runTest("Inconsistant stack height with around");
  239. }
  240. public void test074() {
  241. runTest("Ajc 1.1 rc1 java.lang.VerifyError with messy arounds");
  242. }
  243. public void test075() {
  244. runTest("try/finally in around advice (same as ...messy arounds?)");
  245. }
  246. public void test076() {
  247. runTest("advise join points in subclass of empty interface");
  248. }
  249. public void test077() {
  250. runTest("can't put around advice on interface static initializer");
  251. }
  252. public void test078() {
  253. runTest("cflow concretization causing assertion failure");
  254. }
  255. public void test079() {
  256. runTest("lame error message: negation doesn't allow binding");
  257. }
  258. public void test080() {
  259. runTest("Error when introducing members of type Class");
  260. }
  261. // public void test081(){
  262. // runTest("arrays via Class.forName()");
  263. // }
  264. public void test082() {
  265. runTest("perthis and inline arounds");
  266. }
  267. public void test083() {
  268. runTest("Weaver fails with NPE for very large source files ");
  269. }
  270. public void test084() {
  271. runTest("CLE: no sources");
  272. }
  273. public void test085() {
  274. runTest("CLE: bad filename");
  275. }
  276. public void test086() {
  277. runTest("CLE: no dir specified for sourceroots");
  278. }
  279. public void test087() {
  280. runTest("CLE: no sourceroot specified for incremental");
  281. }
  282. public void test088() {
  283. runTest("CLE: file specified with incremental");
  284. }
  285. public void test089() {
  286. runTest("public static fields being ignored");
  287. }
  288. public void test090() {
  289. runTest("can not resolve this member warning");
  290. }
  291. public void test091() {
  292. runTest("try switch VerifyError, InconsistentStackHeight");
  293. }
  294. public void test092() {
  295. if (LangUtil.is17VMOrGreater()) {
  296. runTest("Compiler crash in ajc 1.1 - terrible error for inaccessible constructor - 1.7");
  297. } else {
  298. runTest("Compiler crash in ajc 1.1 - terrible error for inaccessible constructor");
  299. }
  300. }
  301. public void test093() {
  302. runTest("Missing import crashes compiler");
  303. }
  304. public void test094() {
  305. runTest("NPE in bcel.LazyMethodGen when delegating from one ctor to a second that includes a switch");
  306. }
  307. public void test095() {
  308. runTest("switch statement in aspects crashes weaving");
  309. }
  310. public void test096() {
  311. runTest("ajc stack trace on declaring hashcode() method in aspect");
  312. }
  313. public void test097() {
  314. runTest("using super in method introduced on interface with multiple supertypes");
  315. }
  316. public void test098() {
  317. runTest("Compiler crashes in jar and cflow (with no .jar)");
  318. }
  319. public void test099() {
  320. runTest("Compiler crashes in jar and cflow (with .jar)");
  321. }
  322. public void test100() {
  323. runTest("Default method impl for interface causes internal exception.");
  324. }
  325. public void test102() {
  326. runTest("compile error expected for abstract pointcut outside abstract aspect");
  327. }
  328. public void test103() {
  329. runTest("subtype-qualified pointcut reference");
  330. }
  331. public void test104() {
  332. runTest("weaver trace on mis-qualified pointcut reference");
  333. }
  334. public void test105() {
  335. runTest("compile error expected for interface pointcuts");
  336. }
  337. public void test106() {
  338. runTest("interface call signatures when declaring method in aspect");
  339. }
  340. public void test107() {
  341. runTest("reflective check of declared exceptions from aspect-declared methods");
  342. }
  343. public void test108() {
  344. runTest("throw derivative pointcuts not advised");
  345. }
  346. public void test109() {
  347. runTest("perthis and signature bad interaction");
  348. }
  349. public void test110() {
  350. runTest("declare error fails on pointcuts composed from multiple classes");
  351. }
  352. public void test111() {
  353. runTest("declare error fails on pointcuts composed from multiple classes");
  354. }
  355. public void test112() {
  356. runTest("Interaction between pointcut binding and declare parents");
  357. }
  358. public void test113() {
  359. runTest("Non-functional concretezation of ReferencePointcut");
  360. }
  361. public void test114() {
  362. runTest("zip and jar suffixes for extdirs entries");
  363. }
  364. }