All Downloads are FREE. Search and download functionalities are using the official Maven repository.

cucumber.runtime.android.FeatureCompiler Maven / Gradle / Ivy

package cucumber.runtime.android;

import cucumber.runtime.Runtime;
import cucumber.runtime.model.CucumberFeature;
import gherkin.events.PickleEvent;

import java.util.ArrayList;
import java.util.List;

/**
 * Utility class to count scenarios, including outlined.
 */
final class FeatureCompiler {

    /**
     * Compilers the given {@code cucumberFeatures} to {@link PickleEvent}s.
     *
     * @param cucumberFeatures the list of {@link CucumberFeature} to compile
     * @return the compiled pickles in {@link PickleEvent}s
     */
    static List compile(final List cucumberFeatures, final Runtime runtime) {
        List pickles = new ArrayList();
        for (final CucumberFeature feature : cucumberFeatures) {
            for (final PickleEvent pickleEvent : runtime.compileFeature(feature)) {
                if (runtime.matchesFilters(pickleEvent)) {
                    pickles.add(pickleEvent);
                }
            }
        }
        return pickles;
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy