aboutsummaryrefslogtreecommitdiffstats
path: root/testing
Commit message (Collapse)AuthorAgeFilesLines
* Set version to 1.9.20-SNAPSHOTAlexander Kriegisch2022-12-211-1/+1
|
* AspectJ release 1.9.19V1_9_19Alexander Kriegisch2022-12-211-1/+1
|
* OutputSpec.matchesThisVm better supports version rangesAlexander Kriegisch2022-10-051-21/+26
| | | | | | | | | | | | | | | | | | | | 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>
* Add the first few Java 19 testsAlexander Kriegisch2022-10-032-0/+67
| | | | | | | | | | 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>
* Cosmetic fixes in Java 18 tests (e.g. copyright year 2022)Alexander Kriegisch2022-10-032-2/+2
| | | | Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Do not run Java 18 preview feature tests with Java 19 JDT CoreAlexander Kriegisch2022-10-031-2/+2
| | | | Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Set Maven version to 1.9.19-SNAPSHOTAlexander Kriegisch2022-10-021-1/+1
| | | | | | | It makes sense to indicate the Java version in the minor-minor of AspectJ artifacts. 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>
* Set version to 1.9.10-SNAPSHOTAlexander Kriegisch2022-03-311-1/+1
| | | | Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Release AspectJ version 1.9.9.1V1_9_9_1Alexander Kriegisch2022-03-311-1/+1
| | | | Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Revert "Fix more LTW tests"Alexander Kriegisch2022-03-311-2/+2
| | | | This reverts commit 63d5e3e893bd149245465de1610716930998dec8.
* Set version to 1.9.10-SNAPSHOTAlexander Kriegisch2022-03-241-1/+1
| | | | Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Set version to 1.9.9V1_9_9Alexander Kriegisch2022-03-241-1/+1
| | | | Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Merge branch 'master' into java-18Alexander Kriegisch2022-03-232-1/+7
|\ | | | | | | | | | | # Conflicts: # tests/src/test/java/org/aspectj/systemtest/ajc198/Bugs198Tests.java # tests/src/test/resources/org/aspectj/systemtest/ajc198/ajc198.xml
| * RunSpec: allow '<stdout ordered="no">'Alexander Kriegisch2022-03-232-1/+7
| | | | | | | | | | | | | | Previously 'ordered="no"' was only permitted for 'stderr'. We need this for tests with asynchronous log output on standard error. Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* | Fix more LTW testsAlexander Kriegisch2022-03-231-2/+6
| | | | | | | | Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* | Use '-Djava.security.manager=allow' on Java 18+ (JEP 411)Alexander Kriegisch2022-03-231-0/+3
| | | | | | | | | | | | | | | | | | | | JEP 411: Deprecate the Security Manager for Removal, see https://openjdk.java.net/jeps/411. As of Java 18, the new API for blocking System.exit is not available yet, see https://bugs.openjdk.java.net/browse/JDK-8199704. Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* | Prepare code, tests and docs for Java 18Alexander Kriegisch2022-03-213-3/+70
|/ | | | | | | | | | | | | | | | | | | | - 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>
* Set version to 1.9.9-SNAPSHOTAlexander Kriegisch2022-02-111-1/+1
|
* Set version to 1.9.8V1_9_8Alexander Kriegisch2022-02-111-1/+1
|
* Merge pull request #103 from turbanoff/redundant_boxingAndy Clement2021-12-134-5/+5
|\ | | | | Cleanup redundant boxing.
| * Cleanup redundant boxing.Andrey Turbanov2021-11-204-5/+5
| | | | | | | | | | Methods Integer.parseInt/Boolean.parseBoolean should be preferred over Integer.valueOf/Boolean.valueOf/ if final result is primitive. They are generally faster and generate less garbage.
* | Merge pull request #101 from turbanoff/use_StringBuilder_instead_of_StringBufferAndy Clement2021-11-3021-29/+29
|\ \ | | | | | | Replace uses of StringBuffer with StringBuilder.
| * | Replace uses of StringBuffer with StringBuilder.Andrey Turbanov2021-11-2021-29/+29
| |/ | | | | | | StringBuffer is a legacy synchronized class. StringBuilder is a direct replacement to StringBuffer which generally have better performance.
* / According to javadoc File.isDirectory 'true' if and only if the file denoted ↵Andrey Turbanov2021-11-201-3/+2
|/ | | | | | by this abstract pathname exists and is a directory. It means that separate File.exists() check before File.isDirectory() check is redundant.
* Set version to 1.9.8-SNAPSHOTAlexander Kriegisch2021-10-081-1/+1
|
* Release version to 1.9.8.RC1V1_9_8_RC1Alexander Kriegisch2021-10-081-1/+1
| | | | Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Add + activate some Java 17 testsAlexander Kriegisch2021-09-072-2/+4
| | | | | | | | | | | | | - 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-072-0/+4
| | | | Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Remove logging dots per test step in AjcTest.runTestAlexander Kriegisch2021-08-081-2/+1
| | | | | | | | | | | Methods AjcTest.runTest was logging something like "TEST: ...." (4 dots), i.e. one dot per performed test step. Not only did this not add much value, but due to usage of PrintStream.print for line continuation it also messed up test step logging by scattering seemingly random dot characters across test step logs. This looked quite ugly, so I simply removed it. Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Add AspectJ 1.9.7 and Java 17 test skeletonsAlexander Kriegisch2021-06-262-0/+66
| | | | Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Set version to 1.9.8-SNAPSHOTAndy Clement2021-06-241-1/+1
|
* 1.9.7 releaseV1_9_7Andy Clement2021-06-241-1/+1
|
* Upgrade license from CPLv1/EPLv1 to EPLv2Alexander Kriegisch2021-06-04114-2011/+2011
| | | | | | | This was required by the Eclipse team as one precondition for the next release. Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Use canonical snapshot version 1.9.7-SNAPSHOTAlexander Kriegisch2021-05-231-1/+1
| | | | | | | | | Before, we used 1.9.7.BUILD-SNAPSHOT, which according to Andy Clement was originally an intent across a group of Spring projects he was involved in, to ensure that SNAPSHOTS were sorted alphabetically ahead of MILESTONEs and ahead of RCs. Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Replace use of ASM-renamed by original ASMAlexander Kriegisch2021-05-161-2/+2
| | | | | | | | | | | | This involves replacing references in weaver application code as well as a few tests. In order to make AspectJ weaver + tools contain a relocated ASM version, I added a Maven Shade relocation step after Maven Assembly created the uber JARs. Relocation works for both binaries and sources and also encompasses Class::forName calls like in class AsmDetector. Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Remove jdiffAndy Clement2021-05-141-146/+0
|
* 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>
* Remove some cruft from test classes Ajc, AjcTestCase, AntSpecAlexander Kriegisch2021-04-161-28/+18
| | | | Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Remove redundant 'name' and 'packaging' tags from POMsAlexander Kriegisch2021-04-151-2/+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>
* Clean up Maven dependencies using 'dependency:analyze' goalAlexander Kriegisch2021-04-121-28/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* Replace JDiff by regular Maven dependency from GitHub PackagesAlexander Kriegisch2021-04-101-7/+0
| | | | | | One less SCM-committed binary, one less system-scoped dependency. Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Replace JDT Core system dependency by deployed oneAlexander Kriegisch2021-04-091-3/+0
| | | | | | | | | | 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>
* Get rid of some Maven warnings concerning plugins + dependenciesAlexander Kriegisch2021-03-301-1/+0
| | | | | | Duplicate dependencies, missing or mismatching versions Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Replace system-scoped dependency on commons by granular dependenciesAlexander Kriegisch2021-03-291-5/+3
| | | | | | | | | | | | 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-18/+14
| | | | Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Add POM to download libs (WIP) which previously were committed to SCMAlexander Kriegisch2021-03-291-17/+22
| | | | Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Make all tests run on Java 16 via '-add-opens' JVM optionjava16-add-opensAlexander Kriegisch2021-03-232-10/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 some deprecated Java and JUnit warnings by using newer API callsAlexander Kriegisch2021-03-214-4/+3
| | | | Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Fix + improve some tests regarding Ajc output (usage messages etc.)Alexander Kriegisch2021-03-211-1/+4
| | | | | | | | | After Ajc usage text output is filtered into its own category IMessage.USAGE now - see commit @31b2d60b - some tests in module 'org.aspectj.ajdt.core' were failing. I fixed and also improved them a bit. Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>