Infinitest for IntelliJ Documentation

 Improve this page

This is the documentation for Infinitest for Intellij. (Looking for the Infinitest for Eclipse? Click here.)

Get Started

Installation

Install the Infinitest plugin from the plugin manager:

  • Go to “File > Settings”
  • Select Plugins node in the settings tree
  • Click “Browse repositories…” button
  • In the “Browse Repositories” dialog Type “Infinitest”
  • Click “install”
  • Restart IntelliJ

Note: You can alternatively download the jar from Jetbrains Plugin Repository and then install it from disk.

Enabling Infinitest

To enable the Infinitest facet for your project you need to add the Infinitest facet to your project modules.

To do so:

  • Go to “File > Project Structure”
  • Add the the Infinitest Facet to your test modules by:
  • clicking a module
  • Click the green “+” button
  • Select “Infinitest”

How it works

Infinitest inspects your classes to find tests.

Every time you change some code and IntelliJ recompiles it infinitest computes which tests need to be executed and runs them.

Viewing test results

The test failures are displayed:

  • As Markers in the test files
  • In the Infinitest Tool Window for each module.

Additionally the Tool Window allows to:

  • Stop/start Infinitest.
  • View the Infinitest logs.
  • View the Console output of the tests.
  • Disable tests of a module by right-clicking it

Configuring Infinitest

Filtering executed tests using infinitest.filters

By default Infinitest executes all Junit and TestNG tests.

You can configure which tests it should execute by adding an “infinitest.filters” file in the .idea/modules directory.

See Filtering Syntax for more info on how to filter tests.

Configuring JVM options

JVM option can be configured by defining a infinitest.args file.

See infinitest.args syntax.

Common Problems

Infinitest isn’t running my tests

You have to compile the file after you change it. By default, IntelliJ does not compile classes automatically like Eclipse.

Also, check the “infinitest.filters” file to make sure your tests are not ignored.

External Resources

Introductory article by Mkyoing