public ExecutionToken deepCopy() { ExecutionToken t = new ExecutionToken( testSuiteName, executionStartTime, executionHost ); super.deepCopy(t); t.resultsSummary = resultsSummary.deepCopy(); return t; }
private void updateExecutionStats(ExecutionToken executionToken, ScenarioToken scenario) { if ( scenario.getEndState() == EndState.PASSED ) { executionToken.incrementScenariosPassed(); } else if ( scenario.getEndState() == EndState.PENDING) { executionToken.incrementScenariosPending(); } else { executionToken.incrementScenariosFailed(); } }
private void createFeatureThree() { ScenarioToken scenarioThree = new ScenarioToken(); scenarioThree.setName("Scenario Three"); StepToken stepSix = scenarioThree.addStep(StepToken.createStep("If", "I add a step to scenario 3")); stepSix.setEndState(StepEndState.TIMEOUT); StepToken stepSeven = scenarioThree.addStep(StepToken.createStep("If", "I add another skipped step to scenario 3")); stepSeven.setEndState(StepEndState.SKIPPED); FeatureToken featureThree = new FeatureToken(); featureThree.setName("Feature Three"); featureThree.addScenario(scenarioThree); listOfFeatures.add(featureThree); }
public ScenarioToken deepCopy() { ScenarioToken copy = new ScenarioToken(); super.deepCopy(copy); copy.name = this.name; copy.steps = new ArrayList<>(); for (StepToken step : steps) { copy.steps.add(step.deepCopy()); } copy.tags = new ArrayList<>(); copy.tags.addAll(this.tags); return copy; }
/** * May be overridden (e.g. to add control codes for colouring terminal output) */ protected String getEndState(StepToken step) { return step.getEndState().toString(); }
protected void deepCopy(AbstractToken copy) { copy.setException(this.getException()); copy.setStackTrace(this.getStackTrace()); } }
public boolean inOneOf(StepEndState... states) { boolean result = false; for ( StepEndState s : states) { if ( s == getEndState()) { result = true; break; } } return result; }
@Test public void testVisitation() { MockVisitor m = new MockVisitor(); testSuite.accept(m); assertEquals("Expected visit count", 20, m.visitations); }
public StepToken deepCopy() { StepToken copy = new StepToken(this.type, this.action); super.deepCopy(copy); copy.endState = this.endState; copy.message = this.message; copy.throwable = this.throwable; copy.timeTaken = this.timeTaken; copy.childSteps = recursiveCopy(childSteps); return copy; }
public void accept(TokenVisitor tokenVisitor) { tokenVisitor.startVisit(this); for ( StepToken s : steps) { s.accept(tokenVisitor); } tokenVisitor.endVisit(this); }
public void accept(TokenVisitor tokenVisitor) { tokenVisitor.startVisit(this); resultsSummary.accept(tokenVisitor); tokenVisitor.endVisit(this); }
public void accept(TokenVisitor tokenVisitor) { tokenVisitor.startVisit(this); for ( ScenarioToken s : scenarios) { s.accept(tokenVisitor); } tokenVisitor.endVisit(this); }
/** * May be overridden (e.g. to add control codes for colouring terminal output) */ protected String getStepText(StepToken step) { return step.toString(); }
/** * May be overridden (e.g. to add control codes for colouring terminal output) */ protected String getMessage(StepToken step) { return step.getMessage(); }
/** * @return true, if all scenarios and steps were implemented and not pending */ public boolean isFullyImplemented() { return resultsSummary.isFullyImplemented(); }
public String getErrorDescription() { String exception = scenarioToken.getException(); return scenarioName + (exception == null ? "" : " " + exception); } }
/** * @return this is useful, for cases where we simplify results into three categories - passed, failed, and anything else */ public int getUndefinedPendingOrSkipped() { return resultsSummary.getUndefinedPendingOrSkipped(); }
private void createFeatureTwo() { ScenarioToken scenarioTwo = new ScenarioToken(); scenarioTwo.setName("Scenario Two"); StepToken stepFour = scenarioTwo.addStep(StepToken.createStep("If", "I add a step to scenario 2")); stepFour.setEndState(StepEndState.UNDEFINED); StepToken stepFive = scenarioTwo.addStep(StepToken.createStep("If", "I add another skipped step to scenario 2")); stepFive.setEndState(StepEndState.SKIPPED); FeatureToken featureTwo = new FeatureToken(); featureTwo.setName("Feature Two"); featureTwo.addScenario(scenarioTwo); listOfFeatures.add(featureTwo); }
private void createFeatureFour() { ScenarioToken scenarioFour = new ScenarioToken(); scenarioFour.setName("Scenario Four"); StepToken step = scenarioFour.addStep(StepToken.createStep("If", "I add a step to scenario 3")); step.setEndState(StepEndState.SKIPPED); FeatureToken featureFour = new FeatureToken(); featureFour.setName("Feature Four Failed No Handler"); featureFour.addScenario(scenarioFour); listOfFeatures.add(featureFour); }