https://github.com/emersonloureiro/ranger-plugin
Eclipse plugin for finding tests that can potentially go through a given method
https://github.com/emersonloureiro/ranger-plugin
eclipse java junit testing
Last synced: 12 months ago
JSON representation
Eclipse plugin for finding tests that can potentially go through a given method
- Host: GitHub
- URL: https://github.com/emersonloureiro/ranger-plugin
- Owner: emersonloureiro
- License: epl-1.0
- Created: 2014-02-23T15:17:41.000Z (over 12 years ago)
- Default Branch: master
- Last Pushed: 2016-09-01T18:13:07.000Z (almost 10 years ago)
- Last Synced: 2025-03-16T21:48:18.975Z (over 1 year ago)
- Topics: eclipse, java, junit, testing
- Language: Java
- Size: 259 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Ranger
Ranger is an eclipse plugin for finding tests - and thus functionality - that may pass through a given method in your Java code base. It will help you anticipate the impact of code changes, both functional and performance-related, allowing you to perform some smoke tests on core functionality, before actually breaking it!
Current version is 1.0.1, and requires Eclipse Juno or later. Currently Ranger only supports JUnit tests.
# Installation
Installation consists of both the core plugin - i.e., the GUI, searching algorithm, etc - and one one or more _test checker_ plugins, which define things specific to a testing framework - e.g., how a class/method can be identified as a test.
## Eclipse update site
This will install both the core Ranger plugin, as well as the JUnit Test Checker plugin automatically. Less hassle!
http://dl.bintray.com/ranger/eclipse/1.0.1/
During the install, you may be faced with the dialog box below. Don't worry, you're safe to hit Ok and proceed with the installation

## Manually
Navigate to [this](https://github.com/emersonloureiro/ranger-plugin/tree/master/ranger-update-site/plugins) page, download the jars, and drop them into the _plugins_ folder of your Eclipse installation. Don't forget to restart Eclipse!
# Using the Plugin
To search for tests, simply place the cursor either on the method body or its signature, and run the search by right clicking on the Java file and selection the 'Search Tests' item. Alternatively, you can press 'Ctrl + Alt + T'.

It's important to understand that if the cursor is placed on a method body, *that method* will be the one you will be search tests for, even if you are placing the cursor on a method call within another method's body. In the image below, for example, placing the cursor over the call to the `isDisabled()` method, will still cause the search to be performed for the outer method, `isTarget(CallHierarchyNode node)`.

The search is always performed on the background, so the UI isn't blocked. A search window does pop-up - unless you have configured Eclipse to always run tasks on the background - but it can be minimized. The search window also enables to cancel the current search.

When the search is finished, the results found as well as the total number of them is displayed on the plugin's results view. The results can be grouped by project, class, or left ungrouped, in which case the test methods found are the top-level elements of the view. You can browse the results and follow the method call hierarchy from each of the tests found up to the target method. Double clicking on any of the methods will bring you to the exact location of the call in the source code. Likewise, double clicking on a class will open it on editor.

One search cannot be started while another is being processed. If that's the case, you can either wait for the current search to finish, or cancel it via the plugin's results view, the search window, or Eclipse's progress view - if the search window has already been minimized. When a search is cancelled, the results found up until that point are still displayed on the result's view.
To provide some customization, and prevent some potentially very long-running searches, there is an option to define the maximum depth allowed. So, a maximum search depth of 1, for example, will only return tests which are directly invoking the method you have searched for. The default value is 5, but you may want to adjust that if your code base is very large. The maximum search depth can be set either via the context menu of the results view or the plugin's preference page (below).
