Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.

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