<commit_before>package cucumber.api;

import cucumber.api.event.TestCaseFinished;
import cucumber.api.event.TestCaseStarted;
import cucumber.runner.EventBus;
import cucumber.runtime.ScenarioImpl;
import gherkin.events.PickleEvent;
import gherkin.pickles.PickleLocation;
import gherkin.pickles.PickleTag;

import java.util.List;

public class TestCase {
    private final PickleEvent pickleEvent;
    private final List<TestStep> testSteps;
    private final boolean dryRun;

    public TestCase(List<TestStep> testSteps, PickleEvent pickleEvent, boolean dryRun) {
        this.testSteps = testSteps;
        this.pickleEvent = pickleEvent;
        this.dryRun = dryRun;
    }

    public void run(EventBus bus) {
        boolean skipNextStep = this.dryRun;
        Long startTime = bus.getTime();
        bus.send(new TestCaseStarted(startTime, this));
        ScenarioImpl scenarioResult = new ScenarioImpl(bus, pickleEvent);
        for (TestStep step : testSteps) {
            Result stepResult = step.run(bus, pickleEvent.pickle.getLanguage(), scenarioResult, skipNextStep);
            if (!stepResult.is(Result.Type.PASSED)) {
                skipNextStep = true;
            }
            scenarioResult.add(stepResult);
        }
        Long stopTime = bus.getTime();
        bus.send(new TestCaseFinished(stopTime, this, new Result(scenarioResult.getStatus(), stopTime - startTime, scenarioResult.getError())));<commit_msg>Deprecate constructors and run methods of TestCase<commit_after>package cucumber.api;

import cucumber.api.event.TestCaseFinished;
import cucumber.api.event.TestCaseStarted;
import cucumber.runner.EventBus;
import cucumber.runtime.ScenarioImpl;
import gherkin.events.PickleEvent;
import gherkin.pickles.PickleLocation;
import gherkin.pickles.PickleTag;

import java.util.List;

public class TestCase {
    private final PickleEvent pickleEvent;
    private final List<TestStep> testSteps;
    private final boolean dryRun;

    /**
     * Creates a new instance of a test case.
     *
     * @param testSteps   of the test case
     * @param pickleEvent the pickle executed by this test case
     * @deprecated not part of the public api
     */
    @Deprecated
    public TestCase(List<TestStep> testSteps, PickleEvent pickleEvent) {
        this(testSteps, pickleEvent, false);
    }

    /**
     * Creates a new instance of a test case.
     *
     * @param testSteps   of the test case
     * @param pickleEvent the pickle executed by this test case
     * @param dryRun      skip execution of the test steps
     * @deprecated not part of the public api
     */
    @Deprecated
    public TestCase(List<TestStep> testSteps, PickleEvent pickleEvent, boolean dryRun) {
        this.testSteps = testSteps;
        this.pickleEvent = pickleEvent;
        this.dryRun = dryRun;
    }

    /**
     * Executes the test case.
     *
     * @param bus to which events should be broadcast
     * @deprecated not part of the public api
     */
    @Deprecated
    public void run(EventBus bus) {
        boolean skipNextStep = this.dryRun;
        Long startTime = bus.getTime();
        bus.send(new TestCaseStarted(startTime, this));
        ScenarioImpl scenarioResult = new ScenarioImpl(bus, pickleEvent);
        for (TestStep step : testSteps) {
            Result stepResult = step.run(bus, pickleEvent.pickle.getLanguage(), scenarioResult, skipNextStep);
            if (!stepResult.is(Result.Type.PASSED)) {
                skipNextStep = true;
            }
            scenarioResult.add(stepResult);
        }
        Long stopTime = bus.getTime();
        bus.send(new TestCaseFinished(stopTime, this, new Result(scenarioResult.getStatus(), stopTime - startTime, scenarioResult.getError())));
{'fraction_non_alphanumeric': 0.08701472556894244, 'fraction_numerical': 0.0, 'mean_word_length': 3.0215285252960173, 'pattern_counts': {'":': 0, '<': 8, '<?xml version=': 0, '>': 8, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5991724', 'n_tokens_mistral': 1104, 'n_tokens_neox': 1076, 'n_words': 283}