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

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033
  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 (Method method : meths) {
  279. if (f)
  280. System.err.println("Line number table for " + method.getName() + method.getSignature() + " = "
  281. + method.getLineNumberTable());
  282. assertTrue("Didn't find a line number table for method " + method.getName() + method.getSignature(),
  283. method.getLineNumberTable() != null);
  284. }
  285. // This test would determine the info isn't there if you pass -g:none ...
  286. // cR = ajc(baseDir,new String[]{"PR82570_1.java","-g:none"});
  287. // assertTrue("Expected no compile problem:"+cR,!cR.hasErrorMessages());
  288. // System.err.println(cR.getStandardError());
  289. // jc = getClassFrom(ajc.getSandboxDirectory(),"PR82570_1");
  290. // meths = jc.getMethods();
  291. // for (int i = 0; i < meths.length; i++) {
  292. // Method method = meths[i];
  293. // assertTrue("Found a line number table for method "+method.getName(),
  294. // method.getLineNumberTable()==null);
  295. // }
  296. }
  297. public void testCanOverrideProtectedMethodsViaITDandDecp_pr83303() {
  298. runTest("compiler error when mixing inheritance, overriding and polymorphism");
  299. }
  300. public void testPerTypeWithin_pr106554() {
  301. runTest("Problem in staticinitialization with pertypewithin aspect");
  302. }
  303. public void testPerTypeWithinMissesNamedInnerTypes() {
  304. runTest("pertypewithin() handing of inner classes (1)");
  305. }
  306. public void testPerTypeWithinMissesAnonymousInnerTypes() {
  307. runTest("pertypewithin() handing of inner classes (2)");
  308. }
  309. public void testPerTypeWithinIncorrectlyMatchingInterfaces() {
  310. runTest("pertypewithin({interface}) illegal field modifier");
  311. }
  312. public void test051_arrayCloningInJava5() {
  313. runTest("AJC possible bug with static nested classes");
  314. }
  315. public void testBadASMforEnums() throws IOException {
  316. runTest("bad asm for enums");
  317. if (LangUtil.is15VMOrGreater()) {
  318. ByteArrayOutputStream baos = new ByteArrayOutputStream();
  319. PrintWriter pw = new PrintWriter(baos);
  320. AsmManager.dumptree(pw, AsmManager.lastActiveStructureModel.getHierarchy().getRoot(), 0);
  321. pw.flush();
  322. String tree = baos.toString();
  323. assertTrue("Expected 'Red [enumvalue]' somewhere in here:" + tree, tree.contains("Red [enumvalue]"));
  324. }
  325. }
  326. public void npeOnTypeNotFound() {
  327. runTest("structure model npe on type not found");
  328. }
  329. public void testNoRuntimeExceptionSoftening() {
  330. runTest("declare soft of runtime exception");
  331. }
  332. public void testRuntimeNoSoftenWithHandler() {
  333. runTest("declare soft w. catch block");
  334. }
  335. public void testSyntaxError() {
  336. runTest("invalid cons syntax");
  337. }
  338. public void testVarargsInConsBug() {
  339. runTest("varargs in constructor sig");
  340. }
  341. public void testAspectpathdirs() {
  342. runTest("dirs on aspectpath");
  343. }
  344. public void testIntroSample() {
  345. runTest("introduction sample");
  346. }
  347. public void testPTWInterface() {
  348. runTest("pertypewithin({interface}) illegal field modifier");
  349. }
  350. public void testEnumCalledEnumEtc() {
  351. runTest("enum called Enum, annotation called Annotation, etc");
  352. }
  353. public void testInternalCompilerError_pr86832() {
  354. runTest("Internal compiler error");
  355. }
  356. public void testCloneMethod_pr83311() {
  357. runTest("overriding/polymorphism error on interface method introduction");
  358. }
  359. // IfPointcut.findResidueInternal() was modified to make this test complete in a short amount
  360. // of time - if you see it hanging, someone has messed with the optimization.
  361. public void testIfEvaluationExplosion_pr94086() {
  362. runTest("Exploding compile time with if() statements in pointcut");
  363. }
  364. public void testReflectNPE_pr94167() {
  365. runTest("NPE in reflect implementation");
  366. }
  367. public void testStaticImports_pr84260() {
  368. runTest("static import failures");
  369. }
  370. public void testGenerics_pr99089() {
  371. runTest("ArrayIndexOutOfBoundsException - Generics in privileged aspects");
  372. }
  373. public void testGenerics_pr95993() {
  374. runTest("NPE at ClassScope.java:660 when compiling generic class");
  375. }
  376. public void testItdGenerics_pr99228() {
  377. runTest("ITD of a field into a generic class");
  378. }
  379. public void testItdGenerics_pr98320() {
  380. runTest("intertype with nested generic type");
  381. }
  382. public void testItdGenerics_pr100227() {
  383. runTest("inner class with generic enclosing class");
  384. }
  385. public void testItdGenerics_pr100260() {
  386. runTest("methods inherited from a generic parent");
  387. }
  388. public void testSyntaxErrorNPE_pr103266() {
  389. runTest("NPE on syntax error");
  390. }
  391. public void testFinalAbstractClass_pr109486() {
  392. runTest("Internal compiler error (ClassParser.java:242)");
  393. }
  394. public void testComplexBinding_pr102210() {
  395. runTest("NullPointerException trying to compile");
  396. }
  397. public void testIllegalStateExceptionOnNestedParameterizedType_pr106634() {
  398. runTest("IllegalStateException unpacking signature of nested parameterized type");
  399. }
  400. public void testParseErrorOnAnnotationStarPlusPattern() {
  401. runTest("(@Foo *)+ type pattern parse error");
  402. }
  403. public void test_pr106130_tooManyLocals() {
  404. runTest("test weaving with > 256 locals");
  405. }
  406. public void testMissingNamePattern_pr106461() {
  407. runTest("missing name pattern");
  408. }
  409. public void testMissingNamePattern_pr107059() {
  410. runTest("parser crashes on call(void (@a *)(..)");
  411. }
  412. public void testIntermediateAnnotationMatching() {
  413. runTest("intermediate annotation matching");
  414. }
  415. public void testBadRuntimeTestGeneration() {
  416. runTest("target(@Foo *)");
  417. }
  418. // ONE_EIGHT remove for now, needs some grammar changes to ensure empty type annotations are put in place for later consumption
  419. // public void testErrorMessageOnITDWithTypePatterns() {
  420. // runTest("clear error message on itd with type pattern");
  421. // }
  422. public void testAjKeywordsAsIdentifiers() {
  423. runTest("before and after are valid identifiers in classes");
  424. }
  425. public void testAjKeywordsAsIdentifiers2() {
  426. runTest("before and after are valid identifiers in classes, part 2");
  427. }
  428. public void testNoBeforeReturningAdvice() {
  429. runTest("before returning advice not allowed!");
  430. }
  431. public void testDetectVoidFieldType() {
  432. runTest("void field type in pointcut expression");
  433. }
  434. public void testPointcutOverriding() {
  435. runTest("overriding final pointcut from super-aspect");
  436. }
  437. public void testAtSuppressWarnings() {
  438. runTest("@SuppressWarnings should suppress");
  439. }
  440. public void testDEOWWithBindingPointcut() {
  441. runTest("declare warning : foo(str) : ...;");
  442. }
  443. public void testAroundAdviceAndInterfaceInitializer() {
  444. runTest("around advice on interface initializer");
  445. }
  446. public void testGoodErrorMessageOnUnmatchedMemberSyntax() {
  447. runTest("good error message for unmatched member syntax");
  448. }
  449. public void testITDWithNoExceptionAndIntermediary() {
  450. runTest("itd override with no exception clause");
  451. }
  452. public void testAnonymousInnerClasses() {
  453. runTest("anonymous inner classes");
  454. }
  455. public void testMultipleAnonymousInnerClasses() {
  456. runTest("multiple anonymous inner classes");
  457. }
  458. public void testPrivilegedMethodAccessorsGetRightExceptions_pr82989() {
  459. runTest("Compiler error due to a wrong exception check in try blocks");
  460. }
  461. public void testAnonymousInnerClassWithMethodReturningTypeParameter_pr107898() {
  462. runTest("anonymous inner class with method returning type parameter");
  463. }
  464. public void testMatchingOfObjectArray() {
  465. runTest("matching against Object[]");
  466. }
  467. public void testMultipleAnonymousInnerClasses_pr108104() {
  468. runTest("multiple anonymous inner classes 2");
  469. }
  470. public void testSignatureMatchingInMultipleOverrideScenario() {
  471. runTest("signature matching in override scenario");
  472. }
  473. public void testWildcardAnnotationMatching_pr108245() {
  474. runTest("wildcard annotation matching - pr108245");
  475. }
  476. public void testInnerTypesAndTypeVariables() {
  477. runTest("inner types and type variables");
  478. }
  479. public void testAtAfterThrowingWithNoFormal() {
  480. runTest("@AfterThrowing with no formal specified");
  481. }
  482. public void testParameterizedVarArgsMatch() {
  483. runTest("varargs with type variable");
  484. }
  485. public void testFieldAccessInsideITDM() {
  486. runTest("itd field access inside itd method");
  487. }
  488. public void testTypeVarWithTypeVarBound() {
  489. runTest("type variable with type variable bound");
  490. }
  491. public void testEnumSwitchInITD() {
  492. runTest("switch on enum inside ITD method");
  493. }
  494. public void testInnerTypeOfGeneric() {
  495. runTest("inner type of generic interface reference from parameterized type");
  496. }
  497. public void testDeclareParentsIntroducingCovariantReturnType() {
  498. runTest("declare parents introducing override with covariance");
  499. }
  500. public void testInnerClassPassedToVarargs() {
  501. runTest("inner class passed as argument to varargs method");
  502. }
  503. public void testInlinedFieldAccessInProceedCall() {
  504. runTest("inlined field access in proceed call");
  505. }
  506. public void testVisibiltyInSignatureMatchingWithOverridesPart1() {
  507. runTest("visibility in signature matching with overrides - 1");
  508. }
  509. public void testVisibiltyInSignatureMatchingWithOverridesPart2() {
  510. runTest("visibility in signature matching with overrides - 2");
  511. }
  512. public void testVisibiltyInSignatureMatchingWithOverridesPart3() {
  513. runTest("visibility in signature matching with overrides - 3");
  514. }
  515. public void testArgsGeneratedCorrectlyForAdviceExecution() {
  516. runTest("args generated correctly for advice execution join point");
  517. }
  518. public void testNoUnusedWarningsOnAspectTypes() {
  519. runTest("no unused warnings on aspect types");
  520. }
  521. public void testSyntheticArgumentsOnITDConstructorsNotUsedInMatching() {
  522. runTest("synthetic arguments on itd cons are not used in matching");
  523. }
  524. public void testParsingOfGenericTypeSignature() {
  525. runTest("parse generic type signature with parameterized type in interface");
  526. }
  527. public void testOverrideAndCovarianceWithDecPRuntime() {
  528. runTest("override and covariance with decp - runtime");
  529. }
  530. public void testOverrideAndCovarianceWithDecPRuntimeMultiFiles() {
  531. runTest("override and covariance with decp - runtime separate files");
  532. }
  533. public void testOverrideAndCovarianceWithDecPRuntimeMultiFilesBinaryWeaving() {
  534. runTest("override and covariance with decp - binary weaving");
  535. }
  536. public void testAbstractSynchronizedITDMethods() {
  537. runTest("abstract synchronized itdms not detected");
  538. }
  539. public void testSynchronizedITDInterfaceMethods() {
  540. runTest("synchronized itd interface methods");
  541. }
  542. public void testNoWarningOnUnusedPointcut() {
  543. runTest("unused private pointcuts");
  544. }
  545. public void testITDOnInterfaceWithExistingMember() {
  546. runTest("itd interface method already existing on interface");
  547. }
  548. public void testFinalITDMOnInterface() {
  549. runTest("final itd methods on interfaces");
  550. }
  551. public void testPrivatePointcutOverriding() {
  552. runTest("can't override private pointcut in abstract aspect");
  553. }
  554. public void testAdviceOnCflow() {
  555. runTest("advising cflow advice execution");
  556. }
  557. public void testNoTypeMismatchOnSameGenericTypes() {
  558. runTest("no type mismatch on generic types in itds");
  559. }
  560. public void testSuperCallInITD() {
  561. runTest("super call in ITD");
  562. }
  563. public void testSuperCallInITDPart2() {
  564. runTest("super call in ITD - part 2");
  565. }
  566. public void testAtAnnotationBadTest_pr103740() {
  567. runTest("Compiler failure on at_annotation");
  568. }
  569. public void testNoUnusedParameterWarningsForSyntheticAdviceArgs() {
  570. runTest("no unused parameter warnings for synthetic advice args");
  571. }
  572. public void testNoVerifyErrorWithSetOnInnerType() {
  573. runTest("no verify error with set on inner type");
  574. }
  575. public void testCantFindTypeErrorWithGenericReturnTypeOrParameter() {
  576. runTest("cant find type error with generic return type or parameter");
  577. }
  578. public void testNoVerifyErrorOnGenericCollectionMemberAccess() {
  579. runTest("no verify error on generic collection member access");
  580. }
  581. public void testRawAndGenericTypeConversionITDCons() {
  582. runTest("raw and generic type conversion with itd cons");
  583. }
  584. public void testAtAnnotationBindingWithAround() {
  585. runTest("@annotation binding with around advice");
  586. }
  587. public void testUnableToBuildShadows_pr109728() {
  588. runTest("Unable to build shadows");
  589. }
  590. public void testMessageOnMissingTypeInDecP() {
  591. runTest("declare parents on a missing type");
  592. }
  593. public void testParameterizedGenericMethods() {
  594. runTest("parameterized generic methods");
  595. }
  596. public void testIllegalChangeToPointcutDeclaration_pr111915() {
  597. runTest("test illegal change to pointcut declaration");
  598. }
  599. public void testCantProvideDefaultImplViaITD_pr110307_1() {
  600. runTest("Cant provide default implementation via ITD - 1");
  601. }
  602. public void testCantProvideDefaultImplViaITD_pr110307_2() {
  603. runTest("Cant provide default implementation via ITD - 2");
  604. }
  605. public void testCantProvideDefaultImplViaITD_pr110307_3() {
  606. runTest("Cant provide default implementation via ITD - 3");
  607. }
  608. public void testCantProvideDefaultImplViaITD_pr110307_4() {
  609. runTest("Cant provide default implementation via ITD - 4");
  610. }
  611. public void testCantProvideDefaultImplViaITD_pr110307_5() {
  612. runTest("Cant provide default implementation via ITD - 5");
  613. }
  614. // Needs a change in the compiler so that getType() can be overridden in the intertype scope - thats
  615. // where we can police whether a type variable has been used without being specified appropriately.
  616. // public void testCantProvideDefaultImplViaITD_pr110307_6() {runTest("Cant provide default implementation via ITD - 6");}
  617. public void testCantProvideDefaultImplViaITD_pr110307_7() {
  618. runTest("Cant provide default implementation via ITD - 7");
  619. }
  620. public void testCallJoinPointsInAnonymousInnerClasses() {
  621. runTest("call join points in anonymous inner classes");
  622. }
  623. public void testNoRequirementForUnwovenTypesToBeExposedToWeaver() {
  624. runTest("default impl of Runnable");
  625. }
  626. public void testArrayCloneCallJoinPoints() {
  627. runTest("array clone call join points in 1.4 vs 1.3");
  628. }
  629. public void testDebugInfoForAroundAdvice() {
  630. runTest("debug info in around advice inlining");
  631. }
  632. public void testCCEWithGenericWildcard_pr112602() {
  633. runTest("ClassCastException with generic wildcard");
  634. }
  635. public void testVarArgsIITDInConstructor() {
  636. runTest("ITD varargs in constructor");
  637. }
  638. public void testWeaveInfoMessageForDeclareAtMethodOnITDdMethod() {
  639. runTest("weaveinfo message for declare at method on an ITDd method");
  640. }
  641. public void testITDCWithNoExplicitConsCall() {
  642. runTest("ITDC with no explicit cons call");
  643. }
  644. public void testJava5SpecificFeaturesUsedAtJava14OrLower() {
  645. if (LangUtil.is17VMOrGreater()) {
  646. runTest("java 5 pointcuts and declares at pre-java 5 compliance levels - 1.7");
  647. } else {
  648. runTest("java 5 pointcuts and declares at pre-java 5 compliance levels");
  649. }
  650. }
  651. public void testAnonymousTypes() {
  652. runTest("Anonymous types and nome matching");
  653. }
  654. public void testAdviceExecutionJPToStringForms() {
  655. runTest("adviceexecution join point toString forms");
  656. }
  657. public void testAssertWithinPointcutExpression() {
  658. runTest("pointcut expression containing 'assert'");
  659. }
  660. public void testNoVerifyErrorWithTwoThisPCDs_pr113447() {
  661. runTest("no verify error with two this pcds");
  662. }
  663. public void testNoVerifyErrorWithTwoAtThisPCDs_pr113447() {
  664. runTest("no verify error with two at this pcds");
  665. }
  666. public void testNoVerifyErrorWithAtWithinPCDs_pr113447() {
  667. runTest("no verify error with at within pcds");
  668. }
  669. public void testNoVerifyErrorWithAtWithincodePCDs_pr113447() {
  670. runTest("no verify error with at withincode pcds");
  671. }
  672. public void testNoVerifyErrorWithAtAnnotationPCDs_pr113447() {
  673. runTest("no verify error with at annotation pcds");
  674. }
  675. public void testNoVerifyErrorWithTwoArgsPCDs_pr113447() {
  676. runTest("no verify error with two args pcds");
  677. }
  678. public void testNoStackOverflowWithCircularPCDInGenericAspect() {
  679. runTest("no StackOverflowError with circular pcd in generic aspect");
  680. }
  681. public void testNoStackOverflowWithCircularPCDInGenericAspect2() {
  682. runTest("no StackOverflowError with circular pcd in generic aspect - 2");
  683. }
  684. public void testNPEInThisJoinPointStaticPart() {
  685. runTest("thisJoinPointStaticPart in if test");
  686. }
  687. public void testPointcutParsingOfCompiledPointcuts() {
  688. runTest("pointcut parsing with ajc compiled pointcut references");
  689. }
  690. public void testReflectionOfAbstractITDs() {
  691. runTest("reflection on abstract ITDs (Billing example)");
  692. }
  693. public void testDeclareSoftWithAdviceExecution() {
  694. runTest("declare soft and adviceexecution");
  695. }
  696. public void testDeclareSoftWithExclusions() {
  697. runTest("declare soft and exclusions");
  698. }
  699. public void testReturningObjectBinding() {
  700. runTest("returning(Object) binding");
  701. }
  702. public void testPerTargetAndNegation() {
  703. runTest("pertarget and negated pointcut");
  704. }
  705. public void testParameterizedPointcutAndAdvice() {
  706. runTest("parameterized pointcut and advice");
  707. }
  708. public void testDoublyParameterizedAbstractType() {
  709. runTest("double parameter generic abstract type");
  710. }
  711. public void testArgNamesInAdviceAnnotations() {
  712. runTest("arg names in advice annotations");
  713. }
  714. /*
  715. * Load-time weaving bugs
  716. */
  717. public void testNPEinWeavingAdaptor_pr116626() {
  718. runTest("NPE in WeavingAdaptor");
  719. }
  720. public void testXlintMessageForImproperAnnotationType_pr115252_Exact() {
  721. runTest("xlint message for improper exact annotation type");
  722. }
  723. public void testXlintMessageForImproperAnnotationType_pr115252_OR() {
  724. runTest("xlint message for improper annotation type inside OR");
  725. }
  726. public void testXlintMessageForImproperAnnotationType_pr115252_AND() {
  727. runTest("xlint message for improper annotation type inside AND");
  728. }
  729. public void testXlintMessageForImproperAnnotationType_pr115252_Return() {
  730. runTest("xlint message for improper annotated return type");
  731. }
  732. public void testXlintMessageForImproperAnnotationType_pr115252_Declaring() {
  733. runTest("xlint message for improper annotated declaring type");
  734. }
  735. public void testXlintMessageForImproperAnnotationType_pr115252_Parameter() {
  736. runTest("xlint message for improper annotated parameter type");
  737. }
  738. public void testXlintMessageForImproperAnnotationType_pr115252_Throws() {
  739. runTest("xlint message for improper annotated throws pattern");
  740. }
  741. public void testXlintMessageForImproperAnnotationType_pr115252_MoreThanOne() {
  742. runTest("xlint message for more than one improper annotated parameter type");
  743. }
  744. public void testNoNPEWhenInaccessibleMethodIsCalledWithinITD_pr119019() {
  745. runTest("no NPE when inaccessible method is called within itd");
  746. }
  747. public void testNoNPEWithOrPointcutAndMoreThanOneArgs_pr118149() {
  748. runTest("no NPE with or pointcut and more than one args");
  749. }
  750. public void testNoSOBWithGenericInnerAspects_pr119543() {
  751. runTest("no StringOutOfBoundsException with generic inner aspects");
  752. }
  753. public void testIllegalAccessErrorWithAroundAdvice_pr119657() {
  754. runTest("IllegalAccessError with around advice on interface method call");
  755. }
  756. public void testIllegalAccessErrorWithAroundAdviceNotSelf_pr119657() {
  757. runTest("IllegalAccessError with around advice on interface method call not self");
  758. }
  759. public void testIllegalAccessErrorWithAroundAdviceTerminateAfterCompilationLTW_pr119657() {
  760. runTest("IllegalAccessError with around advice on interface method call using -XterminateAfterCompilation and LTW");
  761. }
  762. public void testIllegalAccessErrorWithAroundAdviceLTW_pr119657() {
  763. runTest("IllegalAccessError with around advice on interface method call using LTW");
  764. }
  765. public void testIllegalAccessErrorWithAroundAdviceNotSelfLTW_pr119657() {
  766. runTest("IllegalAccessError with around advice on interface method call not self using LTW");
  767. }
  768. public void testIllegalAccessErrorWithAroundAdviceSelfAndNotSelfLTW_pr119657() {
  769. runTest("IllegalAccessError with around advice on interface method call self and not self using LTW");
  770. }
  771. public void testIllegalAccessErrorWithAroundAdviceLTWNoInline_pr119657() {
  772. runTest("IllegalAccessError with around advice on interface method call using LTW and -XnoInline");
  773. }
  774. public void testReflectOnCodeStyleITDs() {
  775. runTest("reflection on itds");
  776. }
  777. public void testReflectOnAtAspectJDecP() {
  778. runTest("reflection on @DeclareParents");
  779. }
  780. public void testModifierOverrides() {
  781. runTest("modifier overrides");
  782. }
  783. public void testAbstractPerThisInAtAspectJ() {
  784. runTest("abstract perthis in @AspectJ");
  785. }
  786. public void testNPEInBcelAdviceWithConcreteAspect_pr121385() {
  787. runTest("override protected pointcut in aop.xml concrete aspect");
  788. }
  789. }