|
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452 |
- <!DOCTYPE suite SYSTEM "../tests/ajcTestSuite.dtd"[]>
-
- <!--
- JDK 21 (https://openjdk.org/projects/jdk/21/):
- Language features:
- JEP 430: String Templates (Preview)
- JEP 440: Record Patterns
- JEP 441: Pattern Matching for switch
- JEP 443: Unnamed Patterns and Variables (Preview)
- JEP 445: Unnamed Classes and Instance Main Methods (Preview)
- API or JVM only:
- JEP 431: Sequenced Collections
- JEP 439: Generational ZGC
- JEP 442: Foreign Function & Memory API (Third Preview)
- JEP 444: Virtual Threads
- JEP 446: Scoped Values (Preview)
- JEP 448: Vector API (Sixth Incubator)
- JEP 449: Deprecate the Windows 32-bit x86 Port for Removal
- JEP 451: Prepare to Disallow the Dynamic Loading of Agents
- JEP 452: Key Encapsulation Mechanism API
- JEP 453: Structured Concurrency (Preview)
- -->
- <suite>
-
- <!-- Java 21 final, Java 17, 18, 19, 20 preview -->
- <ajc-test dir="features1921/java21" vm="21" title="switch pattern matching preview 4 java">
- <compile files="SwitchPatternPreview4OK.java" options="-21" />
- <run class="SwitchPatternPreview4OK" vmargs="">
- <message/>
- <stdout>
- <line text="null" />
- <line text="int 123" />
- <line text="long 999" />
- <line text="double 12.340000" />
- <line text="String foo" />
- <line text="[123, foo, 999, 12.34]" />
- <line text="Non-circle" />
- <line text="Small circle" />
- <line text="Large circle" />
- <line text="Sealed sub-class A" />
- <line text="Sealed sub-class B" />
- <line text="Sealed sub-record C" />
- <line text="absolute value 1: -1" />
- <line text="other integer: 0" />
- <line text="positive integer: 42" />
- <line text="other integer: -99" />
- <line text="positive integer: 123" />
- <line text="value unavailable: null" />
- <line text="42" />
- </stdout>
- </run>
- </ajc-test>
-
- <!-- Java 21 final, Java 17, 18, 19, 20 preview -->
- <ajc-test dir="features1920/java20" vm="21" title="switch pattern matching preview 4 error">
- <compile files="SwitchPatternPreview4Error.java" options="-21">
- <!-- TODO: Add correct compiler error message, as soon as JDT Core supports it -->
- <message kind="error" file="SwitchPatternPreview4Error.java" text="This case label is dominated by one of the preceding case labels"/>
- </compile>
- </ajc-test>
-
- <!-- Java 21 final, Java 17, 18, 19, 20 preview -->
- <ajc-test dir="features1921/java21" vm="21" title="switch pattern matching preview 3 aspect">
- <compile files="SwitchPatternPreview3Aspect.aj" options="-21" />
- <run class="Application" vmargs="">
- <stdout>
- <line text="null" />
- <line text="int 123" />
- <line text="long 999" />
- <line text="double 12.340000" />
- <line text="String foo" />
- <line text="[123, foo, 999, 12.34]" />
- <line text="Non-circle" />
- <line text="Small circle" />
- <line text="Large circle" />
- <line text="Sealed sub-class A" />
- <line text="Sealed sub-class B" />
- <line text="Sealed sub-record C" />
- <line text="absolute value 1: -1" />
- <line text="other integer: 0" />
- <line text="positive integer: 42" />
- <line text="other integer: -99" />
- <line text="positive integer: 123" />
- <line text="value unavailable: null" />
- </stdout>
- </run>
- </ajc-test>
-
- <!-- Java 21 final, Java 17, 18, 19, 20 preview -->
- <ajc-test dir="features198/java17" vm="21" title="switch pattern matching error">
- <compile files="SwitchPatternError.java" options="-21">
- <!-- TODO: Add correct compiler error message, as soon as JDT Core supports it -->
- <message kind="error" file="SwitchPatternError.java" text="This case label is dominated by one of the preceding case labels"/>
- </compile>
- </ajc-test>
-
- <!-- Java 21 final, Java 17, 18, 19, 20 preview -->
- <ajc-test dir="features1919/java19" vm="21" title="switch pattern matching preview 3 error 1">
- <compile files="SwitchPatternPreview3Error1.java" options="-21">
- <!-- No more error message as of Java 21 -->
- <!--<message kind="error" file="SwitchPatternPreview3Error1.java" text="This case label is dominated by one of the preceding case labels"/>-->
- </compile>
- </ajc-test>
-
- <!-- Java 21 final, Java 17, 18, 19, 20 preview -->
- <ajc-test dir="features1919/java19" vm="21" title="switch pattern matching preview 3 error 2">
- <compile files="SwitchPatternPreview3Error2.java" options="-21">
- <!-- TODO: Add correct compiler error message, as soon as JDT Core supports it -->
- <message kind="error" file="SwitchPatternPreview3Error2.java" text="This case label is dominated by one of the preceding case labels"/>
- </compile>
- </ajc-test>
-
- <!-- Java 21 final, Java 19, 20 preview -->
- <ajc-test dir="features1919/java19" vm="21" title="record patterns">
- <compile files="RecordPatternsPreview1OK.java" options="-21"/>
- </ajc-test>
-
- <!-- Java 21 final, Java 19, 20 preview -->
- <ajc-test dir="features1919/java19" vm="21" title="record patterns error">
- <compile files="RecordPatternsPreview1Error.java" options="-21">
- <!-- https://github.com/eclipse-jdt/eclipse.jdt.core/issues/450 (fixed for preview 2 in Eclipse 2023-03, 4.27) -->
- <!--
- <message kind="error" file="RecordPatternsPreview1Error.java" text="Raw types are not allowed in record patterns"/>
- <message kind="error" file="RecordPatternsPreview1Error.java" text="Raw types are not allowed in record patterns"/>
- -->
- </compile>
- <run class="RecordPatternsPreview1Error" vmargs="">
- <stdout>
- <line text="I'm a box"/>
- <line text="I'm a box"/>
- </stdout>
- </run>
- </ajc-test>
-
- <!-- Java 21 final, Java 19, 20 preview -->
- <ajc-test dir="features1921/java21" vm="21" title="record patterns exhaustiveness 1">
- <compile files="RecordPatternsPreview1ExhaustivenessOK1.java" options="-21"/>
- <run class="RecordPatternsPreview1ExhaustivenessOK1" vmargs="">
- <stdout>
- <line text="y"/>
- <line text="a"/>
- </stdout>
- </run>
- </ajc-test>
-
- <!-- Java 21 final, Java 19, 20 preview -->
- <ajc-test dir="features1921/java21" vm="21" title="record patterns exhaustiveness aspect">
- <compile files="RecordPatternsPreview1ExhaustivenessAspect.aj" options="-21"/>
- <run class="RecordPatternsPreview1ExhaustivenessAspect" vmargs="">
- <stdout>
- <line text="y"/>
- <line text="a"/>
- <line text="Pair[x=C@000, y=D@000]"/>
- </stdout>
- </run>
- </ajc-test>
-
- <!-- Java 21 final, Java 19, 20 preview -->
- <ajc-test dir="features1919/java19" vm="21" title="record patterns aspect">
- <compile files="RecordPatternsPreview1Aspect.aj" options="-21"/>
- <run class="RecordPatternsPreview1Aspect" vmargs="">
- <stdout>
- <line text="9"/>
- <line text="14"/>
- <line text="Doing something with Point[x=2, y=7]"/>
- <line text="Upper-left color: RED"/>
- <line text="Upper-left color: RED"/>
- <line text="Upper-left x coordinate: 1"/>
- <line text="Doing something with Rectangle[upperLeft=ColoredPoint[p=Point[x=1, y=6], c=RED], lowerRight=ColoredPoint[p=Point[x=4, y=6], c=BLUE]]"/>
- </stdout>
- </run>
- </ajc-test>
-
- <!-- Java 21 final, Java 19, 20 preview -->
- <ajc-test dir="features1919/java19" vm="21" title="record patterns exhaustiveness error">
- <compile files="RecordPatternsPreview1ExhaustivenessError.java" options="-21">
- <message kind="error" file="RecordPatternsPreview1ExhaustivenessError.java" text="An enhanced switch statement should be exhaustive; a default label expected"/>
- </compile>
- </ajc-test>
-
- <!-- Java 21 final, Java 19, 20 preview -->
- <ajc-test dir="features1919/java19" vm="21" title="record patterns exhaustiveness 2">
- <compile files="RecordPatternsPreview1ExhaustivenessOK2.java" options="-21"/>
- <run class="RecordPatternsPreview1ExhaustivenessOK2" vmargs="">
- <stdout>
- <line text="Bob 12"/>
- </stdout>
- </run>
- </ajc-test>
-
- <!-- Java 21 preview -->
- <ajc-test dir="features1921/java21" vm="21" title="string patterns">
- <compile files="StringPatternsPreview1.java" options="--enable-preview -21"/>
- <run class="StringPatternsPreview1" vmargs="--enable-preview">
- <stdout ordered="yes">
- <line text="Bill Duck"/>
- <line text="10 + 20 = 30"/>
- <line text="You have a special New Year's sale discount waiting for you!"/>
- <line text="Access at 2011-11-11 11:11:11 from localhost/127.0.0.1"/>
- <line text="The file _dummy.dat does not exist"/>
- <line text="The time is 11:11:11 or roughly eleven after eleven"/>
- <line text="apples, oranges, peaches"/>
- <line text=""/>
- <line text="<html>"/>
- <line text=" <head>"/>
- <line text=" <title>My Web Page</title>"/>
- <line text=" </head>"/>
- <line text=" <body>"/>
- <line text=" <p>Hello, world</p>"/>
- <line text=" </body>"/>
- <line text="</html>"/>
- <line text=""/>
- <line text="Description Width Height Area"/>
- <line text="Alfa 17.80 31.40 558.92"/>
- <line text="Bravo 9.60 12.40 119.04"/>
- <line text="Charlie 7.10 11.23 79.73"/>
- <line text=" Total 757.69"/>
- <line text=""/>
- <line text="My name is Joan"/>
- </stdout>
- </run>
- </ajc-test>
-
- <!-- Java 21 preview -->
- <ajc-test dir="features1921/java21" vm="21" title="string patterns aspect">
- <compile files="StringPatternsPreview1Aspect.aj" options="--enable-preview -21"/>
- <run class="StringPatternsPreview1Aspect" vmargs="--enable-preview">
- <stdout ordered="yes">
- <line text="execution(void StringPatternsPreview1Aspect.main(String[]))"/>
- <line text="Bill Duck"/>
- <line text="10 + 20 = 30"/>
- <line text="You have a special New Year's sale discount waiting for you!"/>
- <line text="Access at 2011-11-11 11:11:11 from localhost/127.0.0.1"/>
- <line text="The file _dummy.dat does not exist"/>
- <line text="The time is 11:11:11 or roughly eleven after eleven"/>
- <line text="apples, oranges, peaches"/>
- <line text=""/>
- <line text="<html>"/>
- <line text=" <head>"/>
- <line text=" <title>My Web Page</title>"/>
- <line text=" </head>"/>
- <line text=" <body>"/>
- <line text=" <p>Hello, world</p>"/>
- <line text=" </body>"/>
- <line text="</html>"/>
- <line text=""/>
- <line text="Description Width Height Area"/>
- <line text="Alfa 17.80 31.40 558.92"/>
- <line text="Bravo 9.60 12.40 119.04"/>
- <line text="Charlie 7.10 11.23 79.73"/>
- <line text=" Total 757.69"/>
- <line text=""/>
- <line text="My name is Joan"/>
- </stdout>
- </run>
- </ajc-test>
-
- <!-- Java 21 preview -->
- <!-- TODO: Activate after https://github.com/eclipse-jdt/eclipse.jdt.core/issues/893 is done -->
- <ajc-test dir="features1921/java21" vm="21" title="unnamed patterns">
- <compile files="UnnamedPatternsPreview1.java" options="--enable-preview -21"/>
- <run class="UnnamedPatternsPreview1" vmargs="--enable-preview">
- <stdout ordered="yes">
- <line text="2"/>
- <line text="side effect"/>
- <line text="0"/>
- <line text="1"/>
- <line text="java.awt.Point[x=1,y=2]"/>
- <line text="java.awt.Point[x=4,y=5]"/>
- <line text="java.awt.Point[x=1,y=0]"/>
- <line text="java.awt.Point[x=4,y=0]"/>
- <line text="Bad number: 123xy"/>
- <line text="Doing something within scoped context"/>
- <line text="Closing scoped context"/>
- <line text="{ONE=NODATA, TWO=NODATA, THREE=NODATA}"/>
- </stdout>
- </run>
- </ajc-test>
-
- <!-- Java 21 preview -->
- <!-- TODO: Activate after https://github.com/eclipse-jdt/eclipse.jdt.core/issues/893 is done -->
- <ajc-test dir="features1921/java21" vm="21" title="unnamed patterns aspect">
- <compile files="UnnamedPatternsPreview1Aspect.aj" options="--enable-preview -21"/>
- <run class="UnnamedPatternsPreview1Aspect" vmargs="--enable-preview">
- <stdout ordered="yes">
- <line text="execution(void UnnamedPatternsPreview1Aspect.main(String[]))"/>
- <line text="2"/>
- <line text="side effect"/>
- <line text="0"/>
- <line text="1"/>
- <line text="java.awt.Point[x=1,y=2]"/>
- <line text="java.awt.Point[x=4,y=5]"/>
- <line text="java.awt.Point[x=1,y=0]"/>
- <line text="java.awt.Point[x=4,y=0]"/>
- <line text="Bad number: 123xy"/>
- <line text="Doing something within scoped context"/>
- <line text="Closing scoped context"/>
- <line text="{ONE=NODATA, TWO=NODATA, THREE=NODATA}"/>
- </stdout>
- </run>
- </ajc-test>
-
- <!-- Java 21 preview -->
- <ajc-test dir="new" vm="21" title="underscore can still be used in pointcut patterns on Java 21+ - 1">
- <compile files="NotCharInPointcut.java" options="--enable-preview -21">
- <message kind="warning" line="51" text="advice defined in A has not been applied [Xlint:adviceDidNotMatch]"/>
- <message kind="warning" line="52" text="advice defined in A has not been applied [Xlint:adviceDidNotMatch]"/>
- <message kind="warning" line="53" text="advice defined in A has not been applied [Xlint:adviceDidNotMatch]"/>
- </compile>
- <run class="NotCharInPointcut" vmargs="--enable-preview"/>
- </ajc-test>
-
- <!-- Java 21 preview -->
- <ajc-test dir="features1921/java21" vm="21" title="underscore can still be used in pointcut patterns on Java 21+ - 2">
- <compile files="UnderscoreInPointcutAspect.aj" options="--enable-preview -21"/>
- <run class="UnderscoreInPointcutAspect" vmargs="--enable-preview">
- <stdout>
- <line text="[starts with underscore] execution(int UnderTest._add(int, int)) -> 12, 4"/>
- <line text="[contains underscore] execution(int UnderTest._add(int, int)) -> 12, 4"/>
- <line text="16"/>
- <line text="[starts with underscore] execution(int UnderTest._subtract(int, int)) -> 12, 4"/>
- <line text="[contains underscore] execution(int UnderTest._subtract(int, int)) -> 12, 4"/>
- <line text="8"/>
- <line text="[ends with underscore] execution(int UnderTest.multiply_(int, int)) -> 12, 4"/>
- <line text="[contains underscore] execution(int UnderTest.multiply_(int, int)) -> 12, 4"/>
- <line text="48"/>
- <line text="[ends with underscore] execution(int UnderTest.divide_(int, int)) -> 12, 4"/>
- <line text="[contains underscore] execution(int UnderTest.divide_(int, int)) -> 12, 4"/>
- <line text="3"/>
- <line text="[contains underscore] execution(int UnderTest.power_of(int, int)) -> 3, 3"/>
- <line text="27"/>
- <line text="[no underscore] execution(int UnderTest.squareRoot(int)) -> 49"/>
- <line text="7"/>
- </stdout>
- </run>
- </ajc-test>
-
- <!-- Java 21 preview -->
- <ajc-test dir="features1921/java21" vm="21" title="named class with simple main method">
- <!-- Compiles without preview mode, but needs preview mode to run -->
- <compile files="NamedClassWithSimpleMainMethodPreview1.java" options="-21"/>
- <run class="NamedClassWithSimpleMainMethodPreview1" vmargs="--enable-preview">
- <stdout>
- <line text="Hello world!"/>
- </stdout>
- </run>
- </ajc-test>
-
- <!-- Java 21 preview -->
- <ajc-test dir="features1921/java21" vm="21" title="named aspect with simple main method">
- <!-- Compiles without preview mode, but needs preview mode to run -->
- <compile files="NamedAspectWithSimpleMainMethodPreview1.aj" options="-21"/>
- <run class="NamedAspectWithSimpleMainMethodPreview1" vmargs="--enable-preview">
- <stdout>
- <line text="Hello world!"/>
- </stdout>
- </run>
- </ajc-test>
-
- <!-- Java 21 preview -->
- <!-- TODO: Activate after https://github.com/eclipse-jdt/eclipse.jdt.core/issues/1106 is done -->
- <ajc-test dir="features1921/java21" vm="21" title="unnamed class with simple main method">
- <compile files="UnnamedClassWithSimpleMainMethodPreview1.java" options="--enable-preview -21"/>
- <run class="UnnamedClassWithSimpleMainMethodPreview1" vmargs="--enable-preview">
- <stdout>
- <line text="Hello world!"/>
- </stdout>
- </run>
- </ajc-test>
-
- <!-- https://github.com/eclipse-aspectj/aspectj/issues/279, AspectJ 1.9.21.1 -->
- <ajc-test dir="bugs1921/github_279" vm="8" title="same class woven concurrently in parallel-capable classloader">
- <compile files="Application.java Greeter.java GreeterImpl.java ParallelCapableClassLoader.java" options="-8"/>
- <compile files="HelloInterceptor.java" options="-8 -Xlint:ignore"/>
- <!-- Problem only reproduces in forked JVM with java agent, hence Ant build -->
- <ant file="ant.xml" target="same class woven concurrently in parallel-capable classloader" verbose="true"/>
- </ajc-test>
-
- <!--
- https://github.com/eclipse-aspectj/aspectj/issues/285, AspectJ 1.9.21.2
-
- See also org.aspectj.systemtest.ajc171.NewFeatures::testSharedCache. This is a quasi negative test missing back in
- 1.7.2 when the shared cache was introduced.
- -->
- <ajc-test dir="bugs1921/github_285" title="shared cache negative test">
- <compile files="Unwoven.java" options="-1.5"/>
- <run class="Unwoven" ltw="aop.xml" usefullltw="true"
- vmargs="-Daj.weaving.cache.enabled=true -Daj.weaving.cache.dir=./ -Daj.weaving.cache.impl=shared">
- <stdout>
- <line text="Hello world"/>
- </stdout>
- <!--
- Nothing should be printed on stderr, especially no fatal NPE with message
- 'Cannot read the array length because "b" is null' and subsequent ajcore.*.txt
- -->
- <stderr/>
- </run>
- </ajc-test>
-
- <!--
- https://github.com/eclipse-aspectj/aspectj/issues/288,
- https://github.com/eclipse-aspectj/aspectj/issues/141, AspectJ 1.9.21.2
- -->
- <ajc-test dir="bugs1921/github_288" title="memory leak for @AspectJ nested, non-inlined around-advice - AssertionError">
- <compile files="NestedAroundClosureMemoryLeakTest.java MemoryHog.java FirstAspect.aj SecondAspect.aj" options="-1.8 -XnoInline"/>
- <run class="NestedAroundClosureMemoryLeakTest" vmargs="-ea --add-opens java.base/java.lang=ALL-UNNAMED">
- <stdout>
- <line text="FirstAspect"/>
- <line text="SecondAspect"/>
- <line text="Executing task"/>
- <line text="Finished executing tasks"/>
- <line text="Finished executing GC"/>
- <line text="Test passed - all inheritable thread-locals are null after GC"/>
- </stdout>
- <!-- No AssertionError on stderr-->
- <stderr/>
- </run>
- </ajc-test>
-
- <!--
- https://github.com/eclipse-aspectj/aspectj/issues/288,
- https://github.com/eclipse-aspectj/aspectj/issues/141, AspectJ 1.9.21.2
- -->
- <ajc-test dir="bugs1921/github_288" title="memory leak for @AspectJ nested, non-inlined around-advice - OutOfMemoryError">
- <compile files="NestedAroundClosureMemoryLeakTest.java MemoryHog.java FirstAspect.aj SecondAspect.aj" options="-1.8 -XnoInline"/>
- <run class="NestedAroundClosureMemoryLeakTest" vmargs="-ea --add-opens java.base/java.lang=ALL-UNNAMED -Xmx512M" options="oom">
- <stdout>
- <line text="FirstAspect"/>
- <line text="SecondAspect"/>
- <line text="Executing task"/>
- <line text="FirstAspect"/>
- <line text="SecondAspect"/>
- <line text="Executing task"/>
- <line text="FirstAspect"/>
- <line text="SecondAspect"/>
- <line text="Executing task"/>
- <line text="FirstAspect"/>
- <line text="SecondAspect"/>
- <line text="Executing task"/>
- <line text="FirstAspect"/>
- <line text="SecondAspect"/>
- <line text="Executing task"/>
- <line text="Finished executing tasks"/>
- <line text="Finished executing GC"/>
- <line text="Test passed - no OutOfMemoryError due to inheritable thread-locals memory leak"/>
- </stdout>
- <!-- No fatal OutOfMemoryError on stderr -->
- <stderr/>
- </run>
- </ajc-test>
-
- </suite>
|