Adds Java and Kotlin editor support for the TableTest table language used in data-driven JUnit tests.
TableTest expresses test cases as readable tables, where each column is an input or expected output and each row is a test case. This plugin makes those tables easier to read, edit, and maintain in IntelliJ IDEA.
- Configurable syntax highlighting colours for headers, values, separators, comments, and invalid values
- Smart auto-formatting for table indentation, row/column alignment, and value separators
- Configurable value spacing rules in
Code Style > TableTest > Spaces - Language injection for
@TableTestin Java and Kotlin files - Row move shortcuts and comment toggle support
Here's what a TableTest looks like in your Java or Kotlin test:
@TableTest("""
a | b | sum?
1 | 2 | 3
5 | 3 | 8
""")
void testAddition(int a, int b, int sum) {
assertThat(a + b).isEqualTo(sum);
}The plugin provides:
Syntax Highlighting: Different colours for headers (a, b, sum?), delimiters (|), and values
Auto-Formatting: Press Ctrl+Alt+L (Windows/Linux) or Cmd+Option+L (macOS) to align columns:
// Before formatting:
a | b | sum?
1 | 2 | 3
500 | 300 | 800
// After formatting:
a | b | sum?
1 | 2 | 3
500 | 300 | 800Automatic Language Injection: When you use @TableTest annotations, the plugin automatically provides TableTest language support. No manual configuration needed. It also recognizes these methods as test entry points to suppress "Unused declaration" warnings.
A TableTest table consists of:
- Header row: Column names defining test parameters
- Add
?suffix for expected output columns (e.g.,sum?)
- Add
- Data rows: Test case values
The plugin supports various value types:
- Simple values:
1,true,hello - Quoted strings:
"text with spaces"(supports escaped quotes:"contains \"escaped\" quotes") - Lists:
[1, 2, 3] - Sets:
{a, b, c} - Maps:
{key: value, foo: bar}
| Action | Windows/Linux | macOS |
|---|---|---|
| Format table | Ctrl+Alt+L |
Cmd+Option+L |
| Comment/uncomment | Ctrl+/ |
Cmd+/ |
| Move row up | Ctrl+Shift+Up |
Cmd+Shift+Up |
| Move row down | Ctrl+Shift+Down |
Cmd+Shift+Down |
The plugin automatically injects TableTest language support into @TableTest annotations. For development scenarios where the TableTest library isn't on your classpath yet, you can manually enable support using:
//language=tabletest
String table = """
a | b
1 | 2
""";Adjust value spacing rules used by the TableTest formatter:
- Go to Settings/Preferences > Editor > Code Style > TableTest > Spaces
- Configure spacing around commas and colons, plus spaces within
[]and{} - Use the preview pane to see formatting changes while keeping columns aligned
Adjust syntax highlighting colours:
- Go to Settings/Preferences > Editor > Colour Scheme > TableTest
- Customise colours for headers, delimiters, values, and comments
- Changes apply immediately
-
Using the IDE built-in plugin system:
Settings/Preferences > Plugins > Marketplace > Search for "tabletest" > Install
-
Using JetBrains Marketplace:
Go to JetBrains Marketplace and install it by clicking the Install to ... button in case your IDE is running.
You can also download the latest release from JetBrains Marketplace and install it manually using Settings/Preferences > Plugins > ⚙️ > Install plugin from disk...
-
Manually:
Download the latest release and install it manually using Settings/Preferences > Plugins > ⚙️ > Install plugin from disk...
Plugin based on the IntelliJ Platform Plugin Template.