aboutsummaryrefslogtreecommitdiffstats
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
* Provision libraries in 'lib' automaticallyAlexander Kriegisch2021-05-051-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Upon special request by Andy Clement, I included 'lib' as a child module in the parent POM again, making several modules which refer to downloaded library files dependent the 'lib' module. I am not sure I caught all of them, but I hope so. Now after cloning the project and configuring the token for reading from GitHub Packages (sorry!), you can just run a Maven build for the main project and no longer need to fail the first build, read the Maven Enforcer message and run 'cd lib && mvn compile' as a first step. This convenience comes at the price of a more complex POM and two new profiles: - Profile 'provision-libs' is auto-activated by the absence of a marker file, kicking off the library provisioning process and creating same marker file at the end, if successful. Therefore, during subsequent builds libraries will not be re-provisioned, because the marker file exists and Maven skips all download and (un)zip steps, which saves build time and bandwidth. Otherwise offline builds would not work either. - Profile 'clean-libs' needs to be activated manually, because by default 'mvn clean' will not erase provisioned libraries. In most cases, even after a clean a developer does not want to re-provision all libraries if they have not changed (e.g. new JDT Core build). But if you do wish too erase the libraries and the marker file, just call 'cd lib && mvn -P clean-libs clean'. Please note: The Maven Enforcer build step, which additionally checks for existence of other files, still exists and was moved from the parent POM to 'libs'. No matter if provisioning was just done or skipped because the main marker file exists, a quick heuristic check for that list of files is done during each build, failing the build with a comprehensive message if an inconsistency was found. The error message says which files are missing and tells the user: "There is an inconsistency in module subdirectory 'lib'. Please run 'mvn --projects lib -P clean-libs clean compile'. This should take care of cleaning and freshly downloading all necessary libraries to that directory, where some tests expect them to be." This should cover the topic. Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Fix missing dependencies in module 'run-all-junit-tests'Alexander Kriegisch2021-04-281-2/+8
| | | | | | | | | | Some runtime dependencies are reported as unused in Maven Dependency Plugin goal 'dependency:analyze', but actually they are needed. I noticed by chance when running RunTheseBeforeYouCommitTests in IntelliJ IDEA for the first time after a while and dependency modules could not find classes. Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Remove redundant 'name' and 'packaging' tags from POMsAlexander Kriegisch2021-04-152-3/+0
| | | | | | | If 'name' is identical to 'artifactId' and 'packaging' has the default value 'jar', we can just remove those tags from the POM. Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Fix undetected runtime dependency usage problem from previous commitAlexander Kriegisch2021-04-121-0/+17
| | | | | | | | | In module 'tests', our tests need Ant launcher. Hence, dependency ant:ant-launcher was re-added to the POM (with test scope this time) and Maven Dependency plugin configured to regard it as a used dependency and not falsely report it as unused. Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Clean up Maven dependencies using 'dependency:analyze' goalAlexander Kriegisch2021-04-121-32/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | Notably, this change involves a partial revert of @4a5660b3, because we are not using JUnit Jupiter yet but still JUnit 4 tests. See discussion under commit at https://github.com/eclipse/org.aspectj/commit/4a5660b3. Many other warnings - concerning both used undeclared and unused declared dependencies - were eliminated by adding or removing the corresponding dependencies from the POMs. Furthermore, I tried to make sure that some clearly test-scoped dependencies are now actually declared as such, so as to avoid unwanted transitivity bleeding into compile scope and maybe unwanted classes ending up in uber JARs via Maven Shade or Maven Assembly. TODO: I am not so sure why modules other than 'run-all-unit-tests' would depend on test JARs. I hope I broke nothing essential there. As of today, the other modules where I found '<type>test-jar</type>' dependencies are: - ajde - testing - testing-drivers - tests - weaver Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Switch from 'libx' to 'lib', delete all obsolete binariesAlexander Kriegisch2021-04-102-2/+2
| | | | | | | | | | | | | | | | | | | | Because 'cd lib && mvn compile' can now download and (un)zip many previously SCM-committed third-party dependencies, the following 'lib' subdirectories have been deleted: - ant - asm - commons - jarjar - junit - regexp - saxon This one is new (but not stored in SCM): - jdtcore-aj For each of them, there now is a .gitignore entry, so as to prevent developers from accidentally committing the downloaded binaries again. Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Clean up remaining references to system-scoped dependenciesAlexander Kriegisch2021-04-101-17/+0
| | | | | | | | Now there is no system-scoped dependency left anymore in the Maven build, i.e. the corresponding warnings are gone and we can focus on the actual build log. Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Remove JRockit LTW support, particularly JRockitAgentAlexander Kriegisch2021-04-101-56/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | In two places, the documentation now contains this text: "Since AspectJ 1.9.7, the obsolete Oracle/BEA JRockit agent is no longer part of AspectJ. JRockit JDK never supported Java versions higher than 1.6. Several JRockit JVM features are now part of HotSpot and tools like Mission Control available for OpenJDK and Oracle JDK." The decision to drop JRockit support was made during a discussion between Alexander Kriegisch and Andy Clement: Andy Clement wrote on 26 Mar 2021: > Yes I think so. > > > Alexander Kriegisch wrote on 26 Mar 2021: > >> https://en.wikipedia.org/wiki/JRockit >> >> Can we get rid of that? AspectJ requires Java 8, JRockit never >> supported more than Java 6. Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* POM cosmetics, e.g. plugin version managementAlexander Kriegisch2021-04-091-0/+7
| | | | Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Improve 2 tests do delete temporary filesAlexander Kriegisch2021-04-091-8/+13
| | | | | | | | | There were some problems in file handling: One file in was not deleted in case an exception was thrown during the test. Another case was a JarFile which was not closed before deletion, which might work on Linux, but not on Windows where the open file is still locked after usage. Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Module 'asm-renamed' now deploys to GitHub PackagesAlexander Kriegisch2021-04-091-5/+2
| | | | | | | | | | | This means that instead of a system-scoped dependency we now have a regular one. The 'libx' module also downloads binary and source JARs redundantly into the libraries directory in order to be found there by other scripts and tests. Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Replace JDT Core system dependency by deployed oneAlexander Kriegisch2021-04-093-39/+36
| | | | | | | | | | Get rid of system paths. Instead, rely on JDT Core Shadows to deploy both binary and source JARs to GitHub Packages. The former module directory was deleted completely. Instead, the JARs are redundantly copied into 'libs/jdtcore-aj' in order to be found there by tests and other Ant scripts. Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Remove ASM 2.0 dependency from AtAjLTWTests::testLTWUnweavableAlexander Kriegisch2021-03-292-28/+25
| | | | | | | | | | | | | | | | | | | | The test class UnweavableTest used ASM 2.0 API. I upgraded in two ways: 1. Now the ASM 9.1 API is used. Probably works with much older versions too (just not as old as 2.0), as long as the method and constructor signatures are the same). 2. The class now uses the AspectJ version of ASM (i.e. package names aj.org.objectweb.asm.*) and therefore can just use ASM as it is on the classpath for module 'tests' already. There is no more need to manually add '<pathelement path="${aj.root}/lib/asm/asm-2.0.jar"/>' to the Ant build script for that test. Consequently, asm-2.0.jar can be eliminated from Git SCM completely, because it was only used in this one test. BTW, I also removed some deprecated API and other types of warnings in UnweavableTest. Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Replace system-scoped dependency on commons by granular dependenciesAlexander Kriegisch2021-03-291-0/+2
| | | | | | | | | | | | There are only two direct dependencies used in AspectJ code: - Commons Digester (module 'testing') - Commons Logging (module 'org.aspectj.matcher') I declared those two and experimentally removed all the other system-scoped dependencies, as it should be. Let's see if the build works with transitive dependencies. Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Replace Ant and Xerces system-scopes libraries by normal dependenciesAlexander Kriegisch2021-03-291-6/+4
| | | | Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Make all tests run on Java 16 via '-add-opens' JVM optionjava16-add-opensAlexander Kriegisch2021-03-2310-117/+186
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* Revert "Remove module 'run-all-junit-tests' from root POM -> speed up the build"Alexander Kriegisch2021-03-231-1/+1
| | | | | | This reverts commit a1867b05ba6443d32abc4049c26b92fc226d6f78. 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>
* Remove module 'run-all-junit-tests' from root POM -> speed up the buildAlexander Kriegisch2021-03-211-1/+1
| | | | | | | | | | | | | This module must be a relic from a test runner module once existing during the Ant build era, but transferred and kept alive in the Maven build. Actually, it almost doubles build time by running virtually all tests in all modules again when doing 'mvn test' from the project root. For now I only removed the module from the root POM, leaving behind comments there, in the module POM and in the now @Deprecated class RunTheseBeforeYouCommitTests. 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-1717-17/+490
| | | | | | Also fix some minor details in Java 14 suite Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Add 'yield' usage to Java 12/13 switch expressions testsAlexander Kriegisch2021-03-173-19/+28
| | | | | | | So far this was a slight oversight, no test using 'yield' existed in the 'features193' test suite. Better late than never. 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-178-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>
* Upgrade to ASM 9.1, delete obsolete ASM binariesAlexander Kriegisch2021-03-161-1/+1
| | | | | | | | | | | Keep only ASM 2.0 binary because it is still used in UnweavableTest which uses an old ASM API, e.g. with a ClassWriter constructor which no longer exists. Also add JarJar 1.3 library because it is needed by an Ant task in lib/asm/build.xml. 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-1414-314/+368
| | | | | | | | | 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>
* Improve text matching in OutputSpec, fixing some failing Windows testsAlexander Kriegisch2021-03-142-2/+2
| | | | | | | | | | | | | | | | | | Some Java 14 text block tests failed on Windows because a StringTokenizer was used to split by LF, but the Windows line separator is CR+LF. Because a multi-line string ending with CR+LF is printed via 'System.out.println' in the test code, another CR+LF is added to the output, resulting in trailing CR+LF+CR+LF. Hence, between the two LFs, the tokenizer actually found an additional line consisting of CR (only on Windows, of course). Despite each line token actually containing a trailing CR token, that did not matter much because 'String.trim' was used everywhere before comparing values. Anyway, the improved OutputSpec uses text.trim().split("\\s*\n\\s*"), which takes care of leading/trailing whitespace both around the whole output and for each separate line. 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>
* Try to fix MultiProjectIncrementalTests.testAspectPath_pr265693Alexander Kriegisch2021-03-111-1/+1
| | | | | | | | Check if path vs. package name discrepancy makes test fail on Linux. On Windows it passes. So let's find out if file p/Asp.java vs. pkg.Asp causes the problems. 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>
* Fix misplaced or incorrect javadoc tagsJerry James2020-09-142-2/+2
|
* Revert to 1.9.7.BUILD-SNAPSHOTAndy Clement2020-08-211-1/+1
|
* 1.9.7 milestone 1 publishedAndy Clement2020-08-211-1/+1
|
* Merge pull request #10 from larsgrefer/cleanup/pomAndy Clement2020-08-161-1/+0
|\ | | | | Cleanup the Maven pom.xml files
| * Remove project.parent.relative path as ../pom.xml is already the defaultLars Grefer2020-08-151-1/+0
| | | | | | | | Signed-off-by: Lars Grefer <eclipse@larsgrefer.de>
* | 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>
* | Redundant Collection.addAll() callLars Grefer2020-08-151-2/+1
| | | | | | | | | | | | Reports Collection.addAll() and Map.putAll() calls after instantiation of a collection using a constructor call without arguments. Such constructs can be replaced with a single call to a parametrized constructor which simplifies code. Also for some collections the replacement might be more performant. Signed-off-by: Lars Grefer <eclipse@larsgrefer.de>