Exemplo n.º 1
0
 @Override
 public void close() throws IOException {
   // Close all opened tags.
   while (serializer.getDepth() > 0) {
     serializer.endTag(serializer.getNamespace(), serializer.getName());
   }
   serializer.endDocument();
 }
Exemplo n.º 2
0
 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;
   }
 }