Cucumber-Java lets you write Cucumber steps in pure Java. Example:
public class StuffSteps {
@Given("I have (\\d+) (.*) cukes")
public void iHaveNCukes(String n, String color) {
this.cukes.put(color, n);
}
}
Cucumber-Java also brings you first-class Maven support.
This is for hackers. If you just want to use Cucumber with Java, head straight to
the examples.
You can grab it here
You can grab it here
Make sure you get 1.2.0 or later.
This gem is needed to build the Cucumber Java gem
jruby -S gem install hoe --no-rdoc --no-ri
jruby -S rake gem jruby -S gem install pkg/cucumber-java --no-rdoc --no-ri
In case you use Windows (Cygwin/MSYS) it’s easier to do the :jar task manually mvn clean install && mv target/*.jar /lib. In that case comment out task :gem => :jar at the bottom of the Rakefile
Now head to the simple example and run it. It serves well as a testbed. Or simply mvn clean install -Pexamples
In case you do not have the gems installed already, try mvn clean install -Pexamples -Dcucumber.installGems=true