corgrath
corgrath

Reputation: 12285

Is is possible to run Cucumber in Java out of the box without JRuby/gems?

I am new to Cucumber, JRuby, Gems and how it works.

I like the idea of writing down the test case in plain English, but I am not keen on installing a lot of new tools (I really really like Java), just to get Cucumber up and running.

So I have a few questions.

1) Do I need install JRuby/Ruby to use Cucumber in Java? No way to avoid this?

2) If not, are there alternative test-tools, that is similar to Cucumber, that works in Java out of the box?

What alternatives do I have to minimize new tools just to get Cucumber/similar-tool working?

Upvotes: 5

Views: 3656

Answers (5)

Vishnu
Vishnu

Reputation: 4677

If you like the idea of writing tests in plain english, then Twist is your best bet. Underlying test code will be in java.

Upvotes: 0

cgleissner
cgleissner

Reputation: 1137

I compared Cucumber, Cucumber-JVM and JBehave. They are all meant for writing acceptance tests that are based on either features (Cucumber, Cucumber-JVM) or stories.

Cucumber's main disadvantages are that it's brittle when used via the Cuke4Duke Maven plugin in a pure Java environment since it requires maintaining its underlying Ruby (gem) infrastructure. It's also comparably slow and direct debugging isn't possible - you will need to attach a remote debugger instead.

JBehave is a very mature, pure Java alternative to Cucumber. It's output isn't quite as pretty as Cucumber's, but it's well documented, easy to use, and fast. There is native support for JUnit.

As of December 2011, you can now additionally use a pure Java version of Cucumber which is called Cucumber-JVM. It is just as fast and easy to use as JBehave, and it has native JUnit support. Unfortunately, it doesn't have any pretty HTML-based result output, not even the rudimentary offerings of JBehave, though this should be fixed in the coming months. It also lacks documentation. Its main advantage over JBehave is the support of features instead of stories.

Upvotes: 4

John
John

Reputation: 30185

Check out cuke4duke. It's cucumber for the JVM, no Ruby required.

Upvotes: 0

jbandi
jbandi

Reputation: 18169

Cucumber-JVM is what you are looking for.

Upvotes: 8

jbandi
jbandi

Reputation: 18169

A mature pure Java alternative to Cucumber is JBehave

Also Aslak Hellesoy (the creator of Cucumber) promised a native Java version of Cucumber to be released somewhen in 2011 (see his CukeUp keynote)

Upvotes: 4

Related Questions