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);
}
}
}
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);
}
}
}
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);
}
}
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();
}
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);
}
Aggregations