Knowledge Base > Legacy Information - JCover > Options

JCover options

Please note that options for mocking, and advanced options for use with either Maven or Gradle, are described on separate pages.

General options

If you use the command jcover without any options, tests will be generated for all classes in the current project/module. To refine your test creation, use the commands as below:

To change the names of created test classes:

--class-suffix suffix

This will rename the default ClassnameTest to ClassnameSuffix.

To switch off the creation of tests for trivial constructors, getters and setters:


To compile and run the tests after creation (only those which pass will be kept).


This needs to be combined with --gradle or --maven options.

To increase the level of diagnostic output to the screen:


To show the JCover version:


Java Bytecode frontend options

To disable the security manager:


To test private methods using reflection:


Code generation options

To choose the directory to which generated tests will be saved:

-d directory

To test exceptions:


To set the indent width:

--indent x

To set the Java version between 6 and 14 (the default is 8):

--java version

To disable the comments which are normally inserted into the created tests:


To use the keyword final:


This applies the keyword final to all objects and variables created in the tests, so that they cannot be modified (i.e. these objects and variables effectively become constants).

To use Lombok’s ‘val’ type:


To use the keyword var:


This means that all objects created in the tests will be designated as a variable, instead of their original type.

Code formatting options

To apply the aosp format:


To apply clang-format:


To apply google-java-format:


To apply the Spring Java format: