Search in sources :

Example 1 with CmisTest

use of org.apache.chemistry.opencmis.tck.CmisTest in project copper-cms by PogeyanOSS.

the class JsonReport method printGroupResults.

private void printGroupResults(CmisTestGroup group, JSONArray jsonGroups) throws IOException {
    if (!group.isEnabled()) {
        return;
    }
    JSONObject jsonGroup = new JSONObject();
    jsonGroups.add(jsonGroup);
    jsonGroup.put("name", group.getName());
    if (group.getTests() != null && !group.getTests().isEmpty()) {
        JSONArray jsonTests = new JSONArray();
        jsonGroup.put("tests", jsonTests);
        for (CmisTest test : group.getTests()) {
            printTestResults(test, jsonTests);
        }
    }
}
Also used : JSONObject(org.apache.chemistry.opencmis.commons.impl.json.JSONObject) JSONArray(org.apache.chemistry.opencmis.commons.impl.json.JSONArray) CmisTest(org.apache.chemistry.opencmis.tck.CmisTest)

Example 2 with CmisTest

use of org.apache.chemistry.opencmis.tck.CmisTest in project copper-cms by PogeyanOSS.

the class TextReport method printGroupResults.

private void printGroupResults(CmisTestGroup group, Writer writer) throws IOException {
    if (!group.isEnabled()) {
        return;
    }
    writer.write("===============================================================" + NL);
    writer.write(group.getName() + NL);
    writer.write("===============================================================" + NL);
    if (group.getTests() != null) {
        for (CmisTest test : group.getTests()) {
            printTestResults(test, writer);
        }
    }
}
Also used : CmisTest(org.apache.chemistry.opencmis.tck.CmisTest)

Example 3 with CmisTest

use of org.apache.chemistry.opencmis.tck.CmisTest in project copper-cms by PogeyanOSS.

the class AbstractCmisTestGroup method run.

@Override
public void run() throws Exception {
    if (progressMonitor != null) {
        progressMonitor.startGroup(this);
    }
    try {
        preRun();
        for (CmisTest test : tests) {
            if (test == null || !test.isEnabled()) {
                continue;
            }
            try {
                if (progressMonitor != null) {
                    progressMonitor.startTest(test);
                }
                preTest(test);
                long start = System.currentTimeMillis();
                test.run();
                long end = System.currentTimeMillis();
                if (test instanceof AbstractCmisTest) {
                    ((AbstractCmisTest) test).setTime(end - start);
                }
            } catch (Exception e) {
                if (!(e instanceof FatalTestException)) {
                    throw e;
                }
            } finally {
                postTest(test);
                if (progressMonitor != null) {
                    progressMonitor.endTest(test);
                }
            }
        }
    } finally {
        postRun();
    }
    if (progressMonitor != null) {
        progressMonitor.endGroup(this);
    }
}
Also used : CmisTest(org.apache.chemistry.opencmis.tck.CmisTest)

Example 4 with CmisTest

use of org.apache.chemistry.opencmis.tck.CmisTest in project copper-cms by PogeyanOSS.

the class XmlReport method printGroupResults.

private void printGroupResults(CmisTestGroup group, XMLStreamWriter xml) throws Exception {
    if (!group.isEnabled()) {
        return;
    }
    xml.writeStartElement(TAG_GROUP);
    xml.writeAttribute(ATTR_NAME, group.getName());
    if (group.getTests() != null) {
        for (CmisTest test : group.getTests()) {
            printTestResults(test, xml);
        }
    }
    xml.writeEndElement();
}
Also used : CmisTest(org.apache.chemistry.opencmis.tck.CmisTest)

Example 5 with CmisTest

use of org.apache.chemistry.opencmis.tck.CmisTest in project copper-cms by PogeyanOSS.

the class AbstractRunner method addGroup.

public void addGroup(String groupClass) throws Exception {
    if (groupClass == null) {
        return;
    }
    groupClass = groupClass.trim();
    if (groupClass.length() == 0) {
        return;
    }
    Class<?> clazz = ClassLoaderUtil.loadClass(groupClass);
    Object o = clazz.newInstance();
    CmisTestGroup group = null;
    if (o instanceof CmisTestGroup) {
        group = (CmisTestGroup) o;
    } else if (o instanceof CmisTest) {
        group = new WrapperCmisTestGroup((CmisTest) o);
    } else {
        throw new InstantiationException("Not a CmisTestGroup or CmisTest class!");
    }
    addGroup(group);
}
Also used : CmisTestGroup(org.apache.chemistry.opencmis.tck.CmisTestGroup) WrapperCmisTestGroup(org.apache.chemistry.opencmis.tck.impl.WrapperCmisTestGroup) WrapperCmisTestGroup(org.apache.chemistry.opencmis.tck.impl.WrapperCmisTestGroup) CmisTest(org.apache.chemistry.opencmis.tck.CmisTest)

Aggregations

CmisTest (org.apache.chemistry.opencmis.tck.CmisTest)5 JSONArray (org.apache.chemistry.opencmis.commons.impl.json.JSONArray)1 JSONObject (org.apache.chemistry.opencmis.commons.impl.json.JSONObject)1 CmisTestGroup (org.apache.chemistry.opencmis.tck.CmisTestGroup)1 WrapperCmisTestGroup (org.apache.chemistry.opencmis.tck.impl.WrapperCmisTestGroup)1