Package fitnesse.util

Examples of fitnesse.util.XmlWriter


    assertEquals(sampleXml, results);
  }

  private String writeXml(Document doc) throws Exception {
    XmlWriter writer = new XmlWriter(output);
    writer.write(doc);
    writer.flush();
    writer.close();

    String results = new String(output.toByteArray());
    return results;
  }
View Full Code Here


  }

  private SimpleResponse makeResponseWithxml(Document doc) throws IOException {
    //TODO MdM Shoudl probably use a StreamedResponse
    ByteArrayOutputStream output = new ByteArrayOutputStream();
    XmlWriter xmlWriter = new XmlWriter(output);
    xmlWriter.write(doc);
    xmlWriter.flush();
    xmlWriter.close();
    SimpleResponse response = new SimpleResponse();
    response.setContentType("text/xml");
    response.setContent(output.toByteArray());
    return response;
  }
View Full Code Here

      return rssDocument;
    }

    private static byte[] toByteArray(Document rssDocument) throws Exception {
      ByteArrayOutputStream os = new ByteArrayOutputStream();
      XmlWriter writer = new XmlWriter(os);
      writer.write(rssDocument);
      writer.close();
      return os.toByteArray();
    }
View Full Code Here

    }
  }

  public static String xmlAsString(Document doc) throws IOException {
    ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
    XmlWriter writer = new XmlWriter(outputStream);
    writer.write(doc);
    writer.flush();
    writer.close();
    String value = outputStream.toString();
    return value;
  }
View Full Code Here

TOP

Related Classes of fitnesse.util.XmlWriter

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.