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
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 11870ae..8ee4ba3a 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 @@
   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 @@
     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 a8e0cbc..beb2419 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 a543023..d337b08 100755
--- a/src/test/shell/bazel/bazel_java_test.sh
+++ b/src/test/shell/bazel/bazel_java_test.sh
@@ -1339,8 +1339,6 @@
   [[ -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"
 }