@Override public String toDebugString() { String debugString = Strings.repeat("\t", getDepth()); debugString += "id: " + getId() + ", type: " + getClass().getSimpleName() + ":" + getResult().getResult() + ", description: " + getDescription(); return debugString; }
/** * @return the filename */ @Override public String getFilename() { return new File(getFileUri()).getName(); }
public boolean apply(ExecutionNode node) { return node.hasError(); } };
@Override public String toDebugString() { return super.toDebugString() + " impl: " + targetClassName + "." + methodName; }
public static void writeScreenshots(File directoryForScreenshots, ExecutionNode rootNode) { rootNode.accept(new ScreenshotWriter(directoryForScreenshots)); }
public static boolean hasCriticalFailure(ExecutionNode node) { boolean rtn = false; if (node.getResult().getResult() == ExecutionResult.CHILD_FAILED){ // there is a failure at a parent level, is the cause critical ? // any child nodes with failures that are critical ? if (node instanceof NodeWithChildren){ List<ExecutionNode> children = ((NodeWithChildren) node).getChildren(); for (ExecutionNode child : children){ rtn = hasCriticalFailure(child); if (rtn){ break; } } } } else if (node.getResult().getResult() == ExecutionResult.FAILED) { // real failure, is it critical ? rtn = !node.getResult().getFailure().isNonCritical(); } return rtn; }
@Override public String toDebugString() { List<String> debugLines = Lists.newArrayList(super.toDebugString()); if (children != null) { for (CHILD_TYPE child : children) { if (child != null) { debugLines.add(child.toDebugString()); } } } return Joiner.on("\n").join(debugLines); }
private void writeFile(File jsonFile) { try { writer = Files.newWriter(jsonFile, Charset.defaultCharset()); writer.append("var detail = new Array();"); for (ExecutionNode rootNode : reportData.getRootNodes()) { for (JsonObject nodeAsJson : rootNode.accept(this)) { writer.append("\ndetail[" + nodeAsJson.get("id") + "]=" + nodeAsJson.toString() + ";"); } } } catch (IOException e) { throw new SubstepsRuntimeException("Failed writing to detail json file"); } finally { if (writer != null) { try { writer.flush(); writer.close(); } catch (IOException e) { throw new SubstepsRuntimeException("Failed writing to detail json file"); } } } }
public static boolean hasNonCriticalFailure(ExecutionNode node) { // TODO boolean rtn = false; if (node.getResult().getResult() == ExecutionResult.CHILD_FAILED){ // there is a failure at a parent level, is the cause critical ? // any child nodes with failures that are critical ? if (node instanceof NodeWithChildren){ List<ExecutionNode> children = ((NodeWithChildren) node).getChildren(); for (ExecutionNode child : children){ rtn = hasNonCriticalFailure(child); if (rtn){ break; } } } } else if (node.getResult().getResult() == ExecutionResult.NON_CRITICAL_FAILURE) { // real failure, is it critical ? rtn = node.getResult().getFailure().isNonCritical(); } return rtn; }