aboutsummaryrefslogtreecommitdiffstats
path: root/testing
Commit message (Collapse)AuthorAgeFilesLines
* 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>
* Add Java 16 test suite for AspectJ 1.9.7 + test refactoringsAlexander Kriegisch2021-03-2111-42/+95
| | | | | | | | | | | | | | | - 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 test relying on JVM warning being stripped from outputAlexander Kriegisch2021-03-201-5/+3
| | | | | | | | | | | | | | | | 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>
* Improve usage text, error and warning output in batch compilerAlexander Kriegisch2021-03-201-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | - Usage texts are now printed to stdOut, no longer stdErr. - 'java ...Main -?' no longer prints usage text twice (once to stdOut and then again to stdErr). - AjdtCommand.inferKind: Usage texts are no longer mis-identified as warnings or errors just because they contain substrings "warning" or "error". Matching is now more precise, looking for "[warning]" and "[error]". But in that case the method would not be called anyway because errors and warnings are identified in other ways already. As a fall-back, the categories IMessage.ERROR and IMessage.WARNING still exist in the method. - In case of compile errors, no usage message is printed anymore, because previously the user had to scroll up a lot in order to see the actual messages. This is also in line with ECJ. The same is true for warnings, but it was like this in Ajc already. - AjdtCommand.inferKind: There is a new category IMessage.USAGE especially for AspectJ usage texts, which will be identified by string matching and then correctly handled (i.e. printed to stdOut, not stdErr). - Usage text printing is no longer done in AspectJ but in the AspectJ "shadows" fork of JDT. This helps to get rid of some now obsolete code here. Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Add Java 15 / AspectJ 1.9.7 test suiteAlexander Kriegisch2021-03-171-0/+39
| | | | | | 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/+7
| | | | | | | | | | | | | | | | 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>
* Add Java 15 class vile version to BCEL constants, adjust test tools etc.Alexander Kriegisch2021-03-162-30/+45
| | | | Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Fix outdated ajcTestSuite.dtd and lots of XML problemsAlexander Kriegisch2021-03-141-83/+82
| | | | | | | | | 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>
* Fix OutputSpec corner case (test empty output) from @052bd66fAlexander Kriegisch2021-03-141-1/+2
| | | | 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-141-0/+31
| | | | | | | | | | | 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-141-25/+20
| | | | | | | | | | | | | | | | | | 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-143-48/+48
| | | | Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Fix: WeaveSpec no longer ignores the '-Xlintfile' parameterAlexander Kriegisch2021-03-121-18/+23
| | | | | | | | | | | | | | | | | | | Some tests in ajc150.xml and ajc190_from150.xml contain '<weave ...>' build steps with 'xlintfile="..."' parameters. Those parameters were passed through to Java and aspect code building steps, but not to the final weaving step, sometimes leading to spurious "type not exposed to weaver" warnings which occurred for some local and CI builds, but not always. Very strange indeed. Anyway, by making method WeaveSpec.buildWeaveArgs() pass on this parameter, the tests seem to run reliably now. TODO: Why does Ajc report that warning if the application JAR is on the inpath and the aspect JAR is on the aspectpath? Is it because a marker annotation is defined within the aspect JAR? But actually, that should not matter, especially not work once and fail at other times. I guess there is a class loading order problem or similar involved. Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Unify classpath handling in CompileSpec & RunSpecAlexander Kriegisch2021-03-112-11/+7
| | | | | | | | | | | | | Replace directory separator '/' and surrogate path separator ',' by platform-specific separators File.separatorChar and File.pathSeparatorChar, respectively. Also make sure that replacement occurs during write access, not read access. This was handled differently in both sibling classes. I am not sure if that helps to fix any Linux CI tests, but it is worth a try. Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Revert to 1.9.7.BUILD-SNAPSHOTAndy Clement2020-08-211-1/+1
|
* 1.9.7 milestone 1 publishedAndy Clement2020-08-211-1/+1
|
* Remove unnecessary interface modifiersLars Grefer2020-08-179-242/+242
| | | | Signed-off-by: Lars Grefer <eclipse@larsgrefer.de>
* polishAndy Clement2020-08-163-194/+197
|
* 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>
* | Merge branch 'master' into feature/collection-performanceAndy Clement2020-08-1516-20/+4
|\ \
| * | Cleanup unused importsLars Grefer2020-08-1618-18/+0
| | | | | | | | | | | | Signed-off-by: Lars Grefer <eclipse@larsgrefer.de>
| * | Update to JUnit 4.13Lars Grefer2020-08-154-7/+4
| |/ | | | | | | Signed-off-by: Lars Grefer <eclipse@larsgrefer.de>
* | Weaken Collection declarationsLars Grefer2020-08-1525-72/+68
| | | | | | | | | | | | 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-157-30/+17
| | | | | | | | | | | | 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>
* | Collection.toArray() call styleLars Grefer2020-08-151-1/+1
| | | | | | | | | | | | | | There are two styles to convert a collection to an array: either using a pre-sized array (like c.toArray(new String[c.size()])) or using an empty array (like c.toArray(new String[0]). In older Java versions using pre-sized array was recommended, as the reflection call which is necessary to create an array of proper size was quite slow. However since late updates of OpenJDK 6 this call was intrinsified, making the performance of the empty array version the same and sometimes even better, compared to the pre-sized version. Also passing pre-sized array is dangerous for a concurrent or synchronized collection as a data race is possible between the size and toArray call which may result in extra nulls at the end of the array, if the collection was concurrently shrunk during the operation. Signed-off-by: Lars Grefer <eclipse@larsgrefer.de>
* | Manual array copyLars Grefer2020-08-151-6/+2
| | | | | | | | | | | | Reports the manual copying of array contents which may be replaced by calls to System.arraycopy(). Signed-off-by: Lars Grefer <eclipse@larsgrefer.de>
* | Collections.sort() can be replaced with List.sort()Lars Grefer2020-08-153-5/+5
| | | | | | | | | | | | Reports calls to Collections.sort(list, comparator) which could be replaced with list.sort(comparator). Signed-off-by: Lars Grefer <eclipse@larsgrefer.de>
* | Manual array to collection copyLars Grefer2020-08-153-16/+4
|/ | | | | | Reports the copying of array contents to a collection where each element is added individually using a for loop. Such constructs may be replaced by a call to Collection.addAll(Arrays.asList()) or Collections.addAll(). Signed-off-by: Lars Grefer <eclipse@larsgrefer.de>
* Merge branch 'master' of github.com:eclipse/org.aspectj into ↵Lars Grefer2020-08-142-5/+6
|\ | | | | | | remove-old-version-checks
| * Attempting to get J11 build happy at githubAndy Clement2020-08-131-4/+0
| |
| * Making tests behave on 11Andy Clement2020-08-131-1/+6
| |
* | Simplify checks for Java 8 to trueLars Grefer2020-08-141-1/+1
| | | | | | | | Signed-off-by: Lars Grefer <eclipse@larsgrefer.de>
* | Remove checks for old Java VersionsLars Grefer2020-08-131-4/+4
|/ | | | Signed-off-by: Lars Grefer <eclipse@larsgrefer.de>
* Use the diamond operator where possibleLars Grefer2020-08-1317-48/+48
| | | | Signed-off-by: Lars Grefer <eclipse@larsgrefer.de>
* Unnecessary unboxingLars Grefer2020-08-089-10/+10
| | | | | | Reports "unboxing", e.g. explicit unwrapping of wrapped primitive values. Unboxing is unnecessary under Java 5 and newer, and can be safely removed. Signed-off-by: Lars Grefer <eclipse@larsgrefer.de>
* Unnecessary boxingLars Grefer2020-08-083-5/+5
| | | | | | Reports explicit boxing, i.e. wrapping of primitive values in objects. Explicit manual boxing is unnecessary under Java 5 and newer, and can be safely removed. Signed-off-by: Lars Grefer <eclipse@larsgrefer.de>
* 'String.indexOf()' expression is replaceable with 'contains()'Lars Grefer2020-08-0816-32/+32
| | | | | | Reports any String.indexOf() expressions which can be replaced with a call to the String.contains() method available in Java 5 and newer. Signed-off-by: Lars Grefer <eclipse@larsgrefer.de>
* 'for' loop replaceable with enhanced 'for' loopLars Grefer2020-08-0838-810/+748
| | | | | | Reports for loops which iterate over collections or arrays, and can be replaced with an enhanced for loop (i.e. the foreach iteration syntax). Signed-off-by: Lars Grefer <eclipse@larsgrefer.de>
* PolishAndy Clement2020-07-221-323/+332
|
* Rev to 1.9.7.BUILD-SNAPSHOTAndy Clement2020-07-221-1/+1
|
* AspectJ 1.9.6 final bitsV1_9_6Andy Clement2020-07-221-1/+1
|
* Include JDTCore for Java14Andy Clement2020-04-204-27/+55
|
* polishAndy Clement2019-11-294-1723/+1765
|
* polishAndy Clement2019-11-2834-169/+273
|
* Move to 1.9.6.BUILD-SNAPSHOT versionAndy Clement2019-11-281-1/+1
|
* 1.9.5 release versions in pomsV1_9_5Andy Clement2019-11-281-1/+1
|
* Fix 550494Andy Clement2019-11-271-20/+19
|
* Java 13 supportAndy Clement2019-11-252-16/+50
|