git clone 'git://github.com/rranelli/maven-test-mode.git'
This minor mode provides some enhancements to java-mode in order to use maven test tasks with little effort. It's largely based on the philosophy of `rspec-mode' by Peter Williams. Namely, it provides the following capabilities:
toggle back and forth between a test and it's class (bound to
verify the test class associated with the current buffer (bound to
verify the test defined in the current buffer if it is a test file (bound
verify the test method defined at the point of the current buffer (bound
re-run the last verification process (bound to
run tests for entire project (bound to
Check the full list of available keybindings at
maven-test-mode defines a derived minor mode
allows one to jump from compilation errors to text files.
You can install via
MELPA, or manually by downloading
adding the following to your init file:
(add-to-list 'load-path "/path/to/maven-test-mode") (require 'maven-test-mode)
maven-test-mode is installed properly, it will be started automatically
java-mode is started.
If you prefer the more ‘verbose’
maven output, change the default of
(setq maven-test-test-task-options "")
In order to map between the class file and it's test,
maven-test-mode uses the
maven-test-class-to-test-subs. This variable specifies a list of
(REPLACE . BY) that will be applied to the class file path
in order to find the corresponding test file:
(s-replace-all subs (buffer-file-name))
If your project does not comply with the default convention, you need to change the value of this variable.
In order to identify which test method is immediately defined before point,
maven-test-mode uses the regexes defined at
maven-test-test-method-name-regexes. If your test method definition does not
match the default regexes, you need to add your custom regex to the list with
(add-to-list 'maven-test-test-method-name-regexes "my-special-regex")
Love Emacs? Great, help out by contributing. The easiest way to contribute is to checkout the git project, make a change and then submit a pull request.
This package is largely inspired in rspec-mode by Peter Williams.