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.

Ajc150Tests.java 30KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034
  1. /*******************************************************************************
  2. * Copyright (c) 2004 IBM
  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.ajc150;
  12. import java.io.ByteArrayOutputStream;
  13. import java.io.IOException;
  14. import java.io.PrintWriter;
  15. import org.aspectj.apache.bcel.classfile.JavaClass;
  16. import org.aspectj.apache.bcel.classfile.Method;
  17. import org.aspectj.apache.bcel.classfile.Signature;
  18. import org.aspectj.asm.AsmManager;
  19. import org.aspectj.testing.XMLBasedAjcTestCase;
  20. import org.aspectj.util.LangUtil;
  21. import junit.framework.Test;
  22. public class Ajc150Tests extends org.aspectj.testing.XMLBasedAjcTestCase {
  23. public static Test suite() {
  24. return XMLBasedAjcTestCase.loadSuite(Ajc150Tests.class);
  25. }
  26. protected java.net.URL getSpecFile() {
  27. return getClassResource("ajc150.xml");
  28. }
  29. public void testMixingCodeStyles_pr121385() {
  30. runTest("mixing aspect styles");
  31. }
  32. public void testTypeVars_pr121575() {
  33. runTest("different numbers of type vars");
  34. }
  35. public void testTypeVars_pr121575_2() {
  36. runTest("different numbers of type vars - 2");
  37. }
  38. public void testTypeVars_pr121575_3() {
  39. runTest("different numbers of type vars - 3");
  40. }
  41. public void testTypeVars_pr121575_4() {
  42. runTest("different numbers of type vars - 4");
  43. }
  44. public void testDecps1() {
  45. runTest("decps - 1");
  46. }
  47. public void testDecps1b() {
  48. runTest("decps - 1b");
  49. }
  50. public void testDecps2() {
  51. runTest("decps - 2");
  52. }
  53. public void testDecps2b() {
  54. runTest("decps - 2b");
  55. }
  56. public void testDecps3() {
  57. runTest("decps - 3");
  58. }
  59. public void testDecps3b() {
  60. runTest("decps - 3b");
  61. }
  62. public void testDecps3c() {
  63. runTest("decps - 3c");
  64. }
  65. public void testVarargsNPE_pr120826() {
  66. runTest("varargs NPE");
  67. }
  68. public void testNamedPointcutPertarget_pr120521() {
  69. runTest("named pointcut not resolved in pertarget pointcut");
  70. }
  71. public void testDollarClasses_pr120474() {
  72. runTest("Dollar classes");
  73. }
  74. public void testGenericPTW_pr119539_1() {
  75. runTest("generic pertypewithin aspect - 1");
  76. }
  77. public void testGenericPTW_pr119539_2() {
  78. runTest("generic pertypewithin aspect - 2");
  79. }
  80. public void testGenericPTW_pr119539_3() {
  81. runTest("generic pertypewithin aspect - 3");
  82. }
  83. /*
  84. * public void testBrokenDispatchByITD_pr72834() { runTest("broken dispatch");} public void testMissingAccessor_pr73856() {
  85. * runTest("missing accessor");} public void testCunningDeclareParents_pr92311() { runTest("cunning declare parents");} public
  86. * void testGenericITDsAndAbstractMethodError_pr102357() { runTest("generic itds and abstract method error");}
  87. */
  88. public void testIncorrectSignatureMatchingWithExceptions_pr119749() {
  89. runTest("incorrect exception signature matching");
  90. }
  91. public void testGeneratingCodeForAnOldRuntime_pr116679_1() {
  92. runTest("generating code for a 1.2.1 runtime - 1");
  93. }
  94. public void testGeneratingCodeForAnOldRuntime_pr116679_2() {
  95. runTest("generating code for a 1.2.1 runtime - 2");
  96. }
  97. public void testAmbiguousMethod_pr118599_1() {
  98. runTest("ambiguous method when binary weaving - 1");
  99. }
  100. public void testAmbiguousMethod_pr118599_2() {
  101. runTest("ambiguous method when binary weaving - 2");
  102. }
  103. public void testAroundAdviceArrayAdviceSigs_pr118781() {
  104. runTest("verify error with around advice array sigs");
  105. }
  106. public void testAtDeclareParents_pr117681() {
  107. runTest("at declare parents");
  108. }
  109. public void testPrivilegeProblem_pr87525() {
  110. runTest("privilege problem with switch");
  111. }
  112. public void testRangeProblem_pr109614() {
  113. runTest("Range problem");
  114. }
  115. public void testGenericAspects_pr115237() {
  116. runTest("aspectOf and generic aspects");
  117. }
  118. public void testClassFormatError_pr114436() {
  119. runTest("ClassFormatError binary weaving perthis");
  120. }
  121. public void testParserException_pr115788() {
  122. runTest("parser exception");
  123. }
  124. public void testPossibleStaticImports_pr113066_1() {
  125. runTest("possible static imports bug - 1");
  126. }
  127. public void testPossibleStaticImports_pr113066_2() {
  128. runTest("possible static imports bug - 2");
  129. }
  130. public void testPossibleStaticImports_pr113066_3() {
  131. runTest("possible static imports bug - 3");
  132. }
  133. public void testITDCtor_pr112783() {
  134. runTest("Problem with constructor ITDs");
  135. }
  136. public void testAnnotatedITDFs_pr114005_1() {
  137. runTest("Annotated ITDFs - 1");
  138. }
  139. public void testAnnotatedITDFs_pr114005_2() {
  140. runTest("Annotated ITDFs - 2");
  141. }
  142. public void testCantCallSuperMethods_pr90143() {
  143. runTest("cant call super methods");
  144. }
  145. public void testBrokenDecp_pr112476() {
  146. runTest("binary weaving decp broken");
  147. }
  148. public void testUnboundFormal_pr112027() {
  149. runTest("unexpected error unboundFormalInPC");
  150. }
  151. public void testNPEScopeSetup_pr115038() {
  152. runTest("NPE in ensureScopeSetup");
  153. }
  154. public void testCCEGenerics_pr113445() {
  155. runTest("Generics ClassCastException");
  156. }
  157. public void testMatthewsAspect_pr113947_1() {
  158. runTest("maws generic aspect - 1");
  159. }
  160. public void testMatthewsAspect_pr113947_2() {
  161. runTest("maws generic aspect - 2");
  162. }
  163. public void testFieldGet_pr114343() {
  164. runTest("field-get, generics and around advice");
  165. }
  166. public void testFieldGet_pr114343_2() {
  167. runTest("field-get, generics and around advice - 2");
  168. }
  169. public void testFieldGet_pr114343_3() {
  170. runTest("field-get, generics and around advice - 3");
  171. }
  172. public void testCaptureBinding_pr114744() {
  173. runTest("capturebinding wildcard problem");
  174. }
  175. public void testAutoboxingAroundAdvice_pr119210_1() {
  176. runTest("autoboxing around advice - 1");
  177. }
  178. public void testAutoboxingAroundAdvice_pr119210_2() {
  179. runTest("autoboxing around advice - 2");
  180. }
  181. public void testAutoboxingAroundAdvice_pr119210_3() {
  182. runTest("autoboxing around advice - 3");
  183. }
  184. public void testBadDecp_pr110788_1() {
  185. runTest("bad generic decp - 1");
  186. }
  187. public void testBadDecp_pr110788_2() {
  188. runTest("bad generic decp - 2");
  189. }
  190. public void testBadDecp_pr110788_3() {
  191. runTest("bad generic decp - 3");
  192. }
  193. public void testBadDecp_pr110788_4() {
  194. runTest("bad generic decp - 4");
  195. }
  196. // public void testSimplifiedGenericAspectITDTest() { runTest("spurious override method warning - 3");}
  197. // public void testSpuriousOverrideMethodWarning_pr119570_1() { runTest("spurious override method warning");}
  198. // public void testSpuriousOverrideMethodWarning_pr119570_2() { runTest("spurious override method warning - 2");}
  199. public void testBrokenSwitch_pr117854() {
  200. runTest("broken switch transform");
  201. }
  202. public void testVarargsITD_pr110906() {
  203. runTest("ITD varargs problem");
  204. }
  205. public void testBadRenderer_pr86903() {
  206. runTest("bcelrenderer bad");
  207. }
  208. // public void testIllegalInitialization_pr118326_1() { runTest("illegal initialization - 1");}
  209. // public void testIllegalInitialization_pr118326_2() { runTest("illegal initialization - 2");}
  210. public void testLintForAdviceSorting_pr111667() {
  211. runTest("lint for advice sorting");
  212. }
  213. public void testIncompatibleClassChangeError_pr113630_1() {
  214. runTest("IncompatibleClassChangeError - errorscenario");
  215. }
  216. public void testIncompatibleClassChangeError_pr113630_2() {
  217. runTest("IncompatibleClassChangeError - workingscenario");
  218. }
  219. public void testFieldGetProblemWithGenericField_pr113861() {
  220. runTest("field-get problems with generic field");
  221. }
  222. public void testAccesstoPrivateITDInNested_pr118698() {
  223. runTest("access to private ITD from nested type");
  224. }
  225. public void testDeclareAnnotationOnNonExistentType_pr99191_1() {
  226. runTest("declare annotation on non existent type - 1");
  227. }
  228. public void testDeclareAnnotationOnNonExistentType_pr99191_2() {
  229. runTest("declare annotation on non existent type - 2");
  230. }
  231. public void testDeclareAnnotationOnNonExistentType_pr99191_3() {
  232. runTest("declare annotation on non existent type - 3");
  233. }
  234. public void testDeclareAnnotationOnNonExistentType_pr99191_4() {
  235. runTest("declare annotation on non existent type - 4");
  236. }
  237. public void testDeclareAnnotationOnNonExistentType_pr99191_5() {
  238. runTest("declare annotation on non existent type - 5");
  239. }
  240. public void testBadGenericSigAttribute_pr110927() {
  241. runTest("cant create signature attribute");
  242. Signature sig = GenericsTests.getClassSignature(ajc, "I");
  243. if (sig == null)
  244. fail("Couldn't find signature attribute for type I");
  245. String sigString = sig.getSignature();
  246. if (!(sigString.equals("Ljava/lang/Object;LIE2;LIE1<Ljava/lang/String;>;") || sigString
  247. .equals("Ljava/lang/Object;LIE1<Ljava/lang/String;>;LIE2;"))) {
  248. fail("Signature was " + sigString
  249. + " when should have been something like Ljava/lang/Object;LIE1<Ljava/lang/String;>;LIE2;");
  250. }
  251. }
  252. public void test_typeProcessingOrderWhenDeclareParents() {
  253. runTest("Order of types passed to compiler determines weaving behavior");
  254. }
  255. public void test_aroundMethod() {
  256. runTest("method called around in class");
  257. }
  258. public void test_aroundMethodAspect() {
  259. runTest("method called around in aspect");
  260. }
  261. public void test_ambiguousBindingsDetection() {
  262. runTest("Various kinds of ambiguous bindings");
  263. }
  264. public void test_ambiguousArgsDetection() {
  265. runTest("ambiguous args");
  266. }
  267. public void testIncorrectExceptionTableWhenBreakInMethod_pr78021() {
  268. runTest("Injecting exception into while loop with break statement causes catch block to be ignored");
  269. }
  270. public void testIncorrectExceptionTableWhenReturnInMethod_pr79554() {
  271. runTest("Return in try-block disables catch-block if final-block is present");
  272. }
  273. public void testMissingDebugInfoForGeneratedMethods_pr82570() throws ClassNotFoundException {
  274. runTest("Weaved code does not include debug lines");
  275. boolean f = false;
  276. JavaClass jc = getClassFrom(ajc.getSandboxDirectory(), "PR82570_1");
  277. Method[] meths = jc.getMethods();
  278. for (int i = 0; i < meths.length; i++) {
  279. Method method = meths[i];
  280. if (f)
  281. System.err.println("Line number table for " + method.getName() + method.getSignature() + " = "
  282. + method.getLineNumberTable());
  283. assertTrue("Didn't find a line number table for method " + method.getName() + method.getSignature(),
  284. method.getLineNumberTable() != null);
  285. }
  286. // This test would determine the info isn't there if you pass -g:none ...
  287. // cR = ajc(baseDir,new String[]{"PR82570_1.java","-g:none"});
  288. // assertTrue("Expected no compile problem:"+cR,!cR.hasErrorMessages());
  289. // System.err.println(cR.getStandardError());
  290. // jc = getClassFrom(ajc.getSandboxDirectory(),"PR82570_1");
  291. // meths = jc.getMethods();
  292. // for (int i = 0; i < meths.length; i++) {
  293. // Method method = meths[i];
  294. // assertTrue("Found a line number table for method "+method.getName(),
  295. // method.getLineNumberTable()==null);
  296. // }
  297. }
  298. public void testCanOverrideProtectedMethodsViaITDandDecp_pr83303() {
  299. runTest("compiler error when mixing inheritance, overriding and polymorphism");
  300. }
  301. public void testPerTypeWithin_pr106554() {
  302. runTest("Problem in staticinitialization with pertypewithin aspect");
  303. }
  304. public void testPerTypeWithinMissesNamedInnerTypes() {
  305. runTest("pertypewithin() handing of inner classes (1)");
  306. }
  307. public void testPerTypeWithinMissesAnonymousInnerTypes() {
  308. runTest("pertypewithin() handing of inner classes (2)");
  309. }
  310. public void testPerTypeWithinIncorrectlyMatchingInterfaces() {
  311. runTest("pertypewithin({interface}) illegal field modifier");
  312. }
  313. public void test051_arrayCloningInJava5() {
  314. runTest("AJC possible bug with static nested classes");
  315. }
  316. public void testBadASMforEnums() throws IOException {
  317. runTest("bad asm for enums");
  318. if (LangUtil.is15VMOrGreater()) {
  319. ByteArrayOutputStream baos = new ByteArrayOutputStream();
  320. PrintWriter pw = new PrintWriter(baos);
  321. AsmManager.dumptree(pw, AsmManager.lastActiveStructureModel.getHierarchy().getRoot(), 0);
  322. pw.flush();
  323. String tree = baos.toString();
  324. assertTrue("Expected 'Red [enumvalue]' somewhere in here:" + tree, tree.indexOf("Red [enumvalue]") != -1);
  325. }
  326. }
  327. public void npeOnTypeNotFound() {
  328. runTest("structure model npe on type not found");
  329. }
  330. public void testNoRuntimeExceptionSoftening() {
  331. runTest("declare soft of runtime exception");
  332. }
  333. public void testRuntimeNoSoftenWithHandler() {
  334. runTest("declare soft w. catch block");
  335. }
  336. public void testSyntaxError() {
  337. runTest("invalid cons syntax");
  338. }
  339. public void testVarargsInConsBug() {
  340. runTest("varargs in constructor sig");
  341. }
  342. public void testAspectpathdirs() {
  343. runTest("dirs on aspectpath");
  344. }
  345. public void testIntroSample() {
  346. runTest("introduction sample");
  347. }
  348. public void testPTWInterface() {
  349. runTest("pertypewithin({interface}) illegal field modifier");
  350. }
  351. public void testEnumCalledEnumEtc() {
  352. runTest("enum called Enum, annotation called Annotation, etc");
  353. }
  354. public void testInternalCompilerError_pr86832() {
  355. runTest("Internal compiler error");
  356. }
  357. public void testCloneMethod_pr83311() {
  358. runTest("overriding/polymorphism error on interface method introduction");
  359. }
  360. // IfPointcut.findResidueInternal() was modified to make this test complete in a short amount
  361. // of time - if you see it hanging, someone has messed with the optimization.
  362. public void testIfEvaluationExplosion_pr94086() {
  363. runTest("Exploding compile time with if() statements in pointcut");
  364. }
  365. public void testReflectNPE_pr94167() {
  366. runTest("NPE in reflect implementation");
  367. }
  368. public void testStaticImports_pr84260() {
  369. runTest("static import failures");
  370. }
  371. public void testGenerics_pr99089() {
  372. runTest("ArrayIndexOutOfBoundsException - Generics in privileged aspects");
  373. }
  374. public void testGenerics_pr95993() {
  375. runTest("NPE at ClassScope.java:660 when compiling generic class");
  376. }
  377. public void testItdGenerics_pr99228() {
  378. runTest("ITD of a field into a generic class");
  379. }
  380. public void testItdGenerics_pr98320() {
  381. runTest("intertype with nested generic type");
  382. }
  383. public void testItdGenerics_pr100227() {
  384. runTest("inner class with generic enclosing class");
  385. }
  386. public void testItdGenerics_pr100260() {
  387. runTest("methods inherited from a generic parent");
  388. }
  389. public void testSyntaxErrorNPE_pr103266() {
  390. runTest("NPE on syntax error");
  391. }
  392. public void testFinalAbstractClass_pr109486() {
  393. runTest("Internal compiler error (ClassParser.java:242)");
  394. }
  395. public void testComplexBinding_pr102210() {
  396. runTest("NullPointerException trying to compile");
  397. }
  398. public void testIllegalStateExceptionOnNestedParameterizedType_pr106634() {
  399. runTest("IllegalStateException unpacking signature of nested parameterized type");
  400. }
  401. public void testParseErrorOnAnnotationStarPlusPattern() {
  402. runTest("(@Foo *)+ type pattern parse error");
  403. }
  404. public void test_pr106130_tooManyLocals() {
  405. runTest("test weaving with > 256 locals");
  406. }
  407. public void testMissingNamePattern_pr106461() {
  408. runTest("missing name pattern");
  409. }
  410. public void testMissingNamePattern_pr107059() {
  411. runTest("parser crashes on call(void (@a *)(..)");
  412. }
  413. public void testIntermediateAnnotationMatching() {
  414. runTest("intermediate annotation matching");
  415. }
  416. public void testBadRuntimeTestGeneration() {
  417. runTest("target(@Foo *)");
  418. }
  419. // ONE_EIGHT remove for now, needs some grammar changes to ensure empty type annotations are put in place for later consumption
  420. // public void testErrorMessageOnITDWithTypePatterns() {
  421. // runTest("clear error message on itd with type pattern");
  422. // }
  423. public void testAjKeywordsAsIdentifiers() {
  424. runTest("before and after are valid identifiers in classes");
  425. }
  426. public void testAjKeywordsAsIdentifiers2() {
  427. runTest("before and after are valid identifiers in classes, part 2");
  428. }
  429. public void testNoBeforeReturningAdvice() {
  430. runTest("before returning advice not allowed!");
  431. }
  432. public void testDetectVoidFieldType() {
  433. runTest("void field type in pointcut expression");
  434. }
  435. public void testPointcutOverriding() {
  436. runTest("overriding final pointcut from super-aspect");
  437. }
  438. public void testAtSuppressWarnings() {
  439. runTest("@SuppressWarnings should suppress");
  440. }
  441. public void testDEOWWithBindingPointcut() {
  442. runTest("declare warning : foo(str) : ...;");
  443. }
  444. public void testAroundAdviceAndInterfaceInitializer() {
  445. runTest("around advice on interface initializer");
  446. }
  447. public void testGoodErrorMessageOnUnmatchedMemberSyntax() {
  448. runTest("good error message for unmatched member syntax");
  449. }
  450. public void testITDWithNoExceptionAndIntermediary() {
  451. runTest("itd override with no exception clause");
  452. }
  453. public void testAnonymousInnerClasses() {
  454. runTest("anonymous inner classes");
  455. }
  456. public void testMultipleAnonymousInnerClasses() {
  457. runTest("multiple anonymous inner classes");
  458. }
  459. public void testPrivilegedMethodAccessorsGetRightExceptions_pr82989() {
  460. runTest("Compiler error due to a wrong exception check in try blocks");
  461. }
  462. public void testAnonymousInnerClassWithMethodReturningTypeParameter_pr107898() {
  463. runTest("anonymous inner class with method returning type parameter");
  464. }
  465. public void testMatchingOfObjectArray() {
  466. runTest("matching against Object[]");
  467. }
  468. public void testMultipleAnonymousInnerClasses_pr108104() {
  469. runTest("multiple anonymous inner classes 2");
  470. }
  471. public void testSignatureMatchingInMultipleOverrideScenario() {
  472. runTest("signature matching in override scenario");
  473. }
  474. public void testWildcardAnnotationMatching_pr108245() {
  475. runTest("wildcard annotation matching - pr108245");
  476. }
  477. public void testInnerTypesAndTypeVariables() {
  478. runTest("inner types and type variables");
  479. }
  480. public void testAtAfterThrowingWithNoFormal() {
  481. runTest("@AfterThrowing with no formal specified");
  482. }
  483. public void testParameterizedVarArgsMatch() {
  484. runTest("varargs with type variable");
  485. }
  486. public void testFieldAccessInsideITDM() {
  487. runTest("itd field access inside itd method");
  488. }
  489. public void testTypeVarWithTypeVarBound() {
  490. runTest("type variable with type variable bound");
  491. }
  492. public void testEnumSwitchInITD() {
  493. runTest("switch on enum inside ITD method");
  494. }
  495. public void testInnerTypeOfGeneric() {
  496. runTest("inner type of generic interface reference from parameterized type");
  497. }
  498. public void testDeclareParentsIntroducingCovariantReturnType() {
  499. runTest("declare parents introducing override with covariance");
  500. }
  501. public void testInnerClassPassedToVarargs() {
  502. runTest("inner class passed as argument to varargs method");
  503. }
  504. public void testInlinedFieldAccessInProceedCall() {
  505. runTest("inlined field access in proceed call");
  506. }
  507. public void testVisibiltyInSignatureMatchingWithOverridesPart1() {
  508. runTest("visibility in signature matching with overrides - 1");
  509. }
  510. public void testVisibiltyInSignatureMatchingWithOverridesPart2() {
  511. runTest("visibility in signature matching with overrides - 2");
  512. }
  513. public void testVisibiltyInSignatureMatchingWithOverridesPart3() {
  514. runTest("visibility in signature matching with overrides - 3");
  515. }
  516. public void testArgsGeneratedCorrectlyForAdviceExecution() {
  517. runTest("args generated correctly for advice execution join point");
  518. }
  519. public void testNoUnusedWarningsOnAspectTypes() {
  520. runTest("no unused warnings on aspect types");
  521. }
  522. public void testSyntheticArgumentsOnITDConstructorsNotUsedInMatching() {
  523. runTest("synthetic arguments on itd cons are not used in matching");
  524. }
  525. public void testParsingOfGenericTypeSignature() {
  526. runTest("parse generic type signature with parameterized type in interface");
  527. }
  528. public void testOverrideAndCovarianceWithDecPRuntime() {
  529. runTest("override and covariance with decp - runtime");
  530. }
  531. public void testOverrideAndCovarianceWithDecPRuntimeMultiFiles() {
  532. runTest("override and covariance with decp - runtime separate files");
  533. }
  534. public void testOverrideAndCovarianceWithDecPRuntimeMultiFilesBinaryWeaving() {
  535. runTest("override and covariance with decp - binary weaving");
  536. }
  537. public void testAbstractSynchronizedITDMethods() {
  538. runTest("abstract synchronized itdms not detected");
  539. }
  540. public void testSynchronizedITDInterfaceMethods() {
  541. runTest("synchronized itd interface methods");
  542. }
  543. public void testNoWarningOnUnusedPointcut() {
  544. runTest("unused private pointcuts");
  545. }
  546. public void testITDOnInterfaceWithExistingMember() {
  547. runTest("itd interface method already existing on interface");
  548. }
  549. public void testFinalITDMOnInterface() {
  550. runTest("final itd methods on interfaces");
  551. }
  552. public void testPrivatePointcutOverriding() {
  553. runTest("can't override private pointcut in abstract aspect");
  554. }
  555. public void testAdviceOnCflow() {
  556. runTest("advising cflow advice execution");
  557. }
  558. public void testNoTypeMismatchOnSameGenericTypes() {
  559. runTest("no type mismatch on generic types in itds");
  560. }
  561. public void testSuperCallInITD() {
  562. runTest("super call in ITD");
  563. }
  564. public void testSuperCallInITDPart2() {
  565. runTest("super call in ITD - part 2");
  566. }
  567. public void testAtAnnotationBadTest_pr103740() {
  568. runTest("Compiler failure on at_annotation");
  569. }
  570. public void testNoUnusedParameterWarningsForSyntheticAdviceArgs() {
  571. runTest("no unused parameter warnings for synthetic advice args");
  572. }
  573. public void testNoVerifyErrorWithSetOnInnerType() {
  574. runTest("no verify error with set on inner type");
  575. }
  576. public void testCantFindTypeErrorWithGenericReturnTypeOrParameter() {
  577. runTest("cant find type error with generic return type or parameter");
  578. }
  579. public void testNoVerifyErrorOnGenericCollectionMemberAccess() {
  580. runTest("no verify error on generic collection member access");
  581. }
  582. public void testRawAndGenericTypeConversionITDCons() {
  583. runTest("raw and generic type conversion with itd cons");
  584. }
  585. public void testAtAnnotationBindingWithAround() {
  586. runTest("@annotation binding with around advice");
  587. }
  588. public void testUnableToBuildShadows_pr109728() {
  589. runTest("Unable to build shadows");
  590. }
  591. public void testMessageOnMissingTypeInDecP() {
  592. runTest("declare parents on a missing type");
  593. }
  594. public void testParameterizedGenericMethods() {
  595. runTest("parameterized generic methods");
  596. }
  597. public void testIllegalChangeToPointcutDeclaration_pr111915() {
  598. runTest("test illegal change to pointcut declaration");
  599. }
  600. public void testCantProvideDefaultImplViaITD_pr110307_1() {
  601. runTest("Cant provide default implementation via ITD - 1");
  602. }
  603. public void testCantProvideDefaultImplViaITD_pr110307_2() {
  604. runTest("Cant provide default implementation via ITD - 2");
  605. }
  606. public void testCantProvideDefaultImplViaITD_pr110307_3() {
  607. runTest("Cant provide default implementation via ITD - 3");
  608. }
  609. public void testCantProvideDefaultImplViaITD_pr110307_4() {
  610. runTest("Cant provide default implementation via ITD - 4");
  611. }
  612. public void testCantProvideDefaultImplViaITD_pr110307_5() {
  613. runTest("Cant provide default implementation via ITD - 5");
  614. }
  615. // Needs a change in the compiler so that getType() can be overridden in the intertype scope - thats
  616. // where we can police whether a type variable has been used without being specified appropriately.
  617. // public void testCantProvideDefaultImplViaITD_pr110307_6() {runTest("Cant provide default implementation via ITD - 6");}
  618. public void testCantProvideDefaultImplViaITD_pr110307_7() {
  619. runTest("Cant provide default implementation via ITD - 7");
  620. }
  621. public void testCallJoinPointsInAnonymousInnerClasses() {
  622. runTest("call join points in anonymous inner classes");
  623. }
  624. public void testNoRequirementForUnwovenTypesToBeExposedToWeaver() {
  625. runTest("default impl of Runnable");
  626. }
  627. public void testArrayCloneCallJoinPoints() {
  628. runTest("array clone call join points in 1.4 vs 1.3");
  629. }
  630. public void testDebugInfoForAroundAdvice() {
  631. runTest("debug info in around advice inlining");
  632. }
  633. public void testCCEWithGenericWildcard_pr112602() {
  634. runTest("ClassCastException with generic wildcard");
  635. }
  636. public void testVarArgsIITDInConstructor() {
  637. runTest("ITD varargs in constructor");
  638. }
  639. public void testWeaveInfoMessageForDeclareAtMethodOnITDdMethod() {
  640. runTest("weaveinfo message for declare at method on an ITDd method");
  641. }
  642. public void testITDCWithNoExplicitConsCall() {
  643. runTest("ITDC with no explicit cons call");
  644. }
  645. public void testJava5SpecificFeaturesUsedAtJava14OrLower() {
  646. if (LangUtil.is17VMOrGreater()) {
  647. runTest("java 5 pointcuts and declares at pre-java 5 compliance levels - 1.7");
  648. } else {
  649. runTest("java 5 pointcuts and declares at pre-java 5 compliance levels");
  650. }
  651. }
  652. public void testAnonymousTypes() {
  653. runTest("Anonymous types and nome matching");
  654. }
  655. public void testAdviceExecutionJPToStringForms() {
  656. runTest("adviceexecution join point toString forms");
  657. }
  658. public void testAssertWithinPointcutExpression() {
  659. runTest("pointcut expression containing 'assert'");
  660. }
  661. public void testNoVerifyErrorWithTwoThisPCDs_pr113447() {
  662. runTest("no verify error with two this pcds");
  663. }
  664. public void testNoVerifyErrorWithTwoAtThisPCDs_pr113447() {
  665. runTest("no verify error with two at this pcds");
  666. }
  667. public void testNoVerifyErrorWithAtWithinPCDs_pr113447() {
  668. runTest("no verify error with at within pcds");
  669. }
  670. public void testNoVerifyErrorWithAtWithincodePCDs_pr113447() {
  671. runTest("no verify error with at withincode pcds");
  672. }
  673. public void testNoVerifyErrorWithAtAnnotationPCDs_pr113447() {
  674. runTest("no verify error with at annotation pcds");
  675. }
  676. public void testNoVerifyErrorWithTwoArgsPCDs_pr113447() {
  677. runTest("no verify error with two args pcds");
  678. }
  679. public void testNoStackOverflowWithCircularPCDInGenericAspect() {
  680. runTest("no StackOverflowError with circular pcd in generic aspect");
  681. }
  682. public void testNoStackOverflowWithCircularPCDInGenericAspect2() {
  683. runTest("no StackOverflowError with circular pcd in generic aspect - 2");
  684. }
  685. public void testNPEInThisJoinPointStaticPart() {
  686. runTest("thisJoinPointStaticPart in if test");
  687. }
  688. public void testPointcutParsingOfCompiledPointcuts() {
  689. runTest("pointcut parsing with ajc compiled pointcut references");
  690. }
  691. public void testReflectionOfAbstractITDs() {
  692. runTest("reflection on abstract ITDs (Billing example)");
  693. }
  694. public void testDeclareSoftWithAdviceExecution() {
  695. runTest("declare soft and adviceexecution");
  696. }
  697. public void testDeclareSoftWithExclusions() {
  698. runTest("declare soft and exclusions");
  699. }
  700. public void testReturningObjectBinding() {
  701. runTest("returning(Object) binding");
  702. }
  703. public void testPerTargetAndNegation() {
  704. runTest("pertarget and negated pointcut");
  705. }
  706. public void testParameterizedPointcutAndAdvice() {
  707. runTest("parameterized pointcut and advice");
  708. }
  709. public void testDoublyParameterizedAbstractType() {
  710. runTest("double parameter generic abstract type");
  711. }
  712. public void testArgNamesInAdviceAnnotations() {
  713. runTest("arg names in advice annotations");
  714. }
  715. /*
  716. * Load-time weaving bugs
  717. */
  718. public void testNPEinWeavingAdaptor_pr116626() {
  719. runTest("NPE in WeavingAdaptor");
  720. }
  721. public void testXlintMessageForImproperAnnotationType_pr115252_Exact() {
  722. runTest("xlint message for improper exact annotation type");
  723. }
  724. public void testXlintMessageForImproperAnnotationType_pr115252_OR() {
  725. runTest("xlint message for improper annotation type inside OR");
  726. }
  727. public void testXlintMessageForImproperAnnotationType_pr115252_AND() {
  728. runTest("xlint message for improper annotation type inside AND");
  729. }
  730. public void testXlintMessageForImproperAnnotationType_pr115252_Return() {
  731. runTest("xlint message for improper annotated return type");
  732. }
  733. public void testXlintMessageForImproperAnnotationType_pr115252_Declaring() {
  734. runTest("xlint message for improper annotated declaring type");
  735. }
  736. public void testXlintMessageForImproperAnnotationType_pr115252_Parameter() {
  737. runTest("xlint message for improper annotated parameter type");
  738. }
  739. public void testXlintMessageForImproperAnnotationType_pr115252_Throws() {
  740. runTest("xlint message for improper annotated throws pattern");
  741. }
  742. public void testXlintMessageForImproperAnnotationType_pr115252_MoreThanOne() {
  743. runTest("xlint message for more than one improper annotated parameter type");
  744. }
  745. public void testNoNPEWhenInaccessibleMethodIsCalledWithinITD_pr119019() {
  746. runTest("no NPE when inaccessible method is called within itd");
  747. }
  748. public void testNoNPEWithOrPointcutAndMoreThanOneArgs_pr118149() {
  749. runTest("no NPE with or pointcut and more than one args");
  750. }
  751. public void testNoSOBWithGenericInnerAspects_pr119543() {
  752. runTest("no StringOutOfBoundsException with generic inner aspects");
  753. }
  754. public void testIllegalAccessErrorWithAroundAdvice_pr119657() {
  755. runTest("IllegalAccessError with around advice on interface method call");
  756. }
  757. public void testIllegalAccessErrorWithAroundAdviceNotSelf_pr119657() {
  758. runTest("IllegalAccessError with around advice on interface method call not self");
  759. }
  760. public void testIllegalAccessErrorWithAroundAdviceTerminateAfterCompilationLTW_pr119657() {
  761. runTest("IllegalAccessError with around advice on interface method call using -XterminateAfterCompilation and LTW");
  762. }
  763. public void testIllegalAccessErrorWithAroundAdviceLTW_pr119657() {
  764. runTest("IllegalAccessError with around advice on interface method call using LTW");
  765. }
  766. public void testIllegalAccessErrorWithAroundAdviceNotSelfLTW_pr119657() {
  767. runTest("IllegalAccessError with around advice on interface method call not self using LTW");
  768. }
  769. public void testIllegalAccessErrorWithAroundAdviceSelfAndNotSelfLTW_pr119657() {
  770. runTest("IllegalAccessError with around advice on interface method call self and not self using LTW");
  771. }
  772. public void testIllegalAccessErrorWithAroundAdviceLTWNoInline_pr119657() {
  773. runTest("IllegalAccessError with around advice on interface method call using LTW and -XnoInline");
  774. }
  775. public void testReflectOnCodeStyleITDs() {
  776. runTest("reflection on itds");
  777. }
  778. public void testReflectOnAtAspectJDecP() {
  779. runTest("reflection on @DeclareParents");
  780. }
  781. public void testModifierOverrides() {
  782. runTest("modifier overrides");
  783. }
  784. public void testAbstractPerThisInAtAspectJ() {
  785. runTest("abstract perthis in @AspectJ");
  786. }
  787. public void testNPEInBcelAdviceWithConcreteAspect_pr121385() {
  788. runTest("override protected pointcut in aop.xml concrete aspect");
  789. }
  790. }