Skip to content

Commit

Permalink
Remove the status xml attribute from AntXmlResultWriter
Browse files Browse the repository at this point in the history
as it was not part of a valid junit xml schema.

To cherry-pick for #3286.

RELNOTES: None.
PiperOrigin-RevId: 170022796
  • Loading branch information
iirina authored and vladmos committed Sep 26, 2017
1 parent 926fd29 commit cc9c2f0
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ public final class AntXmlResultWriter implements XmlResultWriter {
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_ELEMENT_STATUS = "status";
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";
Expand Down Expand Up @@ -163,7 +162,6 @@ private void writeTestCase(XmlWriter writer, TestResult result,
writer.writeAttribute(JUNIT_ATTR_TESTCASE_CLASSNAME, result.getClassName());
writer.writeAttribute(JUNIT_ATTR_TESTCASE_TIME, getFormattedRunTime(
result.getRunTimeInterval()));
writer.writeAttribute(JUNIT_ELEMENT_STATUS, result.getStatus().toString());

for (Throwable failure : parentFailures) {
writeThrowableToXmlWriter(writer, failure);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
</testsuite>
<testsuite name='com.google.testing.junit.runner.testbed.XmlOutputExercises$FailureTest' timestamp='' hostname='localhost' tests='1' failures='1' errors='0' time='' package='' id='1'>
<properties />
<testcase name='testFail' classname='com.google.testing.junit.runner.testbed.XmlOutputExercises$FailureTest' time='' status='COMPLETED'>
<testcase name='testFail' classname='com.google.testing.junit.runner.testbed.XmlOutputExercises$FailureTest' time=''>
<failure message='This is an expected error. The test is supposed to fail.' type='java.lang.AssertionError'>java.lang.AssertionError: This is an expected error. The test is supposed to fail.

</failure>
Expand All @@ -17,22 +17,22 @@
</testsuite>
<testsuite name='com.google.testing.junit.runner.testbed.XmlOutputExercises$OtherTests' timestamp='' hostname='localhost' tests='1' failures='0' errors='0' time='' package='' id='2'>
<properties />
<testcase name='testToString' classname='com.google.testing.junit.runner.testbed.XmlOutputExercises$OtherTests' time='' status='COMPLETED' />
<testcase name='testToString' classname='com.google.testing.junit.runner.testbed.XmlOutputExercises$OtherTests' time='' />
<system-out />
<system-err />
</testsuite>
<testsuite name='com.google.testing.junit.runner.testbed.XmlOutputExercises$EqualsHashCodeTest' timestamp='' hostname='localhost' tests='2' failures='0' errors='0' time='' package='' id='3'>
<properties />
<testcase name='testHashCode' classname='com.google.testing.junit.runner.testbed.XmlOutputExercises$EqualsHashCodeTest' time='' status='COMPLETED' />
<testcase name='testEquals' classname='com.google.testing.junit.runner.testbed.XmlOutputExercises$EqualsHashCodeTest' time='' status='COMPLETED' />
<testcase name='testHashCode' classname='com.google.testing.junit.runner.testbed.XmlOutputExercises$EqualsHashCodeTest' time='' />
<testcase name='testEquals' classname='com.google.testing.junit.runner.testbed.XmlOutputExercises$EqualsHashCodeTest' time='' />
<system-out />
<system-err />
</testsuite>
<testsuite name='com.google.testing.junit.runner.testbed.XmlOutputExercises$ComparabilityTest' timestamp='' hostname='localhost' tests='3' failures='0' errors='0' time='' package='' id='4'>
<properties />
<testcase name='compareToEqualInstance' classname='com.google.testing.junit.runner.testbed.XmlOutputExercises$ComparabilityTest' time='' status='COMPLETED' />
<testcase name='compareToGreaterInstance' classname='com.google.testing.junit.runner.testbed.XmlOutputExercises$ComparabilityTest' time='' status='COMPLETED' />
<testcase name='compareToLessInstance' classname='com.google.testing.junit.runner.testbed.XmlOutputExercises$ComparabilityTest' time='' status='COMPLETED' />
<testcase name='compareToEqualInstance' classname='com.google.testing.junit.runner.testbed.XmlOutputExercises$ComparabilityTest' time='' />
<testcase name='compareToGreaterInstance' classname='com.google.testing.junit.runner.testbed.XmlOutputExercises$ComparabilityTest' time='' />
<testcase name='compareToLessInstance' classname='com.google.testing.junit.runner.testbed.XmlOutputExercises$ComparabilityTest' time='' />
<system-out />
<system-err />
</testsuite>
Expand Down
2 changes: 0 additions & 2 deletions src/test/shell/bazel/bazel_java_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -1424,8 +1424,6 @@ EOF
[[ -s $xml_log ]] || fail "$xml_log was not present after test"
cat "$xml_log" > "$TEST_log"
expect_log "failures='2'"
expect_log "status='INTERRUPTED"
expect_log "status='CANCELLED'"
expect_log "<failure message='Test cancelled' type='java.lang.Exception'>java.lang.Exception: Test cancelled"
expect_log "<failure message='Test interrupted' type='java.lang.Exception'>java.lang.Exception: Test interrupted"
}
Expand Down

0 comments on commit cc9c2f0

Please sign in to comment.