Search in sources :

Example 81 with CmisTestResult

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);
    }
}
Also used : CmisBaseException(org.apache.chemistry.opencmis.commons.exceptions.CmisBaseException) CmisTestResult(org.apache.chemistry.opencmis.tck.CmisTestResult) PrintWriter(java.io.PrintWriter)

Example 82 with CmisTestResult

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();
}
Also used : CmisTestResult(org.apache.chemistry.opencmis.tck.CmisTestResult)

Aggregations

CmisTestResult (org.apache.chemistry.opencmis.tck.CmisTestResult)82 ArrayList (java.util.ArrayList)33 Folder (org.apache.chemistry.opencmis.client.api.Folder)33 Document (org.apache.chemistry.opencmis.client.api.Document)32 HashMap (java.util.HashMap)19 CmisObject (org.apache.chemistry.opencmis.client.api.CmisObject)18 DocumentTypeDefinition (org.apache.chemistry.opencmis.commons.definitions.DocumentTypeDefinition)14 CmisBaseException (org.apache.chemistry.opencmis.commons.exceptions.CmisBaseException)14 CmisObjectNotFoundException (org.apache.chemistry.opencmis.commons.exceptions.CmisObjectNotFoundException)14 ObjectId (org.apache.chemistry.opencmis.client.api.ObjectId)12 ContentStream (org.apache.chemistry.opencmis.commons.data.ContentStream)11 FileableCmisObject (org.apache.chemistry.opencmis.client.api.FileableCmisObject)8 ObjectType (org.apache.chemistry.opencmis.client.api.ObjectType)8 CmisInvalidArgumentException (org.apache.chemistry.opencmis.commons.exceptions.CmisInvalidArgumentException)8 ByteArrayInputStream (java.io.ByteArrayInputStream)7 IOException (java.io.IOException)6 HashSet (java.util.HashSet)6 CmisNotSupportedException (org.apache.chemistry.opencmis.commons.exceptions.CmisNotSupportedException)6 OperationContext (org.apache.chemistry.opencmis.client.api.OperationContext)5 TypeDefinition (org.apache.chemistry.opencmis.commons.definitions.TypeDefinition)4