diff options
author | Alexander Kriegisch <Alexander@Kriegisch.name> | 2024-02-13 17:05:04 +0700 |
---|---|---|
committer | Alexander Kriegisch <Alexander@Kriegisch.name> | 2024-02-13 17:05:04 +0700 |
commit | c028a472697a6934a538f2d61cb9974a66421fb1 (patch) | |
tree | bd70e5b647c2e1ad6fee7d6b983d82416b36d4be /tests/src/test/resources/org/aspectj/systemtest/ajc1921/ajc1921.xml | |
parent | 8478d33a68781b3dd950224eb3ebbec6727bfc8e (diff) | |
download | aspectj-c028a472697a6934a538f2d61cb9974a66421fb1.tar.gz aspectj-c028a472697a6934a538f2d61cb9974a66421fb1.zip |
Add tests for underscores in pointcuts on Java 21+
See also:
https://github.com/eclipse-aspectj/eclipse.jdt.core/commit/5d2f2aecd2
Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
Diffstat (limited to 'tests/src/test/resources/org/aspectj/systemtest/ajc1921/ajc1921.xml')
-rw-r--r-- | tests/src/test/resources/org/aspectj/systemtest/ajc1921/ajc1921.xml | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/tests/src/test/resources/org/aspectj/systemtest/ajc1921/ajc1921.xml b/tests/src/test/resources/org/aspectj/systemtest/ajc1921/ajc1921.xml index bac8a1576..d5d4c1c69 100644 --- a/tests/src/test/resources/org/aspectj/systemtest/ajc1921/ajc1921.xml +++ b/tests/src/test/resources/org/aspectj/systemtest/ajc1921/ajc1921.xml @@ -297,6 +297,41 @@ </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"/> |