Search in sources :

Example 6 with PendingStep

use of org.jbehave.core.steps.StepCreator.PendingStep in project jbehave-core by jbehave.

the class StoryRunner method generatePendingStepMethods.

private void generatePendingStepMethods(RunContext context, List<Step> steps) {
    List<PendingStep> pendingSteps = new ArrayList<>();
    for (Step step : steps) {
        if (step instanceof PendingStep) {
            pendingSteps.add((PendingStep) step);
        }
    }
    if (!pendingSteps.isEmpty()) {
        PendingStepMethodGenerator generator = new PendingStepMethodGenerator(context.configuration().keywords());
        List<String> methods = new ArrayList<>();
        for (PendingStep pendingStep : pendingSteps) {
            if (!pendingStep.annotated()) {
                methods.add(generator.generateMethod(pendingStep));
            }
        }
        reporter.get().pendingMethods(methods);
    }
}
Also used : PendingStep(org.jbehave.core.steps.StepCreator.PendingStep) ArrayList(java.util.ArrayList) Step(org.jbehave.core.steps.Step) ParametrisedStep(org.jbehave.core.steps.StepCreator.ParametrisedStep) PendingStep(org.jbehave.core.steps.StepCreator.PendingStep) PendingStepMethodGenerator(org.jbehave.core.steps.PendingStepMethodGenerator)

Example 7 with PendingStep

use of org.jbehave.core.steps.StepCreator.PendingStep in project jbehave-core by jbehave.

the class PerformableTree method generatePendingStepMethods.

static void generatePendingStepMethods(RunContext context, List<Step> steps) {
    List<PendingStep> pendingSteps = new ArrayList<>();
    for (Step step : steps) {
        if (step instanceof PendingStep) {
            pendingSteps.add((PendingStep) step);
        }
    }
    if (!pendingSteps.isEmpty()) {
        PendingStepMethodGenerator generator = new PendingStepMethodGenerator(context.configuration().keywords());
        List<String> methods = new ArrayList<>();
        for (PendingStep pendingStep : pendingSteps) {
            if (!pendingStep.annotated()) {
                methods.add(generator.generateMethod(pendingStep));
            }
        }
    }
}
Also used : PendingStep(org.jbehave.core.steps.StepCreator.PendingStep) FailingUponPendingStep(org.jbehave.core.failures.FailingUponPendingStep) ArrayList(java.util.ArrayList) ParametrisedStep(org.jbehave.core.steps.StepCreator.ParametrisedStep) PendingStep(org.jbehave.core.steps.StepCreator.PendingStep) FailingUponPendingStep(org.jbehave.core.failures.FailingUponPendingStep)

Aggregations

PendingStep (org.jbehave.core.steps.StepCreator.PendingStep)7 ArrayList (java.util.ArrayList)3 Test (org.junit.Test)3 ParametrisedStep (org.jbehave.core.steps.StepCreator.ParametrisedStep)2 FailingUponPendingStep (org.jbehave.core.failures.FailingUponPendingStep)1 PendingStepFound (org.jbehave.core.failures.PendingStepFound)1 PendingStepMethodGenerator (org.jbehave.core.steps.PendingStepMethodGenerator)1 Step (org.jbehave.core.steps.Step)1