use of org.apache.chemistry.opencmis.tck.CmisTestGroup in project copper-cms by PogeyanOSS.
the class CoreHtmlReport method createReport.
@Override
public void createReport(Map<String, String> parameters, List<CmisTestGroup> groups, Writer writer) throws IOException {
stackTraceCounter = 0;
if (parameters != null) {
revision = parameters.get(AbstractRunner.TCK_REVISION_PARAMETER);
}
writer.write("<h1>OpenCMIS TCK Report</h1>\n");
writer.write((new Date()) + "\n");
writer.write("\n<h2>Parameters</h2>\n");
if (parameters != null) {
writer.write("<table>\n");
for (Map.Entry<String, String> p : (new TreeMap<String, String>(parameters)).entrySet()) {
String value = p.getValue();
if (SessionParameter.PASSWORD.endsWith(p.getKey())) {
value = "*****";
}
writer.write("<tr><td>" + escape(p.getKey()) + "</td><td>" + escape(value) + "</td></tr>\n");
}
writer.write("</table>\n");
}
writer.write("\n<h2>Groups</h2>\n");
if (groups != null) {
for (CmisTestGroup group : groups) {
printGroupResults(group, writer);
}
}
writer.flush();
}
use of org.apache.chemistry.opencmis.tck.CmisTestGroup in project copper-cms by PogeyanOSS.
the class JsonReport method createReport.
@Override
public void createReport(Map<String, String> parameters, List<CmisTestGroup> groups, Writer writer) throws IOException {
JSONObject jsonReport = new JSONObject();
JSONObject jsonParameters = new JSONObject();
jsonReport.put("parameters", jsonParameters);
if (parameters != null) {
for (Map.Entry<String, String> p : (new TreeMap<String, String>(parameters)).entrySet()) {
jsonParameters.put(p.getKey(), p.getValue());
}
}
if (groups != null) {
JSONArray jsonGroups = new JSONArray();
jsonReport.put("groups", jsonGroups);
for (CmisTestGroup group : groups) {
printGroupResults(group, jsonGroups);
}
}
jsonReport.writeJSONString(writer);
writer.flush();
}
use of org.apache.chemistry.opencmis.tck.CmisTestGroup in project copper-cms by PogeyanOSS.
the class XmlReport method createReport.
@Override
public void createReport(Map<String, String> parameters, List<CmisTestGroup> groups, Writer writer) throws Exception {
XMLOutputFactory factory = XMLOutputFactory.newInstance();
XMLStreamWriter xml = factory.createXMLStreamWriter(writer);
// start doc
xml.writeStartDocument();
xml.writeStartElement(TAG_REPORT);
if (parameters != null) {
xml.writeStartElement(TAG_PARAMETERS);
for (Map.Entry<String, String> p : (new TreeMap<String, String>(parameters)).entrySet()) {
xml.writeStartElement(TAG_PARAMETER);
xml.writeAttribute(ATTR_KEY, p.getKey());
if (p.getValue() != null) {
xml.writeAttribute(ATTR_VALUE, p.getValue());
}
xml.writeEndElement();
}
xml.writeEndElement();
}
if (groups != null) {
for (CmisTestGroup group : groups) {
printGroupResults(group, xml);
}
}
xml.writeEndElement();
// end document
xml.writeEndDocument();
xml.flush();
}
use of org.apache.chemistry.opencmis.tck.CmisTestGroup in project copper-cms by PogeyanOSS.
the class TextReport method createReport.
@Override
public void createReport(Map<String, String> parameters, List<CmisTestGroup> groups, Writer writer) throws IOException {
writer.write("***************************************************************" + NL);
writer.write("Test Report: " + (new Date()) + NL);
writer.write("***************************************************************" + NL);
if (parameters != null) {
for (Map.Entry<String, String> p : (new TreeMap<String, String>(parameters)).entrySet()) {
writer.write(p.getKey() + " = " + p.getValue() + NL);
}
}
writer.write("***************************************************************" + NL);
if (groups != null) {
for (CmisTestGroup group : groups) {
printGroupResults(group, writer);
}
}
writer.flush();
}
use of org.apache.chemistry.opencmis.tck.CmisTestGroup 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