use of org.jbehave.core.steps.Step 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);
}
}
use of org.jbehave.core.steps.Step in project jbehave-core by jbehave.
the class StoryRunner method runStepsWhileKeepingState.
private void runStepsWhileKeepingState(RunContext context, List<Step> steps) throws InterruptedException {
if (steps == null || steps.size() == 0) {
return;
}
State state = context.state();
for (Step step : steps) {
try {
context.interruptIfCancelled();
state = state.run(step);
} catch (RestartingScenarioFailure e) {
reporter.get().restarted(step.toString(), e);
throw e;
}
}
context.stateIs(state);
}
Aggregations