Install
Requirements
Important
Once you have gone through this section, you should have:
RepoBee installed
A JDK (preferably 8+, 7 may work) installed
junit-4.13.1.jar
andhamcest-core-1.3.jar
downloaded
First of all, make sure that RepoBee is installed and up-to-date. For a first-time install of RepoBee, see the RepoBee install docs.
Furthermore, a JDK must be installed. repobee-junit4
has been extensively
tested with OpenJDK 8+, but should work well with JDK 7 and later. Make sure
that:
java
is available from the command line.javac
is available from the command line.
To be able to actually run test classes, you also need the JUnit4 and Hamcrest jars. They can be downloaded from Maven Central.
curl -L https://search.maven.org/remotecontent?filepath=junit/junit/4.13.1/junit-4.13.1.jar -o junit-4.13.1.jar
curl -L https://search.maven.org/remotecontent?filepath=org/hamcrest/hamcrest-core/1.3/hamcrest-core-1.3.jar -o hamcrest-core-1.3.jar
If you don’t have curl
installed, just copy the links above and download
them manually.
Install plugin
To install repobee-junit4
, simply use RepoBee’s plugin manager. It will
guide you through the process of install the junit4
plugin.
$ repobee plugin install
Then run repobee -p junit4 repos clone -h
. You should see some additional
command line arguments added (such as --junit4-reference-tests-dir
). See
Using existing plugins for more information on how to use plugins in
general, and Usage for details on this plugin.
Configuration
Some options for repobee-junit4
can be configured in the RepoBee
configuration file.
Everything repobee-junit4
needs to operate can be provided on the command
line, but we strongly recommend adding the absolute paths to the
junit-4.13.1.jar
and hamcrest-core-1.3.jar
files to the config file.
The easiest way to edit the configuration file is to run the config wizard
command. Note that the junit4 plugin must be active, or the wizard won’t
know to configure it. Here, we temporarily activate it with -p junit4
,
and select the junit4
section for editing.
$ repobee -p junit4 config wizard
Editing config file at /home/slarse/.config/repobee/config.ini
Select a section to configure:
repobee
●junit4 # make sure to select the junit4 section for editing
[ ... set your options ... ]
Here’s an example of what the config may look like after configuration.
[junit4]
junit4_junit_path = /absolute/path/to/junit-4.13.1.jar
junit4_hamcrest_path = /absolute/path/to/hamcrest-core-1.3.jar
junit4_reference_tests_dir = /absolute/path/to/reference_tests_dir
junit4_timeout = 5
Important
All paths in the configuration file must be absolute to behave as expected.
See CLI arguments for a complete list of arguments that can be configured.