IntelliJ plugin as extension to
cronn's validation file assertion library.
Compare and accept output and validation files without context switches.
Further features:
- Rename related validation files when methods or classes are renamed
- Jump to related validation file from code and vice-versa
Go to File/IntelliJ IDEA | Settings | Plugins, search in tab Marketplace
for Validation-File Comparison
and click on install.
Execute tests which use validation files, open the test itself or open the production code for it and run the the
action Validation-File Comparison
.
You can find the action using ...
- IntelliJ's Find Action (
Ctrl+Shift+A
/⇧⌘A
) and search forValidation File Comparison
- View | Validation-File Comparison
- Right Click | Validation-File Comparison
- Or the default shortcut
Alt+Shift+V
/⌥⇧V
This plugin finds the corresponding (sub-)module for the current dialog and compares the two directories
[SUBMODULE-PATH]/data/test/validation
and [SUBMODULE-PATH]/data/test/output
, which are the default directories
for validation file assertion library.
When renaming a test with validation files the validation and output files will be suggested for renaming as well.
Simply use the rename refactoring of intellij (Shift+F6
/ ⇧F6
) and apply the suggested renaming as wished.
To disable this feature simply trigger the keybinding for the renaming twice and deselect "Rename validation and output files".
Similar to IntelliJ's build-in action for switching between tests and implementations, it is possible to directly jump into the according validation file from a test and back. Simply press the default shortcut Alt+Shift+F
/⌥⇧F
and the according file is opened at the relevant position. If there are multiple possible targets, a selection window with all targets is presented. This action can be used from within a test method as well as for the whole test class. When used from a validation file, it finds the deepest possible code target to jump to, also regarding nested test classes and methods with multiple validation files.
As for every IntelliJ action, you can configure your own shortcut for the Validation-File Comparison
action.
Simply go to File/IntelliJ IDEA | Settings | Keymap , search
for Validation-File Comparison
and configure a new shortcut.
The behavior of the action can be configured in the dedicated settings dialog under File/IntelliJ IDEA | Settings | Tools | Validation-File Comparison Plugin.
./gradlew build
./gradlew runIde
./gradlew runPluginVerifier
If new readme sections regarding the usage of the plugin are added or existing ones are updated, make sure to also
adjust the <description>
in the plugin.xml
.
Ideally generate html
content from this markdown file to ensure equal content (e.g. https://markdowntohtml.com/).
Publishing is done using the publishPlugin
gradle task (using a valid access token) as described in the documentation.
./gradlew publishPlugin -Dorg.gradle.project.intellijPublishToken="<YOUR_TOKEN>"