Skip to Main Content
Cucumber Recipes
book

Cucumber Recipes

by Ian Dees, Matt Wynne, Aslak Hellesoy
February 2013
Intermediate to advanced content levelIntermediate to advanced
272 pages
5h 45m
English
Pragmatic Bookshelf
Content preview from Cucumber Recipes
Recipe 17Use Cucumber with Java via Cucumber-JVM

Problem

You need to test Java code using Cucumber syntax. You’d like to write your step definitions in pure Java, without bringing Ruby into the mix. And you need to connect it to your existing set of Java IDE and build tools.

Ingredients

  • Cucumber-JVM,[102] a pure-Java (no Ruby) implementation of Cucumber

  • IntelliJ IDEA Community Edition,[103] the open source edition of the beloved Java IDE

  • JUnit[104] to serve as the test harness

  • Maven[105] for dependency management

Solution

There are a few different ways to use Cucumber to test code written for the Java platform. The simplest is to use JRuby, an implementation of Ruby written in Java. But it’s not the best fit for every project; it has ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Cucumber Cookbook

Cucumber Cookbook

Shankar Garg
Basiswissen Softwaretest , 6th Edition

Basiswissen Softwaretest , 6th Edition

Andreas Spillner, Tilo Linz
React Cookbook

React Cookbook

David Griffiths, Dawn Griffiths

Publisher Resources

ISBN: 9781941222607Errata