Boost your Java Test with Ruby and JtestR
The main project is a collection of Ruby libraries bundled together with JRuby integration. It also includes the well known libraries in the Ruby world: RSpec (for BDD), mocha (for mocking and stubbing), dust (descriptive block syntax test definition), Test/Unit, and ActiveSupport (Ruby utility classes).
You'll end up with test case looking like this (RSpec wise) :
import java.util.HashMapAs an Ant task JtestR supports Ant, buildr and Maven2 integration.
describe "An empty", HashMap do
before :each do
@hash_map = HashMap.new
it "should be able to add an entry to it" do
@hash_map.put "foo", "bar"
@hash_map.get("foo").should == "bar"
it "should return a keyset iterator that throws an exception on next" do
Notice that JtestR relies on JRuby (which is still in heavy development) and that if you're running your tests often, you should set up the server Ant task to avoid JRuby heavy startup time (as described in the Getting Started tutorial).
With 0.1.1 version JtestR is in its early releases and your feedback will than welcome to guide its future direction.