@Override public void close() throws IOException { // Close all opened tags. while (serializer.getDepth() > 0) { serializer.endTag(serializer.getNamespace(), serializer.getName()); } serializer.endDocument(); }
private void maybeAddTimeAttribute() throws IOException { // If current element is <testcase>, add time attribute. if (TAG_TESTCASE.equals(serializer.getName()) && !isTimeAppended) { serializer.attribute( NS_DEFAULT, ATTR_TIME, Double.toString((System.currentTimeMillis() - testCaseStartTime) / 1000.0)); isTimeAppended = true; } }