123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655 |
-
- <!DOCTYPE suite SYSTEM "../tests/ajcTestSuite.dtd">
-
- <!--
- To log unexpected results, run
- with -logPass -ajctestRequireKeywords=expect-fail
- or with -logFail -ajctestSkipKeywords=expect-fail
-
- You can also run using -traceTestsMin and scan for
- unexpected results:
-
- FAIL pass {title..} # expect pass, actual fail
- PASS fail {title..} # expect fail, actual pass
-
- Also pick out "incremental-test" keyword for incremental tests.
-
- Variant tests below:
- - [fork|spoon]-[out|err|Error]-[detected|ignored]
- - ltw-[base|jarAspectpath{-jarClasspath}]
-
- Issues:
- - harness not stopping after unexpected-fails completes.
- When exception thrown, everything cleaned up?
-
- -->
- <suite>
- <!-- disabled so skipping expect-fail causes all to pass
- (error emitted before test is skipped)
-
- <ajc-test dir="noSuchDir"
- title="fail no such directory - report as error (AjcTest specification)"
- keywords="expect-fail">
- <compile files="NoSuchFile.java"/>
- </ajc-test>
- -->
-
- <ajc-test dir="harness"
- title="pass 2 error">
- <compile files="ErrorTest.java">
- <message kind="error" line="5"/>
- <message kind="error" line="6"/>
- </compile>
- </ajc-test>
-
- <ajc-test dir="harness"
- title="pass 2 error, with filenames">
- <compile files="ErrorTest.java">
- <message kind="error" line="5" file="ErrorTest.java"/>
- <message kind="error" line="6" file="ErrorTest.java"/>
- </compile>
- </ajc-test>
-
- <ajc-test dir="harness"
- title="fail 2 error, with 1 bad filename"
- keywords="expect-fail">
- <compile files="ErrorTest.java">
- <message kind="error" line="5" file="ErrorTest.java"/>
- <message kind="error" line="6" file="ErrorTest2.java"/>
- </compile>
- </ajc-test>
-
- <ajc-test dir="harness"
- title="fail 2 error, with 2 bad filename"
- keywords="expect-fail">
- <compile files="ErrorTest.java">
- <message kind="error" line="5" file="ErrorTest3.java"/>
- <message kind="error" line="6" file="ErrorTest2.java"/>
- </compile>
- </ajc-test>
-
- <ajc-test dir="harness"
- title="fail 2 error, three expected"
- keywords="expect-fail">
- <compile files="ErrorTest.java">
- <message kind="error" line="5"/>
- <message kind="error" line="6"/>
- <message kind="error" line="8"/>
- </compile>
- </ajc-test>
-
- <ajc-test dir="harness"
- title="fail 2 error, one unexpected"
- keywords="expect-fail">
- <compile files="ErrorTest.java">
- <message kind="error" line="6"/>
- </compile>
- </ajc-test>
-
- <ajc-test dir="harness"
- title="fail 2 error, one with with error line wrong"
- keywords="expect-fail">
- <compile files="ErrorTest.java">
- <message kind="error" line="5"/>
- <message kind="error" line="7" text="Wrong line number"/>
- </compile>
- </ajc-test>
-
- <ajc-test dir="harness"
- title="fail 2 error, one with with kind wrong"
- keywords="expect-fail">
- <compile files="ErrorTest.java">
- <message kind="error" line="5"/>
- <message kind="warning" line="6"/>
- </compile>
- </ajc-test>
-
- <ajc-test dir="harness"
- title="pass 1 warning">
- <compile files="WarningTest.java">
- <message kind="warning" line="14"/>
- </compile>
- </ajc-test>
-
- <ajc-test dir="harness"
- title="fail 1 warning with kind wrong"
- keywords="expect-fail">
- <compile files="WarningTest.java">
- <message kind="error" line="14"/>
- </compile>
- </ajc-test>
-
- <ajc-test dir="harness"
- title="fail 1 warning with line wrong"
- keywords="expect-fail">
- <compile files="WarningTest.java">
- <message kind="warning" line="15"/>
- </compile>
- </ajc-test>
-
- <ajc-test dir="harness"
- title="fail checks and events, failed to specify 6 expected fails"
- keywords="expect-fail">
- <compile files="TestTesterFail.java"/>
- <run class="TestTesterFail"/>
- </ajc-test>
-
- <ajc-test dir="harness"
- title="fail one missing note"
- keywords="expect-fail">
- <compile files="TesterNotesFail.java"/>
- <run class="TesterNotesFail"/>
- </ajc-test>
-
- <ajc-test dir="harness"
- title="pass checks and events, all should pass">
- <compile files="TestTester.java"/>
- <run class="TestTester"/>
- </ajc-test>
-
- <ajc-test dir="harness"
- title="pass event files">
- <compile files="TestTesterFile.java"/>
- <run class="TestTesterFile"/>
- </ajc-test>
-
- <ajc-test dir="harness"
- title="pass compile and run, no tester required">
- <compile files="TestNoTester.java"/>
- <run class="TestNoTester" skipTester="true"/>
- </ajc-test>
-
- <ajc-test dir="harness/classpathTest"
- title="pass specify jars and directories on classpath"
- keywords="purejava">
- <compile classpath="classesDir,jars/required.jar"
- files="Main.java"/>
- <run class="Main"/>
- </ajc-test>
-
- <ajc-test dir="harness/classpathTest"
- title="pass specify aspectpath and classpath jars and directories">
- <compile classpath="classesDir,jars/required.jar"
- aspectpath="jars/requiredAspects.jar"
- files="AspectMain.java"/>
- <run class="AspectMain"/>
- </ajc-test>
-
- <ajc-test dir="harness/classpathTest"
- title="pass pure binary weaving, with jars/dir on classpath"
- keywords="purejava">
- <compile classpath="classesDir,jars/required.jar"
- files="Main.java"
- outjar="main.zip"/>
- <compile classpath="classesDir,jars/required.jar"
- aspectpath="jars/requiredAspects.jar,jars/AspectMain.jar"
- files="main.zip"/>
- <run class="Main"/>
- </ajc-test>
-
- <ajc-test dir="harness" keywords="incremental-test"
- title="pass minimal purejava sourceroots test">
- <compile sourceroots="sourceroot"/>
- <run class="packageOne.Main"/>
- </ajc-test>
-
- <ajc-test dir="harness" keywords="incremental-test"
- title="pass test of dual sourceroots with aspects">
- <compile sourceroots="sourceroot,sourceroot2"/>
- <run class="packageOne.Main"/>
- </ajc-test>
-
- <ajc-test dir="harness" keywords="incremental-test"
- title="pass minimal incremental purejava sourceroots test"
- comment="inc-22 generates new event, expected after">
- <compile options="-incremental"
- sourceroots="sourceroot-inc"/>
- <run class="packageOne.Main"/>
- <inc-compile tag="22"/>
- <run class="packageOne.Main"
- options="new-event"/>
- </ajc-test>
-
- <ajc-test dir="harness" keywords="incremental-test"
- title="pass rebuild minimal incremental purejava sourceroots test"
- comment="inc-22 generates new event, expected after">
- <compile options="-incremental"
- sourceroots="sourceroot-inc"/>
- <run class="packageOne.Main"/>
- <inc-compile tag="22"/>
- <run class="packageOne.Main"
- options="new-event"/>
-
- <compile options="-incremental"
- reuseCompiler="true"
- sourceroots="sourceroot-inc"/>
- <run class="packageOne.Main"/>
- <inc-compile tag="22"/>
- <run class="packageOne.Main"
- options="new-event"/>
- </ajc-test>
-
- <ajc-test dir="harness" keywords="incremental-test"
- title="pass rebuild fresh-same minimal incremental purejava sourceroots test"
- comment="inc-22 generates new event, expected after">
- <compile options="-incremental"
- sourceroots="sourceroot-inc"/>
- <run class="packageOne.Main"/>
- <inc-compile tag="22"/>
- <run class="packageOne.Main"
- options="new-event"/>
-
- <inc-compile tag="same" fresh="true" />
- <run class="packageOne.Main"
- options="new-event"/>
- </ajc-test>
-
- <ajc-test dir="harness" keywords="incremental-test"
- title="pass rebuild fresh-updated minimal incremental purejava sourceroots test"
- comment="inc-22 generates new event, expected after">
- <compile options="-incremental"
- sourceroots="sourceroot-inc"/>
- <run class="packageOne.Main"/>
-
- <inc-compile tag="22" fresh="true" />
- <run class="packageOne.Main"
- options="new-event"/>
- </ajc-test>
-
- <ajc-test dir="incremental/stringliteral"
- keywords="incremental-test,fixme"
- title="pass incrementally change only string literal size">
- <compile staging="true" options="-incremental"
- sourceroots="src"/>
- <run class="packageOne.Main"
- options="in packageOne.Main.main(..),
- before main packageOne.Main"/>
- <inc-compile tag="20">
- <dir-changes delay="2000" updated="packageOne.Main"/>
- </inc-compile>
- <run class="packageOne.Main"
- options="in longer packageOne.Main.main(..),
- before main packageOne.Main"/>
- </ajc-test>
-
- <ajc-test dir="incremental/defaultPackage/src"
- title="pass test using prior classes">
- <compile files="lib/Lib.java"/>
- <run class="lib.Lib"/>
- <compile files="Main.java" includeClassesDir="true"/>
- <run class="Main"/>
- </ajc-test>
-
- <ajc-test dir="incremental/interPackage/src"
- title="pass test using prior classes (inter-package)">
- <compile files="lib/Lib.java"/>
- <run class="lib.Lib"/>
- <compile files="app/Main.java" includeClassesDir="true"/>
- <run class="app.Main"/>
- </ajc-test>
-
- <ajc-test dir="harness/systemExit"
- title="pass System exit 0">
- <compile files="SystemExit.java"/>
- <run class="SystemExit"/>
- </ajc-test>
- <ajc-test dir="harness/systemExit"
- keywords="expect-fail"
- title="fail System exit 1">
- <compile files="SystemExit.java"/>
- <run class="SystemExit" options="1"/>
- </ajc-test>
-
- <ajc-test dir="harness/systemExit"
- keywords="expect-fail"
- title="fail System exit -1">
- <compile files="SystemExit.java"/>
- <run class="SystemExit" options="-1"/>
- </ajc-test>
-
- <ajc-test dir="harness/inpath"
- title="pass test inpath option - valid">
- <compile files="input-path-classes" sourceroots="aspectsrc"/>
- <run class="Main"/>
- </ajc-test>
-
-
- <ajc-test dir="harness"
- comment="Expect two warnings when compiling -1.3"
- title="pass 2 compound warning -1.3">
- <compile files="CompoundMessage.java" options="-1.3">
- <message kind="warning" line="6">
- <source line="14" file="CompoundMessage.java"/>
- </message>
- <message kind="warning" line="6">
- <source line="12" file="CompoundMessage.java"/>
- </message>
- </compile>
- </ajc-test>
-
- <ajc-test dir="harness"
- comment="Expect no warnings when compiling -1.4"
- title="pass 2 compound warning -1.4">
- <compile files="CompoundMessage.java" options="-1.4"/>
- </ajc-test>
-
- <ajc-test dir="harness/xlintfile"
- title="pass default xlintfile">
- <compile files="TypeNotExposed.java">
- <message kind="warning" line="4" text="xpose"/>
- </compile>
- </ajc-test>
-
- <ajc-test dir="harness/xlintfile"
- title="pass xlintfile promotes to error">
- <compile files="TypeNotExposed.java"
- xlintfile="tneError.properties">
- <message kind="error" line="4" text="xpose"/>
- </compile>
- </ajc-test>
-
- <ajc-test dir="harness/xlintfile"
- title="pass xlintfile demotes to ignore">
- <compile files="TypeNotExposed.java"
- xlintfile="tneIgnore.properties"/>
- </ajc-test>
-
- <ajc-test dir="harness"
- keywords="expect-fail"
- title="fail 2 error, but expecting more details">
- <compile files="ErrorTest.java">
- <message kind="error" line="5" details="expecting more"/>
- <message kind="error" line="6" details="details"/>
- </compile>
- </ajc-test>
-
- <ajc-test dir="harness"
- title="pass dir-changes: nested and static class">
- <compile files="DirChangesTest.java">
- <dir-changes added="DirChangesTest,DirChangesTest$Inner,DirChangesTest$Nested"/>
- </compile>
- </ajc-test>
-
- <ajc-test dir="harness"
- keywords="expect-fail"
- title="fail dir-changes: at end, expected file not added .. $Missing..">
- <compile files="DirChangesTest.java">
- <dir-changes added="DirChangesTest$Missing"/>
- </compile>
- </ajc-test>
-
- <ajc-test dir="harness/dirchanges-inc"
- title="pass dir-changes incremental">
- <compile
- options="-incremental"
- staging="true"
- sourceroots="src">
- <dir-changes added="Unchanged,Changed"/>
- </compile>
- <run class="Changed" options="first"/>
- <inc-compile tag="20">
- <dir-changes removed="Removed" updated="Changed"/>
- </inc-compile>
- <run class="Changed" options="second"/>
- </ajc-test>
-
- <ajc-test dir="harness/dirchanges-inc"
- keywords="expect-fail"
- title="fail dir-changes incremental: at start, did not expect added file to exist: {added==}Changed.class">
- <compile
- options="-incremental"
- staging="true"
- sourceroots="src"/>
- <inc-compile tag="20">
- <dir-changes added="Changed"/>
- </inc-compile>
- </ajc-test>
-
- <ajc-test dir="harness/dirchanges-inc"
- keywords="expect-fail"
- title="fail dir-changes incremental: at start, expected removed file to exist: {removed==}Missing.class">
- <compile
- options="-incremental"
- staging="true"
- sourceroots="src">
- <dir-changes removed="Missing"/>
- </compile>
- </ajc-test>
-
- <ajc-test dir="harness/dirchanges-inc"
- keywords="expect-fail"
- title="fail dir-changes incremental: at start, expected updated file to exist: {updated==}Missing.class">
- <compile
- options="-incremental"
- staging="true"
- sourceroots="src">
- <dir-changes updated="Missing"/>
- </compile>
- </ajc-test>
-
- <ajc-test dir="harness/dirchanges-inc"
- keywords="expect-fail"
- title="fail dir-changes incremental: at end, expected added file to exist: {added==}Missing.class">
- <compile
- options="-incremental"
- staging="true"
- sourceroots="src">
- <dir-changes added="Missing"/>
- </compile>
- </ajc-test>
-
- <ajc-test dir="harness/dirchanges-inc"
- keywords="expect-fail"
- title="fail dir-changes incremental: at end, did not expect removed file to exist: {removed==}Changed.class">
- <compile
- options="-incremental"
- staging="true"
- sourceroots="src"/>
- <inc-compile tag="20">
- <dir-changes removed="Changed"/>
- </inc-compile>
- </ajc-test>
-
- <ajc-test dir="harness/dirchanges-inc"
- keywords="expect-fail"
- title="fail dir-changes incremental: at end, expected updated file to exist: {updated==}Removed.class">
- <compile
- options="-incremental"
- staging="true"
- sourceroots="src"/>
- <inc-compile tag="20">
- <dir-changes updated="Removed"/>
- </inc-compile>
- </ajc-test>
-
- <ajc-test dir="harness"
- keywords="expect-fail"
- title="fail not forking or setting property">
- <compile files="SystemPropertiesTest.java"/>
- <run class="SystemPropertiesTest" fork="false"/>
- </ajc-test>
-
- <ajc-test dir="harness"
- keywords="expect-fail"
- title="fail fork without setting property">
- <compile files="SystemPropertiesTest.java"/>
- <run class="SystemPropertiesTest" fork="true"/>
- </ajc-test>
-
- <ajc-test dir="harness"
- title="pass fork and set property">
- <compile files="SystemPropertiesTest.java"/>
- <run class="SystemPropertiesTest"
- fork="true"
- vmargs="-DPASS=true,-Dname=value"/>
- </ajc-test>
-
- <ajc-test dir="harness/fork"
- title="pass fork verify Main runs">
- <compile files="MainWriter.java"/>
- <run class="MainWriter" fork="true"/>
- </ajc-test>
-
- <ajc-test dir="harness/fork"
- title="pass spoon verify Main runs">
- <compile files="MainWriter.java"/>
- <run class="MainWriter"/>
- </ajc-test>
-
- <ajc-test dir="harness/fork"
- keywords="expect-fail"
- title="fail fork-err-detected Main runs, uses System.err, fails on err">
- <compile files="MainWriter.java"/>
- <run class="MainWriter" options="err" fork="true"/>
- </ajc-test>
-
- <ajc-test dir="harness/fork"
- title="pass fork-err-ignored Main runs, uses System.err, err ignored">
- <compile files="MainWriter.java"/>
- <run class="MainWriter" options="err" fork="true" errStreamIsError="false"/>
- </ajc-test>
-
- <ajc-test dir="harness/fork"
- keywords="expect-fail"
- title="fail fork-out-detected Main runs, uses System.out, fails on out">
- <compile files="MainWriter.java"/>
- <run class="MainWriter" options="out" fork="true" outStreamIsError="true"/>
- </ajc-test>
-
- <ajc-test dir="harness/fork"
- title="pass fork-out-ignored Main runs, uses System.out, out ignored">
- <compile files="MainWriter.java"/>
- <run class="MainWriter" options="out" fork="true" outStreamIsError="false"/>
- </ajc-test>
-
- <ajc-test dir="harness/fork"
- keywords="expect-fail"
- title="fail fork-Error-detected Main runs, throws Error, fails on Error">
- <compile files="MainWriter.java"/>
- <run class="MainWriter" options="Error" fork="true" />
- </ajc-test>
-
- <ajc-test dir="harness/fork"
- title="pass fork-Error-ignored Main runs, throws Error, expects Error">
- <compile files="MainWriter.java"/>
- <run class="MainWriter" options="Error" fork="true" exception="Error"/>
- </ajc-test>
-
- <ajc-test dir="harness/fork"
- keywords="expect-fail"
- title="fail fork-Error-missed Main runs, does not throws Error, expects Error">
- <compile files="MainWriter.java"/>
- <run class="MainWriter" fork="true" exception="Error"/>
- </ajc-test>
-
- <ajc-test dir="harness/fork"
- keywords="expect-fail"
- title="fail spoon-err-detected Main runs, uses System.err, fails on err">
- <compile files="MainWriter.java"/>
- <run class="MainWriter" options="err" />
- </ajc-test>
-
- <ajc-test dir="harness/fork"
- title="pass spoon-err-ignored Main runs, uses System.err, err ignored">
- <compile files="MainWriter.java"/>
- <run class="MainWriter" options="err" errStreamIsError="false"/>
- </ajc-test>
- <ajc-test dir="harness/fork"
- keywords="expect-fail"
- title="fail spoon-out-detected Main runs, uses System.out, fails on out">
- <compile files="MainWriter.java"/>
- <run class="MainWriter" options="out" outStreamIsError="true"/>
- </ajc-test>
-
- <ajc-test dir="harness/fork"
- title="pass spoon-out-ignored Main runs, uses System.out, out ignored">
- <compile files="MainWriter.java"/>
- <run class="MainWriter" options="out" outStreamIsError="false"/>
- </ajc-test>
-
- <ajc-test dir="harness/fork"
- keywords="expect-fail"
- title="fail spoon-Error-detected Main runs, throws Error, fails on Error">
- <compile files="MainWriter.java"/>
- <run class="MainWriter" options="Error"/>
- </ajc-test>
-
- <ajc-test dir="harness/fork"
- title="pass spoon-Error-ignored Main runs, throws Error, expects Error">
- <compile files="MainWriter.java"/>
- <run class="MainWriter" options="Error" exception="Error"/>
- </ajc-test>
-
- <ajc-test dir="harness/fork"
- keywords="expect-fail"
- title="fail spoon-Error-missed Main runs, does not throws Error, expects Error">
- <compile files="MainWriter.java"/>
- <run class="MainWriter" exception="Error"/>
- </ajc-test>
-
- <ajc-test dir="harness/aspectpath"
- keywords="expect-fail"
- title="fail ltw-base Main fails without aspect">
- <compile files="Main.java"/>
- <run class="Main"/>
- </ajc-test>
-
- <ajc-test dir="harness/aspectpath"
- title="pass ltw-base Main fails without aspect (expected)">
- <compile files="Main.java"/>
- <run class="Main" exception="Error"/>
- </ajc-test>
-
- <ajc-test dir="harness/aspectpath"
- title="pass ltw-base Main works with aspect">
- <compile files="A.java,Main.java"/>
- <run class="Main"/>
- </ajc-test>
-
- <ajc-test dir="harness/aspectpath"
- title="pass ltw-jarAspectpath">
- <compile files="A.java" outjar="out.jar"/>
- <compile files="Main.java"/>
- <run class="Main" aspectpath="out.jar"/>
- </ajc-test>
-
- <ajc-test dir="harness/aspectpath"
- title="pass ltw-jarAspectpath-jarClasspath">
- <compile files="A.java" outjar="out.jar"/>
- <compile files="Main.java" outjar="cl.zip"/>
- <run class="Main" aspectpath="out.jar" classpath="cl.zip"/>
- </ajc-test>
-
- <!--
-
- reproduce hang from blocking IO read at JavaRun.java
- <ajc-test dir="harness/fork"
- title="pass fork-Error-ignored Main runs, throws Error, expects Error">
- <compile files="MainWriter.java"/>
- <run class="MainWriter" options="Error" fork="true" exception="Error"/>
- </ajc-test>
-
-
- unforked exception check is failing.
- Also forked/unforked throw different exceptions
-
- <ajc-test dir="harness/classpathTest"
- title="pass specify jars and directories on classpath"
- keywords="purejava">
- <compile classpath="classesDir,jars/required.jar"
- files="Main.java"
- options=""
- outjar="main.zip"/>
- <run class="Main" fork="true" exception="NoClassDefFoundError"/>
- <run class="Main" fork="false" exception="java.lang.ClassNotFoundException"/>
- <run class="Main" classpath="main.zip"/>
- <compile classpath="classesDir,jars/required.jar"
- files="main.zip"/>
- <run class="Main"/>
- </ajc-test>
-
-
- -->
- </suite>
-
|