use of org.apache.chemistry.opencmis.commons.exceptions.CmisBaseException in project copper-cms by PogeyanOSS.
the class TextReport method printResult.
private void printResult(int level, CmisTestResult result, Writer writer) throws IOException {
printIntend(level, writer);
writer.write(result.getStatus() + ": " + result.getMessage());
if (result.getStackTrace() != null && result.getStackTrace().length > 0) {
writer.write(" (" + result.getStackTrace()[0].getFileName() + ":" + result.getStackTrace()[0].getLineNumber() + ")");
}
writer.write(NL);
if (result.getStatus() == CmisTestResultStatus.UNEXPECTED_EXCEPTION && result.getException() != null) {
writer.write(NL + "Stacktrace:" + NL + NL);
result.getException().printStackTrace(new PrintWriter(writer));
if (result.getException() instanceof CmisBaseException) {
CmisBaseException cbe = (CmisBaseException) result.getException();
if (cbe.getErrorContent() != null) {
writer.write(NL + "Error Content:" + NL + NL);
writer.write(cbe.getErrorContent());
}
}
}
if (result.getException() != null) {
printIntend(level, writer);
writer.write("Exception: " + result.getException().getMessage() + NL);
}
if (result.getRequest() != null) {
printIntend(level, writer);
writer.write("Request: " + result.getRequest() + NL);
}
if (result.getResponse() != null) {
printIntend(level, writer);
writer.write("Response: " + result.getResponse() + NL);
}
for (CmisTestResult child : result.getChildren()) {
printResult(level + 1, child, writer);
}
}
Aggregations