aboutsummaryrefslogtreecommitdiffstats
path: root/tests/src
Commit message (Collapse)AuthorAgeFilesLines
* Enable some tests after J19 problems were fixed for J21Alexander Kriegisch2023-11-052-16/+9
| | | | | | | | | | Two test classes which had redundant default clauses for switch with record patterns were copied from the java19 to the java21 directory and the redundant clauses deactivated, i.e. the test now run as originally intended. For older JDK versions, the old tests still stay active in order to document the old state of affairs. Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Make all existing tests run on JDK 21Alexander Kriegisch2023-10-054-488/+139
| | | | | | | | | | | This mostly affects pattern matching for switch and record patterns. Two tests which were working before for pattern matching for switch (preview 4), started to fail, so the corresponding code was commented out and https://github.com/eclipse-jdt/eclipse.jdt.core/issues/1466 recorded. Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Move some 1.9.20.1 bug tests to correct directoryAlexander Kriegisch2023-10-052-5/+9
| | | | Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Add test infrastructure for Java 21 (WIP)Alexander Kriegisch2023-10-0510-3/+908
| | | | | | | The tests and their XML definitions are still copy & paste and need to be cleaned up. Separate Java 21 feature tests do not exist yet. Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Beautify sanity tests using bytecode level constantsAlexander Kriegisch2023-10-0512-29/+45
| | | | Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Remove old '.cvsignore' filesAlexander Kriegisch2023-09-275-5/+0
| | | | Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* ajc162.xml: Fix test failing after previous bugfixAlexander Kriegisch2023-08-231-2/+2
| | | | | | | | | | | | | A change made to ajc162.xml in commit 43cb1e2f has been reverted and improved after the recent negated type pattern fix. Relates to #257. The pointcut 'call(!void *.*(..)) && this(src) && target(dst)' actually does match method call 'payloadClass.getPayload()' within the around-advice in GenericClassInAdvice itself. Improvement: Activate '-showWeaveInfo' and verify weaving message. Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Add regression test for #257Alexander Kriegisch2023-08-232-0/+50
| | | | | | Relates to #257. Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Improve bridge method test, bootstrapping ASM usageAlexander Kriegisch2023-08-221-1/+6
| | | | | | | | | | | Instead of using a pre-generated JAR, the source code generating the class with reordered methods (bridge method first) is now compiled directly before usage. This is possible, because in the previous commit ASM was put on the Ajc classpath for tests. Relates to #256. Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Regression test for Spring issue 27761Alexander Kriegisch2023-08-212-0/+23
| | | | | | | | | | Relates to spring-projects/spring-framework#27761. The test needs an ASM-generated class file with reordered methods in order to reproduce the issue in plain AspectJ. The test fails now, but should pass after the fix. Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Move 1.9.20 bug regression tests to the correct spotsAlexander Kriegisch2023-08-154-247/+247
| | | | | | | | | | | Originally, I had intended to release a minor 1.9.19.1 release to fix some bugs. But then, Java 20 support was implemented and merged, so the next release will be 1.9.20. Therefore, I moved some bug regression tests to the 1.9.20 suite. Relates to #254. Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Add regression test for #250Alexander Kriegisch2023-08-062-0/+22
| | | | | | Reproduces #250. Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Add method ArrayReferenceType.equals to fix failing testsAlexander Kriegisch2023-06-261-1/+3
| | | | | | | | | | | This also fixes a bug. Previously, ResolvedType.equals was used for equality check, and in there is a '==' comparison, which does not work for two different ArrayReferenceType instances, even if the component type is the same. Relates to #246. Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Add failing test reproducing #246Alexander Kriegisch2023-06-262-2/+21
| | | | Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Adjust expected error message in switch pattern tests after upstream typo fixAlexander Kriegisch2023-06-244-11/+11
| | | | | | | See: https://github.com/eclipse-jdt/eclipse.jdt.core/issues/919 https://github.com/eclipse-jdt/eclipse.jdt.core/commit/b681dfb5 Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Add AllTestsAspectJ1920 to AllTests19 suiteAlexander Kriegisch2023-06-241-0/+2
| | | | Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Add basic tests for Java 20, deactivate Java 19 preview testsAlexander Kriegisch2023-06-248-1/+537
| | | | Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Fix XML config for Bugs1919Tests.test_GitHub_214Alexander Kriegisch2023-06-041-2/+4
| | | | | | | | | | | | | | | | | | | | | | The test started breaking on GitHub, but ran fine locally, which implied some kind of classpath ordering issue. As it turned out, for XML tests all JARs found in the sandbox directory are added to the classpath automatically. So if we do not want them on the classpath, we need to delete or rename them before running. In this case, however, it was enough to make sure the classpath order is correct, so that the duplicate 'Application' class is found in the woven version, not in the unwoven one by chance. We therefore need to use the correct syntax, 1. separating classpath entries by comma, not space, 2. prepending '$sandbox/' to the JAR name. Now the test reliably does what it should have done from the start: run the woven code. Until now, the output assertions were adjusted to the weird result of no aspect logs being present on the console, which was wrong right from the start. Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Sync HandleProviderDelimiter with JDT Core & AJDTAlexander Kriegisch2023-02-268-108/+111
| | | | | | | | | | | | | | | | | | | | | | New constants: JEM_MODULAR_CLASSFILE - '\'' (single quote) ANNOTATION - '}' LAMBDA_EXPRESSION - ')' LAMBDA_METHOD - '&' STRING - '"' MODULE - '`' DELIMITER_ESCAPE - '=' Updated AspectJ constants due to JDT Core using constants previously used by AspectJ: ADVICE - '&' to '§' ASPECT_TYPE - '\'' to '>' ITD_METHOD - ')' to '°' DECLARE - '`' to '´' POINTCUT - '"' to '©' Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Add regression test reproducing GitHub #214Alexander Kriegisch2023-01-212-0/+32
| | | | Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Comment on newly pointcut parsing found problem in test classAlexander Kriegisch2023-01-151-0/+2
| | | | | | | | | | | | A pointcut like execution(*..Collection<?>[] *(..)) leads to an AJ core dump, which is something I noticed while fixing a test in the previous commit. I am going to create a new issue for it and link to this commit later. Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Fix failing tests after previous commitAlexander Kriegisch2023-01-153-20/+23
| | | | | | | | | After the changes, the weaver's behaviour is now slightly different, but not actually buggy. Actually, in one case there is now a weaver warning for a non-matching pointcut which should have been there before, but was not. I.e., things have improved and the tests are even a bit better now. Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Expand regression tests for GitHub bug #24Alexander Kriegisch2023-01-151-13/+56
| | | | | | | | | | More test cases were added for - multi-dimensional arrays, - primitive type arrays. Relates to https://github.com/eclipse/org.aspectj/issues/24. Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Add regression tests for GitHub bug #24Alexander Kriegisch2023-01-152-0/+108
| | | | | | Relates to https://github.com/eclipse/org.aspectj/issues/24. Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Refactor, comment and reactivate Ajc183Tests.testAnnoStyleDecp_442425Alexander Kriegisch2023-01-072-19/+24
| | | | | | | | | | This test was always inactive and did not add any value other than during development. No it runs, passes and documents the status quo of - what was fixed (regression for AJC 1.8.2 core dump fixed in 1.8.3), - the current limitations of @DeclareParents and @DeclareMixin regarding generic interfaces. Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* No more compiler errors for implicitly static inner aspects of interfacesAlexander Kriegisch2023-01-062-0/+22
| | | | | | | Fixes #162. Contains regression test Bugs1919Tests.testInterfaceInnerAspectImplicitlyStatic. Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Test cosmeticsAlexander Kriegisch2023-01-062-3/+3
| | | | Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Add test reproducing problem from #198Alexander Kriegisch2023-01-042-25/+49
| | | | Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Fix parenthesised AJ keyword compiler problemAlexander Kriegisch2023-01-042-0/+24
| | | | | | Fixes #20. Needs JDT Core grammar fix. Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Regression test for #190Alexander Kriegisch2022-12-302-0/+16
| | | | Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Fix indentation in ajc1919.xml (cosmetics)Alexander Kriegisch2022-12-301-8/+8
| | | | Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Fix #366085 concerning declared annotations with source retentionAlexander Kriegisch2022-12-212-5/+11
| | | | | | | | | | | | | | | See https://bugs.eclipse.org/bugs/show_bug.cgi?id=366085. See https://stackoverflow.com/q/74618269/1082681. The issue described in the Bugzilla issue is about 'declare @type', but similar issues also existed for 'declare @field', 'declare @method', 'declare @constructor'. This fix is rather superficial and leaves things to be desired, because it is rather hacky and simply ignores errors source retention annotation declarations during weaving. A better fix would drop the corresponding declarations while parsing and also issue compiler warnings in each case. Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Add tests for Java 19 record patternsAlexander Kriegisch2022-12-212-2/+119
| | | | Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* OutputSpec.matchesThisVm better supports version rangesAlexander Kriegisch2022-10-0511-272/+272
| | | | | | | | | | | | | | | | | | | | vmVersionRanges might be a single version like "9", a list of versions like "1.2,1.3,1.4,1.5", an equivalent range of "1.2-1.5", an open range like "-1.8", "9-" (equivalent to "9+") or a more complex list of ranges like "-1.6,9-11,13-14,17-" or "8,11,16+". Empty ranges like in "", " ", "8,,14", ",5", "6-," will be ignored. I.e., they will not yield a positive match. Bogus ranges like "9-11-14" will be ignored, too. Existing XML test specs using '<line text="..." vm="v,v2,...,vn"/> have been adjusted to use version ranges rather than long lists of consecutive versions. Furthermore, ranges with a trailing '+' like '14+' were replaced by using the new canonical format '14-', even though the parser still correctly recognises '14+'. Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Fix tests due to changed JDK 'toString' methods in Java 19Alexander Kriegisch2022-10-033-42/+51
| | | | Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Add the first few Java 19 testsAlexander Kriegisch2022-10-038-0/+404
| | | | | | | | | | For now, only the "pattern matching for switch" tests from previews 1 and 2 were adjusted to work in preview 3, because guarded patterns were replaced by 'when' clauses in 'switch' blocks. Therefore, existing test classes did not compile anymore and had to be replaced by syntactically upgraded versions with content merged from preview 1 and 2 classes. Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Deactivate Java 18 preview language feature testsAlexander Kriegisch2022-10-032-1/+4
| | | | | | and enable LangUtil to parse Java versions like '19+36-2238'. Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Remove Batik path entries from test classpathAlexander Kriegisch2022-10-031-7/+8
| | | | | | | | | | | Firstly, Batik is not needed for running AspectJ tests. Secondly, the fixed Windows path separators led to GitHub CI/CD tests failing under Java 18+ on GitHub. Replacing ';' by 'File.pathSeparator' would have fixed the problem, but removing the paths altogether is the cleaner solution. Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Cosmetic fixes in Java 18 tests (e.g. copyright year 2022)Alexander Kriegisch2022-10-036-11/+7
| | | | Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* vuln-fix: Partial Path Traversal VulnerabilityJonathan Leitschuh2022-09-101-1/+1
| | | | | | | | | | | | | | | | | | | | | | | This fixes a partial path traversal vulnerability. Replaces `dir.getCanonicalPath().startsWith(parent.getCanonicalPath())`, which is vulnerable to partial path traversal attacks, with the more secure `dir.getCanonicalFile().toPath().startsWith(parent.getCanonicalFile().toPath())`. To demonstrate this vulnerability, consider `"/usr/outnot".startsWith("/usr/out")`. The check is bypassed although `/outnot` is not under the `/out` directory. It's important to understand that the terminating slash may be removed when using various `String` representations of the `File` object. For example, on Linux, `println(new File("/var"))` will print `/var`, but `println(new File("/var", "/")` will print `/var/`; however, `println(new File("/var", "/").getCanonicalPath())` will print `/var`. Weakness: CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal') Severity: Medium CVSSS: 6.1 Detection: CodeQL & OpenRewrite (https://public.moderne.io/recipes/org.openrewrite.java.security.PartialPathTraversalVulnerability) Reported-by: Jonathan Leitschuh <Jonathan.Leitschuh@gmail.com> Signed-off-by: Jonathan Leitschuh <Jonathan.Leitschuh@gmail.com> Bug-tracker: https://github.com/JLLeitschuh/security-research/issues/13 Co-authored-by: Moderne <team@moderne.io>
* Make IStateListener.aboutToCompareClasspaths use typed listsAlexander Kriegisch2022-04-182-3/+2
| | | | | | | | | | | | | | | | Before, the signature was: void aboutToCompareClasspaths( List oldClasspath, List newClasspath); Now it is: void aboutToCompareClasspaths( List<String> oldClasspath, List<String> newClasspath); AJDT will also use the typed version after generics refactoring. Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Revert "Fix more LTW tests"Alexander Kriegisch2022-03-312-30/+3
| | | | This reverts commit 63d5e3e893bd149245465de1610716930998dec8.
* Revert "AtAjLTWTests: 4 test cases switched to 'useFullLTW' mode"Alexander Kriegisch2022-03-312-14/+13
| | | | This reverts commit 5288ef1c1c8be2df85e59740f41622f4cfb9d899.
* Revert "A few dozen more tests need 'useFullLTW' mode"Alexander Kriegisch2022-03-3113-145/+145
| | | | This reverts commit 8c15d83a466843b5dba8ba454329baaca0080cc5.
* Add some smoke test cases for '--add-reads' and '--add-modules'Alexander Kriegisch2022-03-312-4/+79
| | | | | | | in order to show that the compiler options basically work. The test cases are by no means exhaustive and simply verify that it works at all. Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Add test case + experimental fix for AJC option '--add-exports'Alexander Kriegisch2022-03-272-0/+13
| | | | | | | I am expecting the test case to pass, but other tests to fail. This temporary commit is meant to create feedback from GitHub CI test runs. Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Add AllTestsAspectJ199.suite() to AllTests19Alexander Kriegisch2022-03-241-0/+2
| | | | Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Upgrade to latest JDT Core Java 18 changes, activate J18 preview testsAlexander Kriegisch2022-03-242-16/+37
| | | | Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Rename testGitHub_125 to testCompilerCanReopenClosedJARs_gh125Alexander Kriegisch2022-03-231-1/+1
| | | | Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Move GH-128 tests from 1.9.8 to 1.9.9 bugs test suite after mergeAlexander Kriegisch2022-03-234-333/+333
| | | | Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>