use of org.apache.chemistry.opencmis.tck.CmisTestResult 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);
}
}
use of org.apache.chemistry.opencmis.tck.CmisTestResult in project copper-cms by PogeyanOSS.
the class XmlReport method printResult.
private void printResult(CmisTestResult result, XMLStreamWriter xml) throws Exception {
xml.writeStartElement(TAG_RESULT);
xml.writeAttribute(ATTR_STATUS, result.getStatus().toString());
xml.writeAttribute(ATTR_MESSAGE, result.getMessage());
for (CmisTestResult child : result.getChildren()) {
printResult(child, xml);
}
xml.writeEndElement();
}
Aggregations