private void flushCachedOutput() { Iterator<String> i = cachedLogOutput.iterator(); while( i.hasNext()) { lastToken.addInterpreterOutput(i.next()); i.remove(); } if ( cachedThrowable != null) { lastToken.setThrowable(cachedThrowable); cachedThrowable = null; } }
protected void deepCopy(AbstractToken copy) { copy.setException(this.getException()); copy.setStackTrace(this.getStackTrace()); } }
public void setThrowable(Throwable throwable) { this.throwable = throwable; setException(throwable.toString()); setStackTrace(StackTraceUtil.getStackTraceAsString(throwable)); }
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; }
void addInterpreterOutput(LogLevel type, Object message) { String logLine = String.format("%s --> %-7s - %s", "Chorus", type, message); if ( lastToken == null ) { cachedLogOutput.add(logLine); } else { flushCachedOutput(); lastToken.addInterpreterOutput(logLine); } }
void addInterpreterError(LogLevel type, Throwable t) { if ( lastToken == null ) { cachedThrowable = t; } else { flushCachedOutput(); lastToken.setThrowable(t); } }
public ResultsSummary deepCopy() { ResultsSummary s = new ResultsSummary(); super.deepCopy(s); s.featuresFailed = featuresFailed; s.featuresPending = featuresPending; s.featuresPassed = featuresPassed; s.scenariosPassed = scenariosPassed; s.scenariosPending = scenariosPending; s.scenariosFailed = scenariosFailed; s.unavailableHandlers = unavailableHandlers; s.stepsFailed = stepsFailed; s.stepsPassed = stepsPassed; s.stepsPending = stepsPending; s.stepsUndefined = stepsUndefined; s.stepsSkipped = stepsSkipped; s.timeTaken = timeTaken; return s; }
public ExecutionToken deepCopy() { ExecutionToken t = new ExecutionToken( testSuiteName, executionStartTime, executionHost ); super.deepCopy(t); t.resultsSummary = resultsSummary.deepCopy(); return t; }
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; }
/** * @return a deep copy of the feature results and all its sub tokens */ public FeatureToken deepCopy() { FeatureToken copy = new FeatureToken(); super.deepCopy(copy); copy.name = this.name; copy.usesHandlers = usesHandlers.clone(); copy.configurationName = this.configurationName; copy.scenarios = new ArrayList<>(this.scenarios.size()); copy.featureFile = featureFile; for (ScenarioToken scenario : this.scenarios) { copy.scenarios.add(scenario.deepCopy()); } return copy; }