2
<!DOCTYPE suite SYSTEM "../tests/ajcTestSuite.dtd">
5
To log unexpected results, run
6
with -logPass -ajctestRequireKeywords=expect-fail
7
or with -logFail -ajctestSkipKeywords=expect-fail
9
You can also run using -traceTestsMin and scan for
12
FAIL pass {title..} # expect pass, actual fail
13
PASS fail {title..} # expect fail, actual pass
15
Also pick out "incremental-test" keyword for incremental tests.
18
- [fork|spoon]-[out|err|Error]-[detected|ignored]
19
- ltw-[base|jarAspectpath{-jarClasspath}]
22
- harness not stopping after unexpected-fails completes.
23
When exception thrown, everything cleaned up?
27
<!-- disabled so skipping expect-fail causes all to pass
28
(error emitted before test is skipped)
30
<ajc-test dir="noSuchDir"
31
title="fail no such directory - report as error (AjcTest specification)"
32
keywords="expect-fail">
33
<compile files="NoSuchFile.java"/>
37
<ajc-test dir="harness"
39
<compile files="ErrorTest.java">
40
<message kind="error" line="5"/>
41
<message kind="error" line="6"/>
45
<ajc-test dir="harness"
46
title="pass 2 error, with filenames">
47
<compile files="ErrorTest.java">
48
<message kind="error" line="5" file="ErrorTest.java"/>
49
<message kind="error" line="6" file="ErrorTest.java"/>
53
<ajc-test dir="harness"
54
title="fail 2 error, with 1 bad filename"
55
keywords="expect-fail">
56
<compile files="ErrorTest.java">
57
<message kind="error" line="5" file="ErrorTest.java"/>
58
<message kind="error" line="6" file="ErrorTest2.java"/>
62
<ajc-test dir="harness"
63
title="fail 2 error, with 2 bad filename"
64
keywords="expect-fail">
65
<compile files="ErrorTest.java">
66
<message kind="error" line="5" file="ErrorTest3.java"/>
67
<message kind="error" line="6" file="ErrorTest2.java"/>
71
<ajc-test dir="harness"
72
title="fail 2 error, three expected"
73
keywords="expect-fail">
74
<compile files="ErrorTest.java">
75
<message kind="error" line="5"/>
76
<message kind="error" line="6"/>
77
<message kind="error" line="8"/>
81
<ajc-test dir="harness"
82
title="fail 2 error, one unexpected"
83
keywords="expect-fail">
84
<compile files="ErrorTest.java">
85
<message kind="error" line="6"/>
89
<ajc-test dir="harness"
90
title="fail 2 error, one with with error line wrong"
91
keywords="expect-fail">
92
<compile files="ErrorTest.java">
93
<message kind="error" line="5"/>
94
<message kind="error" line="7" text="Wrong line number"/>
98
<ajc-test dir="harness"
99
title="fail 2 error, one with with kind wrong"
100
keywords="expect-fail">
101
<compile files="ErrorTest.java">
102
<message kind="error" line="5"/>
103
<message kind="warning" line="6"/>
107
<ajc-test dir="harness"
108
title="pass 1 warning">
109
<compile files="WarningTest.java">
110
<message kind="warning" line="14"/>
114
<ajc-test dir="harness"
115
title="fail 1 warning with kind wrong"
116
keywords="expect-fail">
117
<compile files="WarningTest.java">
118
<message kind="error" line="14"/>
122
<ajc-test dir="harness"
123
title="fail 1 warning with line wrong"
124
keywords="expect-fail">
125
<compile files="WarningTest.java">
126
<message kind="warning" line="15"/>
130
<ajc-test dir="harness"
131
title="fail checks and events, failed to specify 6 expected fails"
132
keywords="expect-fail">
133
<compile files="TestTesterFail.java"/>
134
<run class="TestTesterFail"/>
137
<ajc-test dir="harness"
138
title="fail one missing note"
139
keywords="expect-fail">
140
<compile files="TesterNotesFail.java"/>
141
<run class="TesterNotesFail"/>
144
<ajc-test dir="harness"
145
title="pass checks and events, all should pass">
146
<compile files="TestTester.java"/>
147
<run class="TestTester"/>
150
<ajc-test dir="harness"
151
title="pass event files">
152
<compile files="TestTesterFile.java"/>
153
<run class="TestTesterFile"/>
156
<ajc-test dir="harness"
157
title="pass compile and run, no tester required">
158
<compile files="TestNoTester.java"/>
159
<run class="TestNoTester" skipTester="true"/>
162
<ajc-test dir="harness/classpathTest"
163
title="pass specify jars and directories on classpath"
165
<compile classpath="classesDir,jars/required.jar"
170
<ajc-test dir="harness/classpathTest"
171
title="pass specify aspectpath and classpath jars and directories">
172
<compile classpath="classesDir,jars/required.jar"
173
aspectpath="jars/requiredAspects.jar"
174
files="AspectMain.java"/>
175
<run class="AspectMain"/>
178
<ajc-test dir="harness/classpathTest"
179
title="pass pure binary weaving, with jars/dir on classpath"
181
<compile classpath="classesDir,jars/required.jar"
184
<compile classpath="classesDir,jars/required.jar"
185
aspectpath="jars/requiredAspects.jar,jars/AspectMain.jar"
190
<ajc-test dir="harness" keywords="incremental-test"
191
title="pass minimal purejava sourceroots test">
192
<compile sourceroots="sourceroot"/>
193
<run class="packageOne.Main"/>
196
<ajc-test dir="harness" keywords="incremental-test"
197
title="pass test of dual sourceroots with aspects">
198
<compile sourceroots="sourceroot,sourceroot2"/>
199
<run class="packageOne.Main"/>
202
<ajc-test dir="harness" keywords="incremental-test"
203
title="pass minimal incremental purejava sourceroots test"
204
comment="inc-22 generates new event, expected after">
205
<compile options="-incremental"
206
sourceroots="sourceroot-inc"/>
207
<run class="packageOne.Main"/>
208
<inc-compile tag="22"/>
209
<run class="packageOne.Main"
210
options="new-event"/>
213
<ajc-test dir="harness" keywords="incremental-test"
214
title="pass rebuild minimal incremental purejava sourceroots test"
215
comment="inc-22 generates new event, expected after">
216
<compile options="-incremental"
217
sourceroots="sourceroot-inc"/>
218
<run class="packageOne.Main"/>
219
<inc-compile tag="22"/>
220
<run class="packageOne.Main"
221
options="new-event"/>
223
<compile options="-incremental"
225
sourceroots="sourceroot-inc"/>
226
<run class="packageOne.Main"/>
227
<inc-compile tag="22"/>
228
<run class="packageOne.Main"
229
options="new-event"/>
232
<ajc-test dir="harness" keywords="incremental-test"
233
title="pass rebuild fresh-same minimal incremental purejava sourceroots test"
234
comment="inc-22 generates new event, expected after">
235
<compile options="-incremental"
236
sourceroots="sourceroot-inc"/>
237
<run class="packageOne.Main"/>
238
<inc-compile tag="22"/>
239
<run class="packageOne.Main"
240
options="new-event"/>
242
<inc-compile tag="same" fresh="true" />
243
<run class="packageOne.Main"
244
options="new-event"/>
247
<ajc-test dir="harness" keywords="incremental-test"
248
title="pass rebuild fresh-updated minimal incremental purejava sourceroots test"
249
comment="inc-22 generates new event, expected after">
250
<compile options="-incremental"
251
sourceroots="sourceroot-inc"/>
252
<run class="packageOne.Main"/>
254
<inc-compile tag="22" fresh="true" />
255
<run class="packageOne.Main"
256
options="new-event"/>
259
<ajc-test dir="incremental/stringliteral"
260
keywords="incremental-test,fixme"
261
title="pass incrementally change only string literal size">
262
<compile staging="true" options="-incremental"
264
<run class="packageOne.Main"
265
options="in packageOne.Main.main(..),
266
before main packageOne.Main"/>
267
<inc-compile tag="20">
268
<dir-changes delay="2000" updated="packageOne.Main"/>
270
<run class="packageOne.Main"
271
options="in longer packageOne.Main.main(..),
272
before main packageOne.Main"/>
275
<ajc-test dir="incremental/defaultPackage/src"
276
title="pass test using prior classes">
277
<compile files="lib/Lib.java"/>
278
<run class="lib.Lib"/>
279
<compile files="Main.java" includeClassesDir="true"/>
283
<ajc-test dir="incremental/interPackage/src"
284
title="pass test using prior classes (inter-package)">
285
<compile files="lib/Lib.java"/>
286
<run class="lib.Lib"/>
287
<compile files="app/Main.java" includeClassesDir="true"/>
288
<run class="app.Main"/>
291
<ajc-test dir="harness/systemExit"
292
title="pass System exit 0">
293
<compile files="SystemExit.java"/>
294
<run class="SystemExit"/>
296
<ajc-test dir="harness/systemExit"
297
keywords="expect-fail"
298
title="fail System exit 1">
299
<compile files="SystemExit.java"/>
300
<run class="SystemExit" options="1"/>
303
<ajc-test dir="harness/systemExit"
304
keywords="expect-fail"
305
title="fail System exit -1">
306
<compile files="SystemExit.java"/>
307
<run class="SystemExit" options="-1"/>
310
<ajc-test dir="harness/inpath"
311
title="pass test inpath option - valid">
312
<compile files="input-path-classes" sourceroots="aspectsrc"/>
317
<ajc-test dir="harness"
318
comment="Expect two warnings when compiling -1.3"
319
title="pass 2 compound warning -1.3">
320
<compile files="CompoundMessage.java" options="-1.3">
321
<message kind="warning" line="6">
322
<source line="14" file="CompoundMessage.java"/>
324
<message kind="warning" line="6">
325
<source line="12" file="CompoundMessage.java"/>
330
<ajc-test dir="harness"
331
comment="Expect no warnings when compiling -1.4"
332
title="pass 2 compound warning -1.4">
333
<compile files="CompoundMessage.java" options="-1.4"/>
336
<ajc-test dir="harness/xlintfile"
337
title="pass default xlintfile">
338
<compile files="TypeNotExposed.java">
339
<message kind="warning" line="4" text="xpose"/>
343
<ajc-test dir="harness/xlintfile"
344
title="pass xlintfile promotes to error">
345
<compile files="TypeNotExposed.java"
346
xlintfile="tneError.properties">
347
<message kind="error" line="4" text="xpose"/>
351
<ajc-test dir="harness/xlintfile"
352
title="pass xlintfile demotes to ignore">
353
<compile files="TypeNotExposed.java"
354
xlintfile="tneIgnore.properties"/>
357
<ajc-test dir="harness"
358
keywords="expect-fail"
359
title="fail 2 error, but expecting more details">
360
<compile files="ErrorTest.java">
361
<message kind="error" line="5" details="expecting more"/>
362
<message kind="error" line="6" details="details"/>
366
<ajc-test dir="harness"
367
title="pass dir-changes: nested and static class">
368
<compile files="DirChangesTest.java">
369
<dir-changes added="DirChangesTest,DirChangesTest$Inner,DirChangesTest$Nested"/>
373
<ajc-test dir="harness"
374
keywords="expect-fail"
375
title="fail dir-changes: at end, expected file not added .. $Missing..">
376
<compile files="DirChangesTest.java">
377
<dir-changes added="DirChangesTest$Missing"/>
381
<ajc-test dir="harness/dirchanges-inc"
382
title="pass dir-changes incremental">
384
options="-incremental"
387
<dir-changes added="Unchanged,Changed"/>
389
<run class="Changed" options="first"/>
390
<inc-compile tag="20">
391
<dir-changes removed="Removed" updated="Changed"/>
393
<run class="Changed" options="second"/>
396
<ajc-test dir="harness/dirchanges-inc"
397
keywords="expect-fail"
398
title="fail dir-changes incremental: at start, did not expect added file to exist: {added==}Changed.class">
400
options="-incremental"
403
<inc-compile tag="20">
404
<dir-changes added="Changed"/>
408
<ajc-test dir="harness/dirchanges-inc"
409
keywords="expect-fail"
410
title="fail dir-changes incremental: at start, expected removed file to exist: {removed==}Missing.class">
412
options="-incremental"
415
<dir-changes removed="Missing"/>
419
<ajc-test dir="harness/dirchanges-inc"
420
keywords="expect-fail"
421
title="fail dir-changes incremental: at start, expected updated file to exist: {updated==}Missing.class">
423
options="-incremental"
426
<dir-changes updated="Missing"/>
430
<ajc-test dir="harness/dirchanges-inc"
431
keywords="expect-fail"
432
title="fail dir-changes incremental: at end, expected added file to exist: {added==}Missing.class">
434
options="-incremental"
437
<dir-changes added="Missing"/>
441
<ajc-test dir="harness/dirchanges-inc"
442
keywords="expect-fail"
443
title="fail dir-changes incremental: at end, did not expect removed file to exist: {removed==}Changed.class">
445
options="-incremental"
448
<inc-compile tag="20">
449
<dir-changes removed="Changed"/>
453
<ajc-test dir="harness/dirchanges-inc"
454
keywords="expect-fail"
455
title="fail dir-changes incremental: at end, expected updated file to exist: {updated==}Removed.class">
457
options="-incremental"
460
<inc-compile tag="20">
461
<dir-changes updated="Removed"/>
465
<ajc-test dir="harness"
466
keywords="expect-fail"
467
title="fail not forking or setting property">
468
<compile files="SystemPropertiesTest.java"/>
469
<run class="SystemPropertiesTest" fork="false"/>
472
<ajc-test dir="harness"
473
keywords="expect-fail"
474
title="fail fork without setting property">
475
<compile files="SystemPropertiesTest.java"/>
476
<run class="SystemPropertiesTest" fork="true"/>
479
<ajc-test dir="harness"
480
title="pass fork and set property">
481
<compile files="SystemPropertiesTest.java"/>
482
<run class="SystemPropertiesTest"
484
vmargs="-DPASS=true,-Dname=value"/>
487
<ajc-test dir="harness/fork"
488
title="pass fork verify Main runs">
489
<compile files="MainWriter.java"/>
490
<run class="MainWriter" fork="true"/>
493
<ajc-test dir="harness/fork"
494
title="pass spoon verify Main runs">
495
<compile files="MainWriter.java"/>
496
<run class="MainWriter"/>
499
<ajc-test dir="harness/fork"
500
keywords="expect-fail"
501
title="fail fork-err-detected Main runs, uses System.err, fails on err">
502
<compile files="MainWriter.java"/>
503
<run class="MainWriter" options="err" fork="true"/>
506
<ajc-test dir="harness/fork"
507
title="pass fork-err-ignored Main runs, uses System.err, err ignored">
508
<compile files="MainWriter.java"/>
509
<run class="MainWriter" options="err" fork="true" errStreamIsError="false"/>
512
<ajc-test dir="harness/fork"
513
keywords="expect-fail"
514
title="fail fork-out-detected Main runs, uses System.out, fails on out">
515
<compile files="MainWriter.java"/>
516
<run class="MainWriter" options="out" fork="true" outStreamIsError="true"/>
519
<ajc-test dir="harness/fork"
520
title="pass fork-out-ignored Main runs, uses System.out, out ignored">
521
<compile files="MainWriter.java"/>
522
<run class="MainWriter" options="out" fork="true" outStreamIsError="false"/>
525
<ajc-test dir="harness/fork"
526
keywords="expect-fail"
527
title="fail fork-Error-detected Main runs, throws Error, fails on Error">
528
<compile files="MainWriter.java"/>
529
<run class="MainWriter" options="Error" fork="true" />
532
<ajc-test dir="harness/fork"
533
title="pass fork-Error-ignored Main runs, throws Error, expects Error">
534
<compile files="MainWriter.java"/>
535
<run class="MainWriter" options="Error" fork="true" exception="Error"/>
538
<ajc-test dir="harness/fork"
539
keywords="expect-fail"
540
title="fail fork-Error-missed Main runs, does not throws Error, expects Error">
541
<compile files="MainWriter.java"/>
542
<run class="MainWriter" fork="true" exception="Error"/>
545
<ajc-test dir="harness/fork"
546
keywords="expect-fail"
547
title="fail spoon-err-detected Main runs, uses System.err, fails on err">
548
<compile files="MainWriter.java"/>
549
<run class="MainWriter" options="err" />
552
<ajc-test dir="harness/fork"
553
title="pass spoon-err-ignored Main runs, uses System.err, err ignored">
554
<compile files="MainWriter.java"/>
555
<run class="MainWriter" options="err" errStreamIsError="false"/>
557
<ajc-test dir="harness/fork"
558
keywords="expect-fail"
559
title="fail spoon-out-detected Main runs, uses System.out, fails on out">
560
<compile files="MainWriter.java"/>
561
<run class="MainWriter" options="out" outStreamIsError="true"/>
564
<ajc-test dir="harness/fork"
565
title="pass spoon-out-ignored Main runs, uses System.out, out ignored">
566
<compile files="MainWriter.java"/>
567
<run class="MainWriter" options="out" outStreamIsError="false"/>
570
<ajc-test dir="harness/fork"
571
keywords="expect-fail"
572
title="fail spoon-Error-detected Main runs, throws Error, fails on Error">
573
<compile files="MainWriter.java"/>
574
<run class="MainWriter" options="Error"/>
577
<ajc-test dir="harness/fork"
578
title="pass spoon-Error-ignored Main runs, throws Error, expects Error">
579
<compile files="MainWriter.java"/>
580
<run class="MainWriter" options="Error" exception="Error"/>
583
<ajc-test dir="harness/fork"
584
keywords="expect-fail"
585
title="fail spoon-Error-missed Main runs, does not throws Error, expects Error">
586
<compile files="MainWriter.java"/>
587
<run class="MainWriter" exception="Error"/>
590
<ajc-test dir="harness/aspectpath"
591
keywords="expect-fail"
592
title="fail ltw-base Main fails without aspect">
593
<compile files="Main.java"/>
597
<ajc-test dir="harness/aspectpath"
598
title="pass ltw-base Main fails without aspect (expected)">
599
<compile files="Main.java"/>
600
<run class="Main" exception="Error"/>
603
<ajc-test dir="harness/aspectpath"
604
title="pass ltw-base Main works with aspect">
605
<compile files="A.java,Main.java"/>
609
<ajc-test dir="harness/aspectpath"
610
title="pass ltw-jarAspectpath">
611
<compile files="A.java" outjar="out.jar"/>
612
<compile files="Main.java"/>
613
<run class="Main" aspectpath="out.jar"/>
616
<ajc-test dir="harness/aspectpath"
617
title="pass ltw-jarAspectpath-jarClasspath">
618
<compile files="A.java" outjar="out.jar"/>
619
<compile files="Main.java" outjar="cl.zip"/>
620
<run class="Main" aspectpath="out.jar" classpath="cl.zip"/>
625
reproduce hang from blocking IO read at JavaRun.java
626
<ajc-test dir="harness/fork"
627
title="pass fork-Error-ignored Main runs, throws Error, expects Error">
628
<compile files="MainWriter.java"/>
629
<run class="MainWriter" options="Error" fork="true" exception="Error"/>
633
unforked exception check is failing.
634
Also forked/unforked throw different exceptions
636
<ajc-test dir="harness/classpathTest"
637
title="pass specify jars and directories on classpath"
639
<compile classpath="classesDir,jars/required.jar"
643
<run class="Main" fork="true" exception="NoClassDefFoundError"/>
644
<run class="Main" fork="false" exception="java.lang.ClassNotFoundException"/>
645
<run class="Main" classpath="main.zip"/>
646
<compile classpath="classesDir,jars/required.jar"