aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar elenairina <elenairina@google.com>2017-09-26 10:42:54 +0200
committerGravatar Vladimir Moskva <vladmos@google.com>2017-09-26 12:31:59 +0200
commitcc9c2f07127a832a88f27f5d72e5508000b53429 (patch)
treef176f836892c24653d326c87a572251e0229a727
parent926fd297ee08fa18d3206c25f74e70e0156d7aac (diff)
Remove the status xml attribute from AntXmlResultWriter
as it was not part of a valid junit xml schema. To cherry-pick for #3286. RELNOTES: None. PiperOrigin-RevId: 170022796
-rw-r--r--src/java_tools/junitrunner/java/com/google/testing/junit/runner/model/AntXmlResultWriter.java2
-rw-r--r--src/java_tools/junitrunner/javatests/com/google/testing/junit/runner/testbed/XmlOutputExercises.ant.xml14
-rwxr-xr-xsrc/test/shell/bazel/bazel_java_test.sh2
3 files changed, 7 insertions, 11 deletions
diff --git a/src/java_tools/junitrunner/java/com/google/testing/junit/runner/model/AntXmlResultWriter.java b/src/java_tools/junitrunner/java/com/google/testing/junit/runner/model/AntXmlResultWriter.java
index 11870ae3f1..8ee4ba3a64 100644
--- a/src/java_tools/junitrunner/java/com/google/testing/junit/runner/model/AntXmlResultWriter.java
+++ b/src/java_tools/junitrunner/java/com/google/testing/junit/runner/model/AntXmlResultWriter.java
@@ -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";
@@ -163,7 +162,6 @@ public final class AntXmlResultWriter implements XmlResultWriter {
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);
diff --git a/src/java_tools/junitrunner/javatests/com/google/testing/junit/runner/testbed/XmlOutputExercises.ant.xml b/src/java_tools/junitrunner/javatests/com/google/testing/junit/runner/testbed/XmlOutputExercises.ant.xml
index a8e0cbcc18..beb241992b 100644
--- a/src/java_tools/junitrunner/javatests/com/google/testing/junit/runner/testbed/XmlOutputExercises.ant.xml
+++ b/src/java_tools/junitrunner/javatests/com/google/testing/junit/runner/testbed/XmlOutputExercises.ant.xml
@@ -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>
@@ -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>
diff --git a/src/test/shell/bazel/bazel_java_test.sh b/src/test/shell/bazel/bazel_java_test.sh
index c79d640303..3418fc14fd 100755
--- a/src/test/shell/bazel/bazel_java_test.sh
+++ b/src/test/shell/bazel/bazel_java_test.sh
@@ -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"
}