https://github.com/t1/test-tools
Collection of test utility classes
https://github.com/t1/test-tools
Last synced: about 1 year ago
JSON representation
Collection of test utility classes
- Host: GitHub
- URL: https://github.com/t1/test-tools
- Owner: t1
- License: apache-2.0
- Created: 2015-11-07T12:30:08.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2023-06-15T06:22:12.000Z (about 3 years ago)
- Last Synced: 2023-07-27T17:24:52.418Z (almost 3 years ago)
- Language: Java
- Homepage:
- Size: 121 KB
- Stars: 2
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# test-tools [](https://search.maven.org/artifact/com.github.t1/test-tools)
Collection of test utility classes:
* Subclass `AbstractPackageDependenciesTest` and annotate your packages with `@DependsUpon` to check dependencies between packages.
* Declare a `@Rule` with `FileMemento` to restore a file after the test.
* Overwrite and restore system properties with the `SystemPropertiesRule`.
* Declare a generic `MementoRule` for arbitrary things to restore, using a `Supplier` and a `Consumer`.
* Log the beginning and end of a test run, by declaring a `TestLoggerRule`.
# Compatibility with JDK-9+
The `AbstractPackageDependenciesTest` depends on classes from the `jdeps` tool in JDK 8 residing in the `tools.jar`.
This file has been removed in JDK 9 and the jdeps classes where moved into the module `jdk.jdeps`,
but without exporting the classes, so we can't just add a `module-info.java`.
This may become a problem in the future, but for now, we can live with a Maven profile, so building works on JDK8 and 9.