Java Test
| This documentation was generated with the assistance of AI. Please report any inaccuracies. |
Run a JVM (Java or Kotlin) project’s JUnit test suite through the Maven Surefire plugin (mvn test) or the Gradle
test task (./gradlew test --tests '<pattern>'), scoped to whatever the caller asked for — everything, a single
class, a single method, a wildcard/package pattern, or a tag expression. This is a read-only reporting skill: it runs
tests and summarizes the outcome, it does not fix failures unless asked to as an explicit follow-up.
Purpose
iru-java-test turns a loosely-specified request ("run the FooTest", "just the fast tests", "everything") into the
correct invocation for the detected build tool and a concise pass/fail summary. It covers plain Java/Kotlin
libraries, Spring Boot (Java or Kotlin), and Quarkus (Java or Kotlin). It exists so that running and narrowing down
tests doesn’t require hand-composing -Dtest/-Dgroups/--tests syntax each time, and so that a calling skill (or a
human) gets back a short report instead of a full raw build log.
When the Kotlin Multiplatform plugin is applied anywhere in the build, the skill stops and points to KMP Test instead.
Plugin
Shipped by the iru-java plugin of the ai-catalog marketplace (install with /plugin install iru-java@ai-catalog; see Plugins).
Inputs
| Argument | Required | Description | Default |
|---|---|---|---|
|
No |
Names what to run: a test class ( |
None — omitting it runs the full unit suite ( |
The build tool is detected first: pom.xml means Maven (./mvnw allowed when mvn is absent); settings.gradle(.kts)
or build.gradle(.kts) without a pom.xml means Gradle (wrapper preferred, system gradle only as a stated
fallback); when both exist the CI workflow decides, and if that doesn’t settle it the user is asked once. An Android
Gradle plugin means the project is Android and iru-android-test is the right skill instead. Multi-module builds are
scoped to the named module(s) (-pl <module> -am for Maven, :<module>:test for Gradle).
Maven selectors map to Surefire parameters as follows:
| What the user wants | Parameter | Example |
|---|---|---|
Everything |
(none) |
|
One test class |
|
|
One method in a class |
|
|
Several methods in one class |
|
|
Several classes |
|
|
Classes matching a name pattern |
|
|
All classes in a package |
|
|
Excluding some classes/methods |
|
|
Tests tagged with a JUnit 5 |
|
|
Excluding a JUnit 5 tag |
|
|
Tag boolean expression |
|
|
Gradle selectors map to --tests filters, always placed immediately after the test task they filter:
| What the user wants | Parameter | Example |
|---|---|---|
Everything |
(none) |
|
One test class |
|
|
One method in a class |
|
|
Several classes/methods |
repeat |
|
Name or package pattern |
|
|
One module only |
prefix the task path |
|
Several modules |
list each task plus |
|
A Maven-style selector passed by a caller is translated (FooTest#method becomes --tests 'FooTest.method').
Exclusions and JUnit 5 tag expressions have no Gradle command-line flag: the skill looks for a project property wired
to them and, if none exists, tells the user the filter cannot be applied without editing the build script (which it
never edits itself) and offers the closest class/package selector. A selector matching nothing fails the build in
both tools ("No tests matching pattern…" / "No tests found for given includes"); the no-match-is-fine flags are only
added when the user explicitly asks. --rerun (Gradle 7.6+) or cleanTest is used only when a re-run of an
up-to-date scope is actually wanted.
Kotlin notes: test sources in src/test/kotlin use the same selectors. Backtick method names compile to names with
spaces, so the whole selector is single-quoted (--tests 'FooTest.should parse input',
-Dtest='FooTest#should parse input'); if such a name does not resolve, the skill widens to a wildcard on a
distinctive prefix and says so in the report.
Quarkus notes: @QuarkusTest classes are ordinary Surefire/test-task tests, but boot the application (slower).
They may start Dev Services containers, which need a Docker/Podman daemon; a "Docker is not running"-style failure is
reported as an environment failure, not a test failure, and Dev Services are disabled only if asked
(-Dquarkus.devservices.enabled=false for Maven, the QUARKUS_DEVSERVICES_ENABLED=false environment variable for
Gradle). @QuarkusIntegrationTest/*IT classes (and Testcontainers-backed Spring Boot *IT classes) are not part of
the default run — they only run, under mvn verify or the Gradle quarkusIntTest/integrationTest task, on
explicit request. ./gradlew build/check and mvn verify are never used for a plain unit-test request.
Outputs
-
A plain-text summary in the conversation — never a written file.
-
Total tests run, failures, errors, and skipped counts — from Surefire’s totals line for Maven, or from the JUnit XML under
build/test-results/test/(parsed with a shortpython3snippet) for Gradle, whose console only lists failures. -
If everything passed: a brief confirmation, without pasting the full log.
-
If there are failures/errors: the failing test names and the relevant assertion/exception output (from
target/surefire-reports/*.txtor the<failure>/<error>element of the matching Gradle XML if the console output was truncated) — without unrelated passing-test noise. -
Environment failures (Docker/Dev Services/Testcontainers unavailable) reported separately from genuine test failures, naming the test classes that could not run.
-
No source or test code (and no build script) is ever modified.
Execution flow
Dependencies
Invokes
None — iru-java-test is a leaf skill; it only runs Maven/Gradle commands and reports on their output, it does not
call any other skill in this catalog (it points Android projects at iru-android-test but does not invoke it).
It also points Kotlin Multiplatform projects at KMP Test but does not invoke it.
Invoked by
-
Java Code One Task Group — Step 3, once per task group’s bucket, via the
iru-gate-runneragent, to run the scoped tests for every class the bucket affected (falling back tomvn test -Dtest=<TestClass>directly if this skill is unavailable), plus a full-suite run. -
Kotlin Spring Boot Code One Task Group — Step 3.4 and 3.6, scoped and full unit suites, via the
iru-gate-runneragent. -
Quarkus Code One Task Group — Step 3.4, 3.6 and 3.8, scoped, full unit-stage and container-stage tests, via the
iru-gate-runneragent. -
Java Generate All Tests — Step 7, once, to confirm the full suite still passes after every class’s tests have been written or extended; also delegated through
iru-gate-runner. -
Java Spring Boot Code One Task Group — Steps 3.4 and 3.6, via
iru-gate-runner, told the module scope for the scoped run and given no selector for the reactor-wide one. Falls back tomvn test -DskipITsonly if the skill isn’t installed.
Related agents
-
iru-gate-runner— calling skills invoke this skill from inside aniru-gate-runnersub-agent they spawn, not inline.
Source
SKILL.md on GitHub — the file this page was generated from.