java_fast_test
Run selected Java tests in Maven or Gradle projects with incremental compilation, returning results or a background run ID for continued tracking.
Instructions
Run selected Java tests in Maven or Gradle projects, incrementally compiling changed sources. Supports JUnit 4/5 and TestNG. No application launch is required, and an existing application is left running. Provide project_path and tests (Class or Class#method); action defaults to run. First-time preparation and compilation can take minutes; subsequent calls reuse unchanged results. Waits up to timeout (maximum 30 seconds); unfinished work returns its test_run_id and continues in the background. Observe it with java_status or cancel it here using action='cancel' and the same test_run_id. If compilation fails before run returns, it includes compiler diagnostics directly. java_status stays compact; use action='result' with test_run_id for background error diagnostics and failed-test details without rerunning tests. This is not the complete Maven/Gradle verification or packaging lifecycle.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| tests | No | Explicit Fast Test selectors as fully qualified Class or Class#method. Fast Test v1 supports JUnit 4/5 and TestNG. | |
| action | No | Omit or use run to execute tests; use result with test_run_id to read diagnostics and failure details without rerunning; use cancel to stop that test run. | run |
| timeout | No | Seconds to wait for this test result: default 30, values above 30 wait only 30, zero submits immediately. Expiry leaves the same task running. This controls how long the call waits, not the test execution time limit. | |
| test_run_id | No | Test run ID returned by java_fast_test; required for action='cancel' or 'result'. Results are retained for the active and most recently finished run in this MCP session. | |
| build_system | No | Optional authoritative build system for tests; specify maven or gradle when both exist. | |
| project_path | No | Maven project or Gradle Wrapper project directory containing the selected tests. No IDEA launch configuration or running application is required. | |
| source_files | No | Optional changed Java source paths relative to project_path, including module prefixes. May include added, edited, or deleted main/test files. Normally omit: changes are detected automatically. |