Skip to content
This repository has been archived by the owner on May 21, 2019. It is now read-only.

PicoContainer

aslakhellesoy edited this page Sep 13, 2010 · 7 revisions

Unless you are using Spring we recommend you use Cuke4Duke’s built-in support for PicoContainer to instantiate your Pure java step definitions. Telling Cuke4Duke to use PicoContainer is simple – just pass the following JVM parameter when you fire up cucumber:

-Dcuke4duke.objectFactory=cuke4duke.internal.java.PicoFactory

PicoContainer allows your Step definitions to use Constructor Injection to assemble a graph of objects. Example:

package race;
public class Car {}
package race;
public class Driver {
    public Driver(Car car) {}
}
package race;
public class RaceSteps {
    public class RaceSteps(Driver driver, Car car) {}
}
Clone this wiki locally