Java Test

This documentation was generated with the assistance of AI. Please report any inaccuracies.

Run a Java project’s JUnit test suite through the Maven Surefire plugin (mvn test), scoped to whatever the caller asked for — everything, a single class, a single method, a wildcard/package pattern, or a JUnit 5 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 Surefire invocation and a concise pass/fail summary. It exists so that running and narrowing down tests doesn’t require hand-composing -Dtest/-Dgroups syntax each time, and so that a calling skill (or a human) gets back a short report instead of a full raw Maven log.

Purpose group

Invocation

/iru-java-test
/iru-java-test <selector>

Inputs

Argument Required Description Default

selector

No

Names what to run: a test class, a class+method, several classes, a wildcard/package pattern, an exclusion, or a JUnit 5 tag expression. Mapped to the correct Surefire parameter per the table below.

None — omitting it runs the full suite (mvn test).

The selector maps to Surefire parameters as follows:

What the user wants Parameter Example

Everything

(none)

mvn test

One test class

-Dtest

mvn test -Dtest=FooTest

One method in a class

-Dtest with #

mvn test -Dtest=FooTest#testSomething

Several methods in one class

-Dtest with + between method names after #

mvn test -Dtest=FooTest#method1+method2

Several classes

-Dtest comma-separated

mvn test -Dtest=FooTest,BarTest

Classes matching a name pattern

-Dtest with * wildcard

mvn test -Dtest=*ServiceTest

All classes in a package

-Dtest with the package path and wildcard

mvn test -Dtest=com.example.pkg.**

Excluding some classes/methods

-Dtest with ! prefix (combine with other -Dtest entries via comma)

mvn test -Dtest=!SlowTest

Tests tagged with a JUnit 5 @Tag

-Dgroups

mvn test -Dgroups="fast"

Excluding a JUnit 5 tag

-DexcludedGroups

mvn test -DexcludedGroups="slow"

Tag boolean expression

-Dgroups with &, |, !

mvn test -Dgroups="fast & !flaky"

#method selection and -Dgroups/-DexcludedGroups tag filtering require JUnit 4.x, JUnit 5, or TestNG (not plain JUnit 3) — the skill checks the project’s pom.xml if it’s unsure which syntax applies. A selector that matches nothing fails the build with "No tests matching pattern…​"; -DfailIfNoSpecifiedTests=false is only added when the user explicitly wants a missing-selector to be a silent no-op.

Outputs

  • A plain-text summary in the conversation — never a written file.

  • Total tests run, failures, errors, and skipped counts.

  • 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 (falling back to target/surefire-reports/*.txt if console output was truncated) — without unrelated passing-test noise.

  • No source or test code is ever modified.

Execution flow

flowchart TD A["Start /java-test\n(optional selector)"] --> B{Selector given?} B -- no --> C["Run mvn test\n(full suite)"] B -- yes --> D["Map selector to -Dtest / -Dgroups /\n-DexcludedGroups syntax"] D --> E["Compose mvn test command\nwith mapped parameters"] E --> F["Run via Bash tool"] C --> F F --> G["Summarize Surefire output:\nrun / failures / errors / skipped"] G --> H{Failures or errors?} H -- yes --> I["Show failing test names +\nassertion/exception output\n(surefire-reports/*.txt if truncated)"] H -- no --> J["Report: all passed, briefly"]

Dependencies

Invokes

None — iru-java-test is a leaf skill; it only runs Maven commands and reports on their output, it does not call any other skill in this catalog.

Invoked by

  • Java Code One Task Group — Step 3, once per task group’s bucket, via the iru-gate-runner agent, to run the scoped tests for every class the bucket affected (falling back to mvn test -Dtest=<TestClass> directly if this skill is unavailable), plus a full-suite run.

Source

SKILL.md on GitHub — the file this page was generated from.