aboutsummaryrefslogtreecommitdiffstats
path: root/tests/src
Commit message (Collapse)AuthorAgeFilesLines
...
* Merge branch 'master' into java-18Alexander Kriegisch2022-03-232-0/+333
|\ | | | | | | | | | | # Conflicts: # tests/src/test/java/org/aspectj/systemtest/ajc198/Bugs198Tests.java # tests/src/test/resources/org/aspectj/systemtest/ajc198/ajc198.xml
| * Ignore testAsyncProceedNestedAroundAdviceThreadPool_gh128 for nowAlexander Kriegisch2022-03-231-1/+2
| | | | | | | | | | | | Out of scope for PR #132, future work for issue #141. Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
| * Name annotation vs native style aspects uniformly in github_128 testsAlexander Kriegisch2022-03-231-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Trying to find the difference between byte code generated by AJC for functionally identical annotation vs native style aspect, I move the aspects into subdirectories in order to be able to name them identically. This way, when decompiling them with javap or Fernflower it is easier to diff them later. Why the decompilation? Because for the thread pool testing scenario native syntax passes while annotation syntax fails. I.e., we need to find the difference. That can be done by reading source code, if you know where to look, or by starting with reverse engineering in order to first understand more and look at the code later. Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
| * Expand "asynchronous proceed for nested around-advice" to 4 scenarios:Alexander Kriegisch2022-03-232-2/+251
| | | | | | | | | | | | | | | | | | | | | | 1. @AspectJ syntax, threads created inside advice code 2. @AspectJ syntax, submit runnable to thread pool 3. native syntax, threads created inside advice code 4. native syntax, submit runnable to thread pool Scenarios 1, 3 and 4 are passing, while 2 is failing. Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
| * Add test "asynchronous proceed for nested around-advice chain"Alexander Kriegisch2022-03-232-0/+83
| | | | | | | | | | | | Relates to #128. Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* | Fix more LTW testsAlexander Kriegisch2022-03-232-3/+30
| | | | | | | | Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* | A few dozen more tests need 'useFullLTW' modeAlexander Kriegisch2022-03-2314-147/+147
| | | | | | | | Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* | AtAjLTWTests: 4 test cases switched to 'useFullLTW' modeAlexander Kriegisch2022-03-232-13/+14
| | | | | | | | | | | | | | | | After the Java 18 JDT Core upgrade, some LTW tests are failing and have to be switched from in-process to full LTW mode due to them now obviously calling some code paths which need '--add-opens'. Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* | Prepare code, tests and docs for Java 18Alexander Kriegisch2022-03-2111-125/+550
|/ | | | | | | | | | | | | | | | | | | | - JDT Core dependency in pom.xml - Constants.java - LangUtil.java - AjcTask.java - messages_aspectj.properties - XMLBasedAjcTestCaseForJava17Only.java - XMLBasedAjcTestCaseForJava18*.java - tests/bugs199 - tests/features199 - JavaVersionCompatibility.md - README-199.html - GitHub CI build Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Regression test for #125: Bugs198Tests.testGitHub_125Alexander Kriegisch2022-02-232-3/+26
| | | | | | | | | | | | | | | | | | | | | | | | This test fails when run against AspectJ 1.9.8 with JDT Core 1.9.8.RC3. It passes when using the latest JDT Core 1.9.9-SNAPSHOT. It sets system property 'org.aspectj.weaver.openarchives=20', provoking open classpath JAR file exhaustion when compiling a simple class with AJC, i.e. JARs are being forcibly closed and automatically re-opened, as soon as they are needed. Before the JDT Core bugfix, this test causes: java.lang.NullPointerException at ....compiler.batch.ClasspathJmod.getModulesDeclaringPackage With the bugfix incorporated into AspectJ Tools, the problem is gone. Note: New test dependency 'io.github.bmuskalla:scoped-system-properties' helps to test compilation with the temporarily changed global system property in isolation, saving the environment in a thread-local variable and later cleanly restoring the original values again. If we ever switch to parallel test execution, this would otherwise influence other tests and potentially cause weird side effects. Better safe than sorry. Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Move some tests from Ajc198TestsJava to Bugs198TestsAlexander Kriegisch2022-02-232-20/+20
| | | | | | | | | They were accidentally stored in thw wrong test class, not just because they are bug regression tests, not 1.9.8 features, but also because they are meant to work on Java 5+, not on Java 17+ like the ones in Ajc198TestsJava. Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Improve annotation style if pointcut handlingAndy Clement2022-01-312-15/+61
| | | | | | | | | This fixes: - negating annotation style if() pointcuts doesn't work - annotation style if() pointcut not able to use a binding that is not exposed Fixes #120,#122
* Fix annotation style support for if(true) and if(false)Andy Clement2022-01-172-0/+30
| | | | | | | | | | The documentation specifies annotation style pointcuts can use if(false) or if(true) and not require a boolean return value and body for the @Pointcut annotated method but it doesn't work without this change to validation that recognizes the situation. Fixes #115
* Add test for Java 11 constant-dynamicAlexander Kriegisch2022-01-083-0/+48
| | | | | | Relates to #68. Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Merge pull request #102 from turbanoff/trim_trailing_whitespacesAndy Clement2021-11-304-7/+7
|\ | | | | Trim trailing whitespaces.
| * Trim trailing whitespaces.Andrey Turbanov2021-11-204-7/+7
| | | | | | | | | | Trailing whitespaces are useless. Most of code-styles forbids them. Most of editors always trim them on save. I propose to clean up project from trailing whitespaces in all java files at once.
* | Merge pull request #101 from turbanoff/use_StringBuilder_instead_of_StringBufferAndy Clement2021-11-306-15/+15
|\ \ | | | | | | Replace uses of StringBuffer with StringBuilder.
| * | Replace uses of StringBuffer with StringBuilder.Andrey Turbanov2021-11-206-15/+15
| |/ | | | | | | StringBuffer is a legacy synchronized class. StringBuilder is a direct replacement to StringBuffer which generally have better performance.
* | Add forgotten Bugs198Tests to test suiteAlexander Kriegisch2021-11-262-0/+6
| | | | | | | | Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* | Incorporate JDT Core fix + test for #105Alexander Kriegisch2021-11-262-0/+32
|/ | | | Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Fix Java17PreviewFeaturesTests (locale-specific floating-point output)Alexander Kriegisch2021-10-081-2/+2
| | | | | | | The test worked on my local workstation with German locale, but not on GitHub with English locale. Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Update ECJ version, activate Java 17 preview features testsAlexander Kriegisch2021-10-022-15/+9
| | | | | | | After JDT Core (ECJ) was updated to the final Java 17 feature set, the tests now pass as expected. Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Add + activate some Java 17 testsAlexander Kriegisch2021-09-074-62/+95
| | | | | | | | | | | | | - Fix one fault sanity test configuration - Deactivate Java 16 preview tests (no longer supported by Java 17 compiler) - Test sealed classes as final on Java 17 (no longer preview) - Add tests for JEP 406, pattern matching for switch (preview). At present, the beta 17 branch of JDT Core does not handle the tested features and expected compile errors correctly yet, so I had to temporarily deactivate test execution, only printing TODO messages. Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Test comment cosmeticsAlexander Kriegisch2021-09-079-9/+12
| | | | Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Add integration test for '--release N' compiler optionAlexander Kriegisch2021-06-263-0/+81
| | | | | | Relates to #70 Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Add AspectJ 1.9.7 and Java 17 test skeletonsAlexander Kriegisch2021-06-267-0/+335
| | | | Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Upgrade license from CPLv1/EPLv1 to EPLv2Alexander Kriegisch2021-06-04190-1181/+1181
| | | | | | | This was required by the Eclipse team as one precondition for the next release. Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Make all tests run on Java 16 via '-add-opens' JVM optionjava16-add-opensAlexander Kriegisch2021-03-231-7/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Due to JEP 260 (Encapsulate Most Internal APIs), aspect weaving on Java 16 now requires '--add-opens java.base/java.lang=ALL-UNNAMED' on the command line. Otherwise there will be illegal access exceptions for some internal API calls AspectJ needs, most prominently when trying to define classes in other packages or modules. This had to be done on several levels: - Maven Surefire: running tests in a JVM directly forked by Surefire. In order to make this backwards compatible, I added two profiles with JDK-level-dependent auto-activation, one 8-15 and one 16+. In the latter a property containing the JVM parameter is defined, in the former it is empty, i.e. the JVM is started without the parameter. In Java 8 the parameter did not even exist, in Java 9+ we could use it, but we need to test how users use AspectJ. - RunSpec: Whenever an XML test is declared to use '<run>', we need to determine the current JVM version and again dynamically add the parameter when forking the target JVM. - AntSpec: Whenever an XML test is declared to use '<ant>', we need to determine the current JVM version dynamically add two properties usable from within Ant scripts: 'aj.addOpensKey' and 'aj.addOpensValue'. Unfortunately, Ant needs to use two '<argLine>' parameters, because the two parts of the option are separated by a space character. - Ant scripts: When triggered by an AntSpec, each Ant target using LTW needs to manually set <jvmarg value="${aj.addOpensKey}"/> <jvmarg value="${aj.addOpensValue}"/> for each '<java>' task. It was quite tedious to find all(?) of them. TODO: In the AspectJ 1.9.7 release notes we need to document that this parameter is now needed for LTW. Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Fix AtAjLTWTests::testLTWDumpProxy for Java 16Alexander Kriegisch2021-03-231-2/+14
| | | | | | | | | | | | | | | Before Java 16, JDK proxies were given a virtual package name of 'com.sun.proxy'. Now the packages are numbered 'jdk.proxy[n]', i.e. 'jdk.proxy1', 'jdk.proxy2' etc. This makes the package-name-derived path name here less predictable. In our simple runtime scenario, we can be pretty sure than the counter starts at 1 because it is the first and only proxy we create. TODO: A better solution would be a recursive filtered search via Files.walk, ideally added as a recursive search option for CountingFilenameFilter. Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Fix some deprecated Java and JUnit warnings by using newer API callsAlexander Kriegisch2021-03-213-3/+3
| | | | Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Add Java 16 test suite for AspectJ 1.9.7 + test refactoringsAlexander Kriegisch2021-03-219-110/+275
| | | | | | | | | | | | | | | - Test all features which were preview in 14+15 and are now final in 16, compiling them with language level 16. - For Java 15 we only have sanity tests (and of course the Java <14 tests), compiling Java 16 features to target 15 does not seem to work. - Test remaining Java 16 preview feature (sealed classes). - Instead of overriding runTest(String) in several base classes like XMLBasedAjcTestCaseForJava*Only or XMLBasedAjcTestCaseForJava*OrLater, we now override setUp() from JUnit's TestCase base class. This will run before runTest(String) and make the tests fail much faster, if a user tries to run them on the wrong VM. Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Fix MultiProjectIncrementalTests.testInvalidAspectpath_pr121395Alexander Kriegisch2021-03-201-1/+8
| | | | | | | | | | | It failed with "RuntimeException: I never heard about what kind of build it was!!" on my (@kriegaex) Windows machine, mostly because in case of a failing full build the corresponding status is never set. TODO: Ensure that 'MyStateListener.informedAboutKindOfBuild' is set for failed builds, too. Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Fix tests expecting usage texts as failure outputsAlexander Kriegisch2021-03-202-207/+201
| | | | | | | | | This is a follow-up on commit @31b2d60b. Some tests were actually expecting usage texts as failure outputs. Because that was fixed, the tests no longer see those failures, hence they should no longer expect them. Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Fix test relying on JVM warning being stripped from outputAlexander Kriegisch2021-03-201-10/+9
| | | | | | | | | | | | | | | | The line in which warnings like "Archived non-system classes are disabled because the java.system.class.loader property is specified" appears can start with e.g."OpenJDK 64-Bit Server VM" or "Java HotSpot(TM) 64-Bit Server VM". Therefore, an exact match on the former worked on Linux, but not on Windows, or maybe the difference is generally between Oracle and OpenJDK. anyway, I use Oracle on Windows and my build failed. Now it is fixed because I made the match more generic using a regex. I also removed a now obsolete check for the occurrence of the stripped line in test "JDK14 LTW with XML". Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Add Java 15 / AspectJ 1.9.7 test suiteAlexander Kriegisch2021-03-179-17/+409
| | | | | | Also fix some minor details in Java 14 suite Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Do not run tests using Java 14 preview features on this Java 15 compilerAlexander Kriegisch2021-03-171-0/+3
| | | | | | | | | | | | | | | | These tests need a Java 14 level AspectJ compiler, because they use version-specific preview features. This compiler has been upgraded to a Java 15 compliant JDT Core already, i.e. it does not support preview features of a previous version anymore. An error message similar to the above explanation will appear when trying to run any XMLBasedAjcTestCaseForJava14Only subclass, such as Ajc196PreviewFeaturesTests (currently the only one). When running AllTestsAspectJ196, Ajc196PreviewFeaturesTests will not be added to the test suite anymore. Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Restructure Java 14 / AJ 1.9.6 testsAlexander Kriegisch2021-03-173-9/+10
| | | | | | | | - Java 14 feature sample classes moved from 'bugs' to 'features' - One test case using a Java 14 preview feature was moved to the Java 14-only tests Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Simplify execution of PureJavaTests and KnownLimitationsTestsAlexander Kriegisch2021-03-146-2242/+2229
| | | | | | | | | Getting rid of XML includes and two superfluous files, merging them with their respective including counterparts. As far as I can see, the two test suites are not part of the automatic build process, but can be started manually as easily as any other test (suite) now. Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Fix outdated ajcTestSuite.dtd and lots of XML problemsAlexander Kriegisch2021-03-1413-243/+249
| | | | | | | | | Now there should be no more inspection warnings when working with XML test definitions. Only the strangely looking XML files used by PureJavaTests and KnownLimitationsTests are left to be analysed and fixed. Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Make sure Java 14-only tests using preview are not executed on JVM 15+Alexander Kriegisch2021-03-144-57/+89
| | | | | | | | | | | Some Ajc196 tests are using preview features (see .../ajc196.xml), i.e. they will fail on Java 15+ because code compiled with '--enable-preview' can only run on the same JVM version, not on a more recent one. Hence, the preview-using tests are now being excluded in order to make the build run on Java 15, even though no Java 15 features are present in the current 1.9.7 snapshot. Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Fix 'ajdoc' tests for Java 15 buildAlexander Kriegisch2021-03-144-150/+150
| | | | Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Add missing '-options' values -1.5, -1.9 to ajc{150,190_from150}.xmlAlexander Kriegisch2021-03-122-549/+427
| | | | | | | | | | | | | | | | | When trying to find out why ajc150.xml and ajc190_from150.xml look almost identical, I found out that only in many cases the 190 version has '-option="1.9"' set where in the 150 version it was '-option="1.9"'. Unfortunately, in both files source/target versions are not set at all in many places, which looks unintentional. I tried to search & replace all relevant '<compile ...>' commands for 190 first, then ported back to 150. Only cases in which clearly compiling to an older version like 1.3 or 1.4 is necessary were left like before. I am expecting missing or false Java target versions in many other of the legacy XML test suites. For now, I am just committing these two. Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Replace path separators ';' by ',' in XML test specsAlexander Kriegisch2021-03-1114-1995/+1995
| | | | | | | | The goal is for them to be canonicalised to platform standard during test execution. I am not sure if that will fix any tests, but at least I hope it will not break any. Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Fix MultiProjectIncrementalTests.testAspectPath_pr265693, 2nd tryAlexander Kriegisch2021-03-111-3/+7
| | | | | | | Do not assume a certain element order for tree nodes if there can be more than one. Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Fix path separators in ajc190.xml, make tests run on WindowsAlexander Kriegisch2021-03-111-21/+21
| | | | | | | Replace ':' by ";" which will be replaced to the platform separator automatically. A fixed value of ':' does not work on Windows. Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Reduce test output for incremental comp testsAndy Clement2020-08-155-50/+60
|
* Merge branch 'master' into feature/collection-performanceAndy Clement2020-08-157-67/+60
|\
| * Reduce test output for incremental comp testsAndy Clement2020-08-155-49/+32
| |
| * Fix test on J14Andy Clement2020-08-152-18/+28
| |
* | Weaken Collection declarationsLars Grefer2020-08-153-8/+9
| | | | | | | | | | | | Reports on declarations of Collection variables made by using the collection class as the type, rather than an appropriate interface. Signed-off-by: Lars Grefer <eclipse@larsgrefer.de>