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.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677
  1. <!DOCTYPE suite SYSTEM "../tests/ajcTestSuite.dtd"[]>
  2. <!-- Load-time weaving tests -->
  3. <suite>
  4. <!-- Load-time weaving tests -->
  5. <ajc-test dir="ltw"
  6. title="Ensure 1st aspect is rewoven when weaving 2nd aspect"
  7. keywords="reweavable">
  8. <compile files="Main.java, Aspect1.aj" outjar="main1.jar"
  9. options="-showWeaveInfo -verbose -1.4">
  10. <message kind="weave"
  11. text="method-execution(void Main.test1())' in Type 'Main' (Main.java:17) advised by before advice from 'Aspect1' (Aspect1.aj:16)" />
  12. </compile>
  13. <compile classpath="main1.jar" files="Aspect2.aj"
  14. outjar="aspect2.jar" options="-showWeaveInfo -verbose -1.4">
  15. </compile>
  16. <run class="Main" ltw="aop-ltwreweavable.xml">
  17. <stdout>
  18. <line text="Main.main" />
  19. <line text="Main.test1" />
  20. <line text="Main.test2" />
  21. </stdout>
  22. <stderr>
  23. <line
  24. text="weaveinfo Join point 'method-execution(void Main.test1())' in Type 'Main' (Main.java:17) advised by before advice from 'Aspect1' (Aspect1.aj:16)" />
  25. <line
  26. text="weaveinfo Join point 'method-execution(void Main.test2())' in Type 'Main' (Main.java:21) advised by before advice from 'Aspect2' (Aspect2.aj:16)" />
  27. <line text="Aspect1.before_test1" />
  28. <line text="Aspect2.before_test2" />
  29. </stderr>
  30. </run>
  31. </ajc-test>
  32. <ajc-test dir="ltw"
  33. title="Ensure valid aop.xml file is generated" keywords="-outxml">
  34. <compile files="Main.java" outjar="main.jar">
  35. </compile>
  36. <compile classpath="main.jar"
  37. files="Aspect1.aj, Aspect2.aj, pakkage/Aspect3.aj"
  38. outxmlfile="META-INF/aop.xml" options="-1.4">
  39. </compile>
  40. <run class="Main" ltw="">
  41. <stdout>
  42. <line text="Main.main" />
  43. <line text="Main.test1" />
  44. <line text="Main.test2" />
  45. </stdout>
  46. <stderr>
  47. <line text="Aspect1.before_test1" />
  48. <line text="Aspect2.before_test2" />
  49. <line text="pakkage.Aspect3.before_test2" />
  50. </stderr>
  51. </run>
  52. </ajc-test>
  53. <ajc-test dir="ltw"
  54. title="Ensure valid aop.xml is generated for -outjar"
  55. keywords="-outxml">
  56. <compile files="Main.java" outjar="main.jar">
  57. </compile>
  58. <compile classpath="main.jar"
  59. files="Aspect1.aj, Aspect2.aj, pakkage/Aspect3.aj"
  60. outjar="aspects.jar" options="-1.4 -outxml">
  61. </compile>
  62. <run class="Main" ltw="">
  63. <stdout>
  64. <line text="Main.main" />
  65. <line text="Main.test1" />
  66. <line text="Main.test2" />
  67. </stdout>
  68. <stderr>
  69. <line text="Aspect1.before_test1" />
  70. <line text="Aspect2.before_test2" />
  71. <line text="pakkage.Aspect3.before_test2" />
  72. </stderr>
  73. </run>
  74. </ajc-test>
  75. <ajc-test dir="ltw"
  76. title="Ensure no weaving without visible aop.xml" keywords="reweavable">
  77. <compile files="TestMain.java, Main.java">
  78. </compile>
  79. <run class="TestMain" ltw="">
  80. <stdout>
  81. <line text="Main.main" />
  82. <line text="Main.test1" />
  83. <line text="Main.test2" />
  84. </stdout>
  85. <stderr>
  86. <line text="info AspectJ Weaver Version" />
  87. <line
  88. text="info register classloader org.aspectj.weaver.loadtime.WeavingURLClassLoader" />
  89. <line
  90. text="info no configuration found. Disabling weaver for class loader org.aspectj.weaver.loadtime.WeavingURLClassLoader" />
  91. </stderr>
  92. </run>
  93. </ajc-test>
  94. <!-- type discarding tests, investigating call munging -->
  95. <ajc-test dir="ltw/callMunging"
  96. title="discarding woven types - 1">
  97. <compile files="A.java,B.java,T.java,Main.java"
  98. outjar="classes.jar" />
  99. <compile files="X.java" outjar="aspects.jar"
  100. classpath="classes.jar" options="-Xlint:ignore" />
  101. <run class="Main" ltw="aop.xml">
  102. <stdout>
  103. <line text="into:main" />
  104. <line text="A.method() running" />
  105. <line text="advice running" />
  106. <line text="T.m1() running" />
  107. <line text="B.method() running" />
  108. <line text="advice running" />
  109. <line text="T.m2() running" />
  110. <line text="leave:main" />
  111. </stdout>
  112. </run>
  113. </ajc-test>
  114. <ajc-test dir="ltw/callMunging/case1"
  115. title="aggressive ltw - decp">
  116. <compile files="A.java,T.java,Main.java" outjar="classes.jar" />
  117. <compile files="X.java" outjar="aspects.jar"
  118. classpath="classes.jar" options="-Xlint:ignore" />
  119. <run class="Main" ltw="aop.xml">
  120. <stdout>
  121. <line text="into:main" />
  122. <line text="A.method() running" />
  123. <line text="advice running" />
  124. <line text="T.m1() running" />
  125. <line text="leave:main" />
  126. </stdout>
  127. </run>
  128. </ajc-test>
  129. <ajc-test dir="ltw/callMunging/case1"
  130. title="aggressive ltw - decp - deactivate">
  131. <compile files="A.java,T.java,Main.java" outjar="classes.jar" />
  132. <compile files="X.java" outjar="aspects.jar"
  133. classpath="classes.jar" options="-Xlint:ignore" />
  134. <run class="Main" ltw="aop2.xml">
  135. <stdout>
  136. <line text="into:main" />
  137. <line text="A.method() running" />
  138. <line text="T.m1() running" />
  139. <line text="leave:main" />
  140. </stdout>
  141. </run>
  142. </ajc-test>
  143. <ajc-test dir="ltw/callMunging/case1"
  144. title="aggressive ltw - hierarchy">
  145. <compile files="T.java,HierMain.java" outjar="classes.jar" />
  146. <compile files="A.java" outjar="sub.hiddenjar"
  147. classpath="classes.jar" />
  148. <compile files="X.java" outjar="aspects.jar"
  149. classpath="classes.jar" options="-Xlint:ignore" />
  150. <run class="HierMain" ltw="aop.xml">
  151. <stdout>
  152. <line text="into:main" />
  153. <line text="A.method() running" />
  154. <line text="advice running" />
  155. <line text="T.m1() running" />
  156. <line text="leave:main" />
  157. </stdout>
  158. </run>
  159. </ajc-test>
  160. <ajc-test dir="ltw/callMunging/case3"
  161. title="aggressive ltw - decp - 2">
  162. <compile files="A.java,T.java,S.java,Main.java"
  163. outjar="classes.jar" />
  164. <compile files="X.java" outjar="aspects.jar"
  165. classpath="classes.jar" options="-Xlint:ignore" />
  166. <run class="Main" ltw="aop.xml">
  167. <stdout>
  168. <line text="into:main" />
  169. <line text="A.method() running" />
  170. <line text="advice running" />
  171. <line text="T.m1() running" />
  172. <line text="leave:main" />
  173. </stdout>
  174. </run>
  175. </ajc-test>
  176. <ajc-test dir="ltw/callMunging/case2"
  177. title="aggressive ltw - deca">
  178. <compile files="A.java,T.java,Main.java,MarkerAnnotation.java"
  179. outjar="classes.jar" options="-1.5" />
  180. <compile files="X.java" outjar="aspects.jar"
  181. classpath="classes.jar" options="-1.5 -Xlint:ignore" />
  182. <run class="Main" ltw="aop.xml">
  183. <stdout>
  184. <line text="into:main" />
  185. <line text="A.method() running" />
  186. <line text="advice running" />
  187. <line text="T.m1() running" />
  188. <line text="leave:main" />
  189. </stdout>
  190. </run>
  191. </ajc-test>
  192. <!-- end of discarding type tests -->
  193. <ajc-test dir="ltw"
  194. title="Define concrete sub-aspect using aop.xml" keywords="aop.xml">
  195. <compile files="Main.java" outjar="main.jar">
  196. </compile>
  197. <!-- was in next section classpath="main1.jar" -->
  198. <compile files="AbstractSuperAspect.aj" outjar="aspect.jar"
  199. options="-1.4">
  200. </compile>
  201. <run class="Main" ltw="aop-defineaspect.xml" usefullltw="true">
  202. <stdout>
  203. <line text="Main.main" />
  204. <line text="Main.test1" />
  205. <line text="Main.test2" />
  206. </stdout>
  207. <stderr>
  208. <line text="info AspectJ Weaver Version" />
  209. <line text="info register classloader" />
  210. <line text="info using" />
  211. <line text="info define aspect ConcreteAspect" />
  212. <line text="debug weaving 'ConcreteAspect'" />
  213. <line text="debug generating class 'ConcreteAspect'" />
  214. <line text="debug weaving 'Main'" />
  215. <line text="AbstractSuperAspect.before_test1" />
  216. </stderr>
  217. </run>
  218. </ajc-test>
  219. <ajc-test dir="ltw"
  220. title="Use abstract aspect for ITD using aop.xml"
  221. keywords="abstract aspect, ITD">
  222. <compile files="TestITDMethod.java">
  223. </compile>
  224. <compile files="AbstractAspect.aj" options="-1.4">
  225. <message kind="warning"
  226. text="this affected type is not exposed to the weaver: TestITDMethod" />
  227. </compile>
  228. <run class="TestITDMethod" options="test"
  229. ltw="aop-abstractaspect.xml">
  230. <stdout>
  231. <line text="TestITDMethod.main" />
  232. </stdout>
  233. <stderr>
  234. <line
  235. text="weaveinfo Type 'TestITDMethod' (TestITDMethod.java) has intertyped method from 'AbstractAspect' (AbstractAspect.aj:'void TestITDMethod.test()')" />
  236. <line text="AbstractAspect_TestITDMethod.test" />
  237. </stderr>
  238. </run>
  239. </ajc-test>
  240. <ajc-test dir="ltw"
  241. title="Ensure a subset of inherited aspects is used for weaving"
  242. keywords="aspects, include">
  243. <compile files="Main.java" outjar="main.jar">
  244. </compile>
  245. <compile classpath="main.jar"
  246. files="Aspect1.aj, Aspect2.aj, pakkage/Aspect3.aj"
  247. outjar="aspects.jar" options="-outxml -1.4">
  248. </compile>
  249. <run class="Main" ltw="aop-aspectsinclude.xml">
  250. <stdout>
  251. <line text="Main.main" />
  252. <line text="Main.test1" />
  253. <line text="Main.test2" />
  254. </stdout>
  255. <stderr>
  256. <line text="pakkage.Aspect3.before_test2" />
  257. </stderr>
  258. </run>
  259. </ajc-test>
  260. <ajc-test dir="ltw"
  261. title="Ensure weaver lint warning issued when an aspect is not used for weaving"
  262. keywords="aspects, include, lint">
  263. <compile files="Main.java" outjar="main.jar">
  264. </compile>
  265. <compile classpath="main.jar"
  266. files="Aspect1.aj, Aspect2.aj, pakkage/Aspect3.aj"
  267. outjar="aspects.jar" options="-outxml -1.4">
  268. </compile>
  269. <run class="Main" ltw="aop-aspectsincludewithlintwarning.xml">
  270. <stdout>
  271. <line text="Main.main" />
  272. <line text="Main.test1" />
  273. <line text="Main.test2" />
  274. </stdout>
  275. <stderr ordered="no">
  276. <line
  277. text="warning aspect Aspect1 exluded for class loader org.aspectj.weaver.loadtime.WeavingURLClassLoader [Xlint:aspectExcludedByConfiguration]" />
  278. <line
  279. text="warning aspect Aspect2 exluded for class loader org.aspectj.weaver.loadtime.WeavingURLClassLoader [Xlint:aspectExcludedByConfiguration]" />
  280. <line text="pakkage.Aspect3.before_test2" />
  281. </stderr>
  282. </run>
  283. </ajc-test>
  284. <ajc-test dir="ltw" title="Empty Xlint.properties file"
  285. keywords="xlint, ltw">
  286. <compile files="Main.java">
  287. </compile>
  288. <run class="Main" ltw="aop-xlintfile.xml"
  289. xlintfile="Xlint-empty.properties">
  290. <stderr>
  291. </stderr>
  292. </run>
  293. </ajc-test>
  294. <ajc-test dir="ltw" title="Set Xset properties enabled"
  295. keywords="xSet, ltw">
  296. <compile files="Main.java,Aspect1.aj">
  297. </compile>
  298. <run class="Main" ltw="aop-xset-verbose.xml"
  299. xlintfile="Xlint-empty.properties">
  300. </run>
  301. </ajc-test>
  302. <ajc-test dir="ltw" title="Set Xset properties disabled"
  303. keywords="xSet, ltw">
  304. <compile files="Main.java,Aspect1.aj">
  305. </compile>
  306. <run class="Main" ltw="aop-xset-verbose.xml"
  307. xlintfile="Xlint-empty.properties">
  308. </run>
  309. </ajc-test>
  310. <ajc-test dir="ltw"
  311. title="Warning with missing Xlint.properties file"
  312. keywords="xlint, ltw">
  313. <compile files="Main.java">
  314. </compile>
  315. <run class="Main" ltw="aop-xlintfile.xml">
  316. <stderr>
  317. <line
  318. text="warning Cannot access resource for -Xlintfile:Xlint-empty.properties" />
  319. </stderr>
  320. </run>
  321. </ajc-test>
  322. <ajc-test dir="ltw/hier"
  323. title="separate compilation with ltw: declare parents and call"
  324. keywords="ltw">
  325. <compile files="util/A.aj,util/T.aj" />
  326. <compile
  327. files="child/Executor.aj,child/Advisor.aj,top/SimpleMain.aj"
  328. options="-1.4">
  329. <message kind="warning"
  330. text="this affected type is not exposed to the weaver: util.A" />
  331. </compile>
  332. <run class="top.SimpleMain" ltw="aop-single.xml">
  333. <stdout>
  334. <line text="T call" />
  335. </stdout>
  336. <stderr>
  337. <line
  338. text="weaveinfo Join point 'method-call(void util.A.foo())' in Type 'child.Executor' (Executor.aj:18) advised by before advice from 'child.Advisor' (Advisor.aj:20)" />
  339. <line
  340. text="weaveinfo Extending interface set for type 'util.A' (A.aj) to include 'util.T' (Advisor.aj)" />
  341. <line
  342. text="weaveinfo Extending interface set for type 'child.Advisor' (Advisor.aj) to include 'util.T' (Advisor.aj)" />
  343. </stderr>
  344. </run>
  345. </ajc-test>
  346. <ajc-test dir="ltw"
  347. title="Warning when advice doesn't match suppressed for LTW"
  348. keywords="xlint, ltw">
  349. <compile files="Main.java">
  350. </compile>
  351. <compile files="Aspect3.aj" options="-1.4">
  352. </compile>
  353. <run class="Main" ltw="aop-nomatch.xml">
  354. <stderr>
  355. <line text="info AspectJ Weaver Version" />
  356. <line text="info register classloader" />
  357. <line text="info using" />
  358. <line text="info register aspect Aspect3" />
  359. <line text="debug weaving 'Main'" />
  360. </stderr>
  361. </run>
  362. </ajc-test>
  363. <ajc-test dir="ltw"
  364. title="Override suppressing of warning when advice doesn't match using -Xlintfile"
  365. keywords="xlint, ltw">
  366. <compile files="Main.java">
  367. </compile>
  368. <compile files="Aspect3.aj" options="-1.4">
  369. </compile>
  370. <run class="Main" ltw="aop-nomatchxlintfile.xml"
  371. xlintfile="Xlint-nomatch.properties">
  372. <stderr>
  373. <line text="info AspectJ Weaver Version" />
  374. <line text="info register classloader" />
  375. <line text="info using" />
  376. <line text="info register aspect Aspect3" />
  377. <line text="can not build thisJoinPoint lazily for this advice" />
  378. <line text="debug weaving 'Main'" />
  379. </stderr>
  380. </run>
  381. </ajc-test>
  382. <ajc-test dir="ltw"
  383. title="Warning when advice doesn't match using -Xlint:default"
  384. keywords="xlint, ltw">
  385. <compile files="Main.java">
  386. </compile>
  387. <compile files="Aspect3.aj" options="-1.4">
  388. </compile>
  389. <run class="Main" ltw="aop-nomatchxlint.xml">
  390. <stderr>
  391. <line text="info AspectJ Weaver Version" />
  392. <line text="info register classloader" />
  393. <line text="info using" />
  394. <line text="info register aspect Aspect3" />
  395. <line text="can not build thisJoinPoint lazily for this advice" />
  396. <line text="debug weaving 'Main'" />
  397. </stderr>
  398. </run>
  399. </ajc-test>
  400. <ajc-test dir="ltw"
  401. title="Override suppressing of warning when advice doesn't match using -Xlint:warning"
  402. keywords="xlint, ltw">
  403. <compile files="Main.java">
  404. </compile>
  405. <compile files="Aspect3.aj" options="-1.4">
  406. </compile>
  407. <run class="Main" ltw="aop-nomatchxlint.xml">
  408. <stderr>
  409. <line text="info AspectJ Weaver Version" />
  410. <line text="info register classloader" />
  411. <line text="info using" />
  412. <line text="info register aspect Aspect3" />
  413. <line text="can not build thisJoinPoint lazily for this advice" />
  414. <line text="debug weaving 'Main'" />
  415. </stderr>
  416. </run>
  417. </ajc-test>
  418. <!-- based on "Ensure 1st aspect is rewoven when weaving 2nd aspect" -->
  419. <ajc-test dir="ltw" title="Nonstandard jar file extensions"
  420. pr="137235">
  421. <compile files="folder.jar/Main.java, folder.jar/Aspect1.aj"
  422. outjar="folder.jar/main1.zip" options="-showWeaveInfo -1.4">
  423. <message kind="weave"
  424. text="method-execution(void Main.test1())' in Type 'Main' (Main.java:17) advised by before advice from 'Aspect1' (Aspect1.aj:16)" />
  425. </compile>
  426. <compile classpath="$sandbox/folder.jar/main1.zip"
  427. files="Aspect2.aj" outjar="aspect2Jar" options="-showWeaveInfo -1.4">
  428. </compile>
  429. <run class="Main" ltw="aop-ltwreweavable.xml"
  430. classpath="$sandbox/folder.jar/main1.zip,$sandbox/aspect2Jar">
  431. <stdout>
  432. <line text="Main.main" />
  433. <line text="Main.test1" />
  434. <line text="Main.test2" />
  435. </stdout>
  436. <stderr>
  437. <line
  438. text="weaveinfo Join point 'method-execution(void Main.test1())' in Type 'Main' (Main.java:17) advised by before advice from 'Aspect1' (Aspect1.aj:16)" />
  439. <line
  440. text="weaveinfo Join point 'method-execution(void Main.test2())' in Type 'Main' (Main.java:21) advised by before advice from 'Aspect2' (Aspect2.aj:16)" />
  441. <line text="Aspect1.before_test1" />
  442. <line text="Aspect2.before_test2" />
  443. </stderr>
  444. </run>
  445. </ajc-test>
  446. <ajc-test dir="ltw" title="Odd zip on classpath" pr="137235">
  447. <compile files="folder.jar/Main.java, folder.jar/Aspect1.aj"
  448. outjar="folder.jar/main1.archive" options="-showWeaveInfo">
  449. <message kind="weave"
  450. text="method-execution(void Main.test1())' in Type 'Main' (Main.java:17) advised by before advice from 'Aspect1' (Aspect1.aj:16)" />
  451. </compile>
  452. <compile classpath="$sandbox/folder.jar/main1.archive"
  453. files="Aspect2.aj" outjar="aspect2Jar" options="-showWeaveInfo -1.4">
  454. </compile>
  455. <run class="Main" ltw="aop-ltwreweavable.xml"
  456. classpath="$sandbox/folder.jar/main1.archive,$sandbox/aspect2Jar">
  457. <stdout>
  458. <line text="Main.main" />
  459. <line text="Main.test1" />
  460. <line text="Main.test2" />
  461. </stdout>
  462. <stderr>
  463. <line
  464. text="weaveinfo Join point 'method-execution(void Main.test1())' in Type 'Main' (Main.java:17) advised by before advice from 'Aspect1' (Aspect1.aj:16)" />
  465. <line
  466. text="weaveinfo Join point 'method-execution(void Main.test2())' in Type 'Main' (Main.java:21) advised by before advice from 'Aspect2' (Aspect2.aj:16)" />
  467. <line text="Aspect1.before_test1" />
  468. <line text="Aspect2.before_test2" />
  469. </stderr>
  470. </run>
  471. </ajc-test>
  472. <ajc-test dir="ltw" title="JDK14 LTW with XML" keywords="ltw">
  473. <compile files="HelloWorldWithException.java"
  474. options="-outjar hello.jar" />
  475. <compile files="ExceptionHandler.aj"
  476. options="-outxml -outjar handler.jar -1.4" />
  477. <ant file="ant.xml" target="JDK14 LTW with XML" verbose="true">
  478. <stdout>
  479. <line text="Hello World!" />
  480. </stdout>
  481. <stderr>
  482. <line text="TraceFactory.instance=" />
  483. </stderr>
  484. </ant>
  485. </ajc-test>
  486. <ajc-test dir="ltw" title="JDK14 LTW with ASPECTPATH"
  487. keywords="ltw">
  488. <compile files="HelloWorldWithException.java"
  489. options="-outjar hello.jar" />
  490. <compile files="ExceptionHandler.aj"
  491. options="-outjar handler.jar" />
  492. <ant file="ant.xml" target="JDK14 LTW with ASPECTPATH"
  493. verbose="true">
  494. <stdout>
  495. <line text="Hello World!" />
  496. </stdout>
  497. <stderr>
  498. <line text="TraceFactory.instance=" />
  499. </stderr>
  500. </ant>
  501. </ajc-test>
  502. <ajc-test dir="ltw" title="TestServer with HelloWorld"
  503. keywords="ltw,server">
  504. <compile files="HelloWorldWithException.java"
  505. options="-outjar hello.jar" />
  506. <compile files="ExceptionHandler.aj"
  507. options="-outxml -outjar handler.jar -1.4" />
  508. <ant file="ant-server.xml" target="TestServer with HelloWorld"
  509. verbose="true">
  510. <stdout>
  511. <line text="Starting ..." />
  512. <line text="Running HelloWorld" />
  513. <line text="Hello World!" />
  514. <line text="Stopping ..." />
  515. </stdout>
  516. </ant>
  517. </ajc-test>
  518. <!-- <ajc-test dir="ltw" title="TestServer with Parent and Child" keywords="ltw,server">
  519. <compile files="Parent.java" options="-outjar parent.jar"/> <compile files="Child.java"
  520. options="-classpath parent.jar -outjar child.jar"/> <ant file="ant-server.xml"
  521. target="TestServer with Parent and Child" verbose="true"> <stdout> <line
  522. text="Starting ..."/> <line text="Running Child"/> <line text="Parent"/>
  523. <line text="Child"/> <line text="Stopping ..."/> </stdout> </ant> </ajc-test> -->
  524. <ajc-test dir="ltw" title="TestServer with Parent and Child"
  525. keywords="ltw,server">
  526. <compile files="HelloWorldWithException.java"
  527. options="-outjar child.jar" />
  528. <compile files="ExceptionHandler.aj"
  529. options="-outxml -outjar parent.jar -1.4" />
  530. <ant file="ant-server.xml"
  531. target="TestServer with Parent and Child" verbose="true">
  532. <stdout>
  533. <line text="Starting ..." />
  534. <line text="Running HelloWorld" />
  535. <line text="Hello World!" />
  536. <line text="Stopping ..." />
  537. </stdout>
  538. </ant>
  539. </ajc-test>
  540. <ajc-test dir="ltw"
  541. title="override default path using -Dorg.aspectj.weaver.loadtime.configuration"
  542. keywords="ltw">
  543. <compile files="HelloWorldWithException.java"
  544. options="-outjar hello.jar" />
  545. <compile files="ExceptionHandler.aj"
  546. options="-outxml -outjar handler.jar -1.4" />
  547. <compile files="Tracing.aj"
  548. options="-outxml -outjar tracing.jar -1.4" />
  549. <ant file="ant.xml"
  550. target="override default path using -Dorg.aspectj.weaver.loadtime.configuration"
  551. verbose="true">
  552. <stdout>
  553. <line text="Hello World!" />
  554. </stdout>
  555. </ant>
  556. </ajc-test>
  557. <ajc-test dir="ltw/inclExcl" title="Inclusion and patterns"
  558. keywords="ltw">
  559. <compile files="pkg/sub/Foo.aj, pkg/Main.aj"
  560. options="-outjar base.jar" />
  561. <compile files="tracing/Tracer.aj" options="-1.4" />
  562. <run class="pkg.Main" ltw="aop-include.xml">
  563. <stderr>
  564. <line text="execution(void pkg.Main.foo())" />
  565. <line text="Main.class" />
  566. </stderr>
  567. </run>
  568. </ajc-test>
  569. <ajc-test dir="ltw/inclExcl" title="Exclusion and patterns"
  570. keywords="ltw">
  571. <compile files="pkg/sub/Foo.aj, pkg/Main.aj"
  572. options="-outjar base.jar" />
  573. <compile files="tracing/Tracer.aj" options="-1.4" />
  574. <run class="pkg.Main" ltw="aop-exclude.xml">
  575. <stderr>
  576. <line text="execution(void pkg.sub.Foo.foo())" />
  577. </stderr>
  578. </run>
  579. </ajc-test>
  580. <ajc-test dir="ltw/inclExcl" title="And patterns aspects"
  581. keywords="ltw">
  582. <compile files="pkg/sub/Foo.aj, pkg/Main.aj"
  583. options="-outjar base.jar" />
  584. <compile
  585. files="tracing/Tracer.aj, tracing/staticinit/Tracer.aj, tracing/staticinit/sub/Tracer.aj"
  586. options="-1.4" />
  587. <run class="pkg.Main" ltw="aop-aspectinclexcl.xml">
  588. <stderr>
  589. <line text="staticinitialization(pkg.Main.&lt;clinit&gt;)" />
  590. <line text="staticinitialization(pkg.sub.Foo.&lt;clinit&gt;)" />
  591. </stderr>
  592. </run>
  593. </ajc-test>
  594. <ajc-test dir="ltw" title="simple LTW" keywords="ltw">
  595. <compile files="HelloWorldWithException.java" />
  596. <compile files="ExceptionHandler.aj" options="-outxml -1.4" />
  597. <ant file="ant.xml" target="simple LTW" verbose="true">
  598. <stdout>
  599. <line text="Hello World!" />
  600. </stdout>
  601. </ant>
  602. </ajc-test>
  603. <ajc-test dir="ltw" title="dump on error" keywords="ltw">
  604. <compile files="HelloWorldWithException.java" />
  605. <compile files="ExceptionHandler.aj" options="-outxml -1.4" />
  606. <ant file="ant.xml" target="dump on error" verbose="true">
  607. <stdout>
  608. <line text="Hello World!" />
  609. </stdout>
  610. </ant>
  611. </ajc-test>
  612. <ajc-test dir="bugs153/pr155033" title="multiple dump on error"
  613. keywords="ltw">
  614. <compile files="Annotation.java" options="-1.5" />
  615. <compile
  616. files="MultipleDumpTest.java, Class1.java, Class2.java, Class3.java"
  617. options="-1.5" />
  618. <compile files="Aspect.aj" options="-1.5 -outxml -Xlint:ignore" />
  619. <!-- <run class="MultipleDumpTest" ltw="aop-multipledumponerror.xml"> <stdout>
  620. <line text="? AbortingMessageHandler.AbortingMessageHandler()"/> </stdout>
  621. </run> -->
  622. <ant file="ant.xml" target="multiple dump on error" verbose="true">
  623. <stdout>
  624. <line text="? MultipleDumpTest.main()" />
  625. <line text="? Class1.main()" />
  626. <line text="? Aspect.before()" />
  627. <line text="? Class2.main()" />
  628. <line text="? Aspect.before()" />
  629. <line text="? Class3.main()" />
  630. <line text="? Aspect.before()" />
  631. </stdout>
  632. </ant>
  633. </ajc-test>
  634. </suite>