Skip to content

Commit cc9c2f0

Browse files
iirinavladmos
authored andcommitted
Remove the status xml attribute from AntXmlResultWriter
as it was not part of a valid junit xml schema. To cherry-pick for bazelbuild#3286. RELNOTES: None. PiperOrigin-RevId: 170022796
1 parent 926fd29 commit cc9c2f0

3 files changed

Lines changed: 7 additions & 11 deletions

File tree

src/java_tools/junitrunner/java/com/google/testing/junit/runner/model/AntXmlResultWriter.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ public final class AntXmlResultWriter implements XmlResultWriter {
4949
private static final String JUNIT_ATTR_PROPERTY_VALUE = "value";
5050
private static final String JUNIT_ELEMENT_TESTCASE = "testcase";
5151
private static final String JUNIT_ELEMENT_FAILURE = "failure";
52-
private static final String JUNIT_ELEMENT_STATUS = "status";
5352
private static final String JUNIT_ATTR_FAILURE_MESSAGE = "message";
5453
private static final String JUNIT_ATTR_FAILURE_TYPE = "type";
5554
private static final String JUNIT_ATTR_TESTCASE_NAME = "name";
@@ -163,7 +162,6 @@ private void writeTestCase(XmlWriter writer, TestResult result,
163162
writer.writeAttribute(JUNIT_ATTR_TESTCASE_CLASSNAME, result.getClassName());
164163
writer.writeAttribute(JUNIT_ATTR_TESTCASE_TIME, getFormattedRunTime(
165164
result.getRunTimeInterval()));
166-
writer.writeAttribute(JUNIT_ELEMENT_STATUS, result.getStatus().toString());
167165

168166
for (Throwable failure : parentFailures) {
169167
writeThrowableToXmlWriter(writer, failure);

src/java_tools/junitrunner/javatests/com/google/testing/junit/runner/testbed/XmlOutputExercises.ant.xml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
</testsuite>
88
<testsuite name='com.google.testing.junit.runner.testbed.XmlOutputExercises$FailureTest' timestamp='' hostname='localhost' tests='1' failures='1' errors='0' time='' package='' id='1'>
99
<properties />
10-
<testcase name='testFail' classname='com.google.testing.junit.runner.testbed.XmlOutputExercises$FailureTest' time='' status='COMPLETED'>
10+
<testcase name='testFail' classname='com.google.testing.junit.runner.testbed.XmlOutputExercises$FailureTest' time=''>
1111
<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.
1212

1313
</failure>
@@ -17,22 +17,22 @@
1717
</testsuite>
1818
<testsuite name='com.google.testing.junit.runner.testbed.XmlOutputExercises$OtherTests' timestamp='' hostname='localhost' tests='1' failures='0' errors='0' time='' package='' id='2'>
1919
<properties />
20-
<testcase name='testToString' classname='com.google.testing.junit.runner.testbed.XmlOutputExercises$OtherTests' time='' status='COMPLETED' />
20+
<testcase name='testToString' classname='com.google.testing.junit.runner.testbed.XmlOutputExercises$OtherTests' time='' />
2121
<system-out />
2222
<system-err />
2323
</testsuite>
2424
<testsuite name='com.google.testing.junit.runner.testbed.XmlOutputExercises$EqualsHashCodeTest' timestamp='' hostname='localhost' tests='2' failures='0' errors='0' time='' package='' id='3'>
2525
<properties />
26-
<testcase name='testHashCode' classname='com.google.testing.junit.runner.testbed.XmlOutputExercises$EqualsHashCodeTest' time='' status='COMPLETED' />
27-
<testcase name='testEquals' classname='com.google.testing.junit.runner.testbed.XmlOutputExercises$EqualsHashCodeTest' time='' status='COMPLETED' />
26+
<testcase name='testHashCode' classname='com.google.testing.junit.runner.testbed.XmlOutputExercises$EqualsHashCodeTest' time='' />
27+
<testcase name='testEquals' classname='com.google.testing.junit.runner.testbed.XmlOutputExercises$EqualsHashCodeTest' time='' />
2828
<system-out />
2929
<system-err />
3030
</testsuite>
3131
<testsuite name='com.google.testing.junit.runner.testbed.XmlOutputExercises$ComparabilityTest' timestamp='' hostname='localhost' tests='3' failures='0' errors='0' time='' package='' id='4'>
3232
<properties />
33-
<testcase name='compareToEqualInstance' classname='com.google.testing.junit.runner.testbed.XmlOutputExercises$ComparabilityTest' time='' status='COMPLETED' />
34-
<testcase name='compareToGreaterInstance' classname='com.google.testing.junit.runner.testbed.XmlOutputExercises$ComparabilityTest' time='' status='COMPLETED' />
35-
<testcase name='compareToLessInstance' classname='com.google.testing.junit.runner.testbed.XmlOutputExercises$ComparabilityTest' time='' status='COMPLETED' />
33+
<testcase name='compareToEqualInstance' classname='com.google.testing.junit.runner.testbed.XmlOutputExercises$ComparabilityTest' time='' />
34+
<testcase name='compareToGreaterInstance' classname='com.google.testing.junit.runner.testbed.XmlOutputExercises$ComparabilityTest' time='' />
35+
<testcase name='compareToLessInstance' classname='com.google.testing.junit.runner.testbed.XmlOutputExercises$ComparabilityTest' time='' />
3636
<system-out />
3737
<system-err />
3838
</testsuite>

src/test/shell/bazel/bazel_java_test.sh

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1424,8 +1424,6 @@ EOF
14241424
[[ -s $xml_log ]] || fail "$xml_log was not present after test"
14251425
cat "$xml_log" > "$TEST_log"
14261426
expect_log "failures='2'"
1427-
expect_log "status='INTERRUPTED"
1428-
expect_log "status='CANCELLED'"
14291427
expect_log "<failure message='Test cancelled' type='java.lang.Exception'>java.lang.Exception: Test cancelled"
14301428
expect_log "<failure message='Test interrupted' type='java.lang.Exception'>java.lang.Exception: Test interrupted"
14311429
}

0 commit comments

Comments
 (0)