четверг, 17 декабря 2015 г.

Интерфейс java Cucumber для Dependency Injection containers

Определяется например в cucumber.properties cucumber.api.java.ObjectFactory=my.pack.MyObjFactory
Служит для сборки приемочных тестов кукумбера классами поддрежки и другими.



package cucumber.api.java;

/**
 * Minimal facade for Dependency Injection containers
 */
public interface ObjectFactory {

    /**
     * Instantiate glue code before scenario execution. Called once per scenario.
     */
    void start();

    /**
     * Dispose glue code after scenario execution. Called once per scenario.
     */
    void stop();

    /**
     * Collects glue classes in the classpath. Called once on init.
     *
     * @param glueClass Glue class containing cucumber.api annotations (Before, Given, When, ...)
     * @return true if stepdefs and hooks in this class should be used, false if they should be ignored.
     */
    boolean addClass(Class glueClass);

    /**
     * Provides the glue instances used to execute the current scenario. The instance can be prepared in
     * {@link #start()}.
     *
     * @param glueClass type of instance to be created.
     * @param        type of Glue class
     * @return new Glue instance of type T
     */
     T getInstance(Class glueClass);
}


Комментариев нет:

Отправить комментарий