Properties, system-out, system-err should be elements rather than attributes according to JUnit.xsd.
Report: Also missing element field "error" for the AntXmlWriter according to JUnit.xsd.
@@ -32,6 +32,13 @@ import javax.inject.Inject;
public final class AntXmlResultWriter implements XmlResultWriter {
private static final String JUNIT_ELEMENT_TESTSUITES = "testsuites";
private static final String JUNIT_ELEMENT_TESTSUITE = "testsuite";
+ private static final String JUNIT_ELEMENT_TESTSUITE_PROPERTIES = "properties";
+ private static final String JUNIT_ELEMENT_TESTSUITE_SYSTEM_OUT = "system-out";
+ private static final String JUNIT_ELEMENT_TESTSUITE_SYSTEM_ERR = "system-err";
+ private static final String JUNIT_ELEMENT_PROPERTY = "property";
+ private static final String JUNIT_ELEMENT_TESTCASE = "testcase";
+ private static final String JUNIT_ELEMENT_FAILURE = "failure";
+
private static final String JUNIT_ATTR_TESTSUITE_ERRORS = "errors";
private static final String JUNIT_ATTR_TESTSUITE_FAILURES = "failures";
private static final String JUNIT_ATTR_TESTSUITE_HOSTNAME = "hostname";
@@ -41,14 +48,8 @@ public final class AntXmlResultWriter implements XmlResultWriter {
private static final String JUNIT_ATTR_TESTSUITE_TIMESTAMP = "timestamp";
private static final String JUNIT_ATTR_TESTSUITE_ID = "id";
private static final String JUNIT_ATTR_TESTSUITE_PACKAGE = "package";
- private static final String JUNIT_ATTR_TESTSUITE_PROPERTIES = "properties";
- private static final String JUNIT_ATTR_TESTSUITE_SYSTEM_OUT = "system-out";
- private static final String JUNIT_ATTR_TESTSUITE_SYSTEM_ERR = "system-err";
- private static final String JUNIT_ELEMENT_PROPERTY = "property";
private static final String JUNIT_ATTR_PROPERTY_NAME = "name";
private static final String JUNIT_ATTR_PROPERTY_VALUE = "value";
- private static final String JUNIT_ELEMENT_TESTCASE = "testcase";
- private static final String JUNIT_ELEMENT_FAILURE = "failure";
private static final String JUNIT_ATTR_FAILURE_MESSAGE = "message";
private static final String JUNIT_ATTR_FAILURE_TYPE = "type";
private static final String JUNIT_ATTR_TESTCASE_NAME = "name";
@@ -99,7 +100,7 @@ public final class AntXmlResultWriter implements XmlResultWriter {
}
private void writeTestSuiteProperties(XmlWriter writer, TestResult result) throws IOException {
- writer.startElement(JUNIT_ATTR_TESTSUITE_PROPERTIES);
+ writer.startElement(JUNIT_ELEMENT_TESTSUITE_PROPERTIES);
for (Map.Entry<String, String> entry : result.getProperties().entrySet()) {
writer.startElement(JUNIT_ELEMENT_PROPERTY);
writer.writeAttribute(JUNIT_ATTR_PROPERTY_NAME, entry.getKey());
@@ -122,10 +123,10 @@ public final class AntXmlResultWriter implements XmlResultWriter {
}
private void writeTestSuiteOutput(XmlWriter writer) throws IOException {
- writer.startElement(JUNIT_ATTR_TESTSUITE_SYSTEM_OUT);
+ writer.startElement(JUNIT_ELEMENT_TESTSUITE_SYSTEM_OUT);
// TODO(bazel-team) - where to get this from?
writer.endElement();
- writer.startElement(JUNIT_ATTR_TESTSUITE_SYSTEM_ERR);
+ writer.startElement(JUNIT_ELEMENT_TESTSUITE_SYSTEM_ERR);
// TODO(bazel-team) - where to get this from?
writer.endElement();
}
