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 Java step definition classes. Cuke4Duke will attempt to use PicoContainer by default unless you tell it otherwise (See Spring and Guice). You can also be explicit if you want by passing the following JVM parameter when you fire up cucumber:

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

This can be passed via Ant, Maven or the Command Line.

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