aboutsummaryrefslogtreecommitdiffstats
path: root/tests/src/test/java
Commit message (Collapse)AuthorAgeFilesLines
* Add IT reproducing JoinPointImpl thread-locals memory leakAlexander Kriegisch2024-04-101-2/+2
| | | | | | Relates to #302. Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Remove some TODOs from Java feature testsAlexander Kriegisch2024-03-231-4/+0
| | | | Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Switch to Java 22 + add basic test suiteAlexander Kriegisch2024-03-238-19/+288
| | | | | | | | | | | | The tests from Java 21 were copied to 22. Inactive ones were activated after their features under test were fixed/implemented. Preview ones were promotes to final ones for unnamed variables and patterns. TODO: Add tests for new Java 22 features and maybe adjust or amend existing feature tests, if preview or final characteristics have changed since Java 21. Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Adjust 1.6.1 'testRunningBrokenCode_pr102733*' tests ECJ Java 22Alexander Kriegisch2024-03-231-2/+8
| | | | | | | | | | | | | | | | | | | | | Initially, these tests made sure that an old AJC bug causing incompatibility to ECJ when using `-proceedOnError` was fixed and there were no regressions. See also: https://bugs.eclipse.org/bugs/show_bug.cgi?id=102733 Now with the Java 22 changes for JEP 463 "Implicitly Declared Classes and Instance Main Methods (Second Preview)" in JDT Core, source code is parsed into a significantly different AST structure than before, even when using compiler targets < 22. See also https://openjdk.org/jeps/463. One test has been temporarily adjusted to the byte code created by ECJ/AJC now. TODO: Revert/adjust after this upstream bug has been fixed: https://github.com/eclipse-jdt/eclipse.jdt.core/issues/2205 Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Reactivate test in AtAjAnnotationGenTestsAlexander Kriegisch2024-03-151-6/+3
| | | | | | | | In AtAjAnnotationGenTests.testRuntimePointcutsReferencingCompiledPointcuts, the classpath issues mentioned in the comments do not seem to exist anymore, with or without the removed lib/bcel/bcel.jar. Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Avoid ThreadLocal memory leak in JoinPointImplAlexander Kriegisch2024-03-121-2/+3
| | | | | | | | | | | | | | | | | | | | | | | according to https://rules.sonarsource.com/java/tag/leak/RSPEC-5164/. Now, there no longer is a thread-local stack of AroundClosure instances, but rather a list of them, which can only grow but never shrink. Instead, we now have a thread-local (integer) list index, for every thread being initialised with pointing to the last element. I.e., every thread can unwind by decrementing the index while proceeding, independently of other threads. A positive side effect is that this approach also works for long-lived threads from thread pools, used by executor services. Hence, test Bugs199Tests.testAsyncProceedNestedAroundAdviceThreadPool_gh128, which was previously commented out, has been activated and passes, see #141. I am not sure if this brings @AspectJ style, non-inlined, nested around advice execution functionally on par with native ones, but at least for current scenarios it seems to work. Fixes #288, #141. Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Add regression tests for inheritable thread-local memory leakAlexander Kriegisch2024-03-121-0/+8
| | | | | | | | | | | Leak was introduced in commit 3c80a36527, fixing #128, but introducing #288 instead, which was the lesser of two evils, but still bad for some users unwilling to use native AspectJ syntax for their aspects, avoiding the problem. Relates to #288. Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Add Bugs1921Tests::testGitHub_285Alexander Kriegisch2024-03-021-0/+4
| | | | | | This is an additional reproducer for regression bug #285. Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Fix: AllTestsAspectJ171 runs correct NewFeatures suiteAlexander Kriegisch2024-03-021-2/+0
| | | | | | | | | | While fixing #285, I noticed that *.ajc171.NewFeatures was never executed as part of the AspectJ test suite, because since 2012 falsely *.ajc1610.NewFeatures was imported and executed a second time instead. In addition to an outdated AspetJ weaver library in 'lib', this was one more factor why the regression bug was never spotted. Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Add Ajc164Tests::testMultipleXMLFilesAlexander Kriegisch2024-02-221-0/+50
| | | | | | | | | | While researching how and what to document for AJJ option '-xmlConfigured', I needed to find out what happens in case of multiple XML config files. Result: They are merged. the new test case for the old 1.6.4 release verifies and documents that. It can also serve as an example for reference in case of user questions. Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* New abstract class JavaVersionSpecificXMLBasedAjcTestCaseAlexander Kriegisch2024-02-1947-183/+377
| | | | | | | | | | | | | | | | Replaces now obsolete base classes - XMLBasedAjcTestCaseForJava[n]OrLater, - XMLBasedAjcTestCaseForJava[n]Only. The new class is parametrised with minimum and maximum Java version and hence can replace all the other classes. This does not only apply the DRY principle, but also makes adding tests for new Java versions less tedious. By chance, I also noticed missing sanity tests for Java 12, which I added as a little drive-by benefit. Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Remove most MINOR_*, MINOR_* BCEL class file versionsAlexander Kriegisch2024-02-1924-78/+84
| | | | | | | | | | | in favour of Constants.ClassFileVersion.of(int, int). The few ones retained are used from production code, the vast majority of removed ones only from test code. This gets rid of yet another 'AspectJ_JDK_Update' tag. One less place to check and update with each newly supported Java version. :-) Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* LangUtil: remove methods like 'is11VMOrGreater', 'is1dot5VMOrGreater'Alexander Kriegisch2024-02-1914-31/+30
| | | | | | | | | | Replace them by a uniform method 'isVMGreaterOrEqual(double)', also overloaded for int. This gets rid of one 'AspectJ_JDK_Update' tag. One less place to check and update with each newly supported Java version. :-) Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Add 'AspectJ_JDK_Update' hint in various placesAlexander Kriegisch2024-02-192-0/+14
| | | | | | | | | | | | | | | | | | | | The hint is meant to help AspectJ developers identify the places where there are to-dos for releases supporting new Java versions. This is work in progress, new tags can be added wherever necessary in the future. But for now, the most important places should be covered: - AJC version string - Test infrastructure (test suites, classes and XML files) - BCEL class file version MAJOR_*, MINOR_* constants - AjcTask constants for compiler source, target, release - LangUtil::is*VMOrGreater methods - ASM and JDT Core dependency versions - CI workflow file - Release notes The to-do to check the tagged places is also mentioned in RELEASE.md. Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Globally replace "http:" by "https:" in non-XML filesAlexander Kriegisch2024-02-154-5/+5
| | | | | | | | | Maybe, the XML files and Maven wrapper files will follow. First, let us find out if this breaks the build, maybe some tests are asserting on "http:". But there, the replacement would also have taken place, so probably it just works. Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Add tests for underscores in pointcuts on Java 21+Alexander Kriegisch2024-02-131-0/+12
| | | | | | | See also: https://github.com/eclipse-aspectj/eclipse.jdt.core/commit/5d2f2aecd2 Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* IT reproducing GitHub issue 279Alexander Kriegisch2024-02-081-2/+2
| | | | | | | | | Test "same class woven concurrently in parallel-capable classloader" reproduces #279. Originally taken and modified from: https://gitlab.com/urisimchoni/aspectj-parallel-issue Co-authored-by: Uri Simchoni <urisimchoni@gmail.com> Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Replace old by new AspectJ GitHub URLAlexander Kriegisch2024-02-082-2/+2
| | | | | | github.com/eclipse/org.aspectj -> github.com/eclipse-aspectj/aspectj Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Globally fix spelling error "dependancy/dependancies"Alexander Kriegisch2024-01-061-1/+1
| | | | Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Add tests for Java 21 unnamed classes and instance methodsAlexander Kriegisch2023-12-111-0/+19
| | | | | | TODO: Activate the unnamed class test after https://github.com/eclipse-jdt/eclipse.jdt.core/issues/1106 is done. Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Add tests for Java 21 unnamed patternsAlexander Kriegisch2023-12-111-0/+22
| | | | | | TODO: Activate after https://github.com/eclipse-jdt/eclipse.jdt.core/issues/893 is done. Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Add tests for Java 21 string patternsAlexander Kriegisch2023-12-111-2/+6
| | | | | | | | TODO: Due to eclipse-jdt/eclipse.jdt.core#1719, one line per test is currently rendered incorrectly. After the upstream fix, change "\Bill \Duck" to "Bill Duck". Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* AllTests19 suite: add AllTestsAspectJ1921Alexander Kriegisch2023-11-271-0/+2
| | | | | | | Until now, the CI build did not run Java 21 tests, but they look OK locally. Now, let's find out what GitHub Actions says. Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Enable some tests after J19 problems were fixed for J21Alexander Kriegisch2023-11-051-13/+7
| | | | | | | | | | 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-053-146/+77
| | | | | | | | | | | 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-051-1/+2
| | | | Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Add test infrastructure for Java 21 (WIP)Alexander Kriegisch2023-10-057-2/+359
| | | | | | | 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-272-2/+0
| | | | Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Add regression test for #257Alexander Kriegisch2023-08-231-0/+9
| | | | | | Relates to #257. Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Regression test for Spring issue 27761Alexander Kriegisch2023-08-211-0/+12
| | | | | | | | | | 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-152-32/+32
| | | | | | | | | | | 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-061-0/+9
| | | | | | Reproduces #250. Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Add failing test reproducing #246Alexander Kriegisch2023-06-261-2/+9
| | | | 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-246-1/+288
| | | | 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-211-0/+4
| | | | Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Add regression tests for GitHub bug #24Alexander Kriegisch2023-01-151-0/+16
| | | | | | 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-071-4/+4
| | | | | | | | | | 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-061-0/+4
| | | | | | | Fixes #162. Contains regression test Bugs1919Tests.testInterfaceInnerAspectImplicitlyStatic. Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Test cosmeticsAlexander Kriegisch2023-01-061-2/+2
| | | | Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Add test reproducing problem from #198Alexander Kriegisch2023-01-041-0/+6
| | | | Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Fix parenthesised AJ keyword compiler problemAlexander Kriegisch2023-01-041-0/+5
| | | | | | Fixes #20. Needs JDT Core grammar fix. Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Regression test for #190Alexander Kriegisch2022-12-301-0/+3
| | | | Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Fix #366085 concerning declared annotations with source retentionAlexander Kriegisch2022-12-211-2/+2
| | | | | | | | | | | | | | | 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-211-0/+43
| | | | Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Add the first few Java 19 testsAlexander Kriegisch2022-10-036-0/+239
| | | | | | | | | | 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>