예제 #1
0
 private void addCountsToResult(TestSummary testSummary, Element resultElement) {
   Element counts = testResultsDocument.createElement("counts");
   resultElement.appendChild(counts);
   XmlUtil.addTextNode(testResultsDocument, counts, "right", Integer.toString(testSummary.right));
   XmlUtil.addTextNode(testResultsDocument, counts, "wrong", Integer.toString(testSummary.wrong));
   XmlUtil.addTextNode(
       testResultsDocument, counts, "ignores", Integer.toString(testSummary.ignores));
   XmlUtil.addTextNode(
       testResultsDocument, counts, "exceptions", Integer.toString(testSummary.exceptions));
 }
예제 #2
0
    public void addItem(RecentChangesPageEntry line) throws Exception {
      Map<String, String> itemProperties = line.getItemProperties();
      Element itemElement = document.createElement("item");
      makeNodes(itemElement, itemProperties);
      linkPrefixBuilder.buildLink(itemElement, itemProperties.get("path"));

      String description = makeDescription(itemProperties);
      XmlUtil.addTextNode(itemElement, "description", description);
      channelElement.appendChild(itemElement);
    }
예제 #3
0
 protected void startHtml() throws Exception {
   if (response.isXmlFormat()) {
     testResultsDocument = XmlUtil.newDocument();
     testResultsElement = testResultsDocument.createElement("testResults");
     testResultsDocument.appendChild(testResultsElement);
     XmlUtil.addTextNode(testResultsDocument, testResultsElement, "rootPath", page.getName());
   } else {
     buildHtml();
     addToResponse(formatter.head());
   }
 }
예제 #4
0
  protected void addTestResultsToXmlDocument(TestSummary testSummary, String pageName)
      throws Exception {
    Element resultElement = testResultsDocument.createElement("result");
    testResultsElement.appendChild(resultElement);
    addCountsToResult(testSummary, resultElement);

    XmlUtil.addCdataNode(testResultsDocument, resultElement, "content", outputBuffer.toString());
    outputBuffer = null;

    XmlUtil.addTextNode(testResultsDocument, resultElement, "relativePageName", pageName);
  }
예제 #5
0
    private Document buildDocumentWithRssHeader() throws Exception {
      Document rssDocument = XmlUtil.newDocument();
      Element rssDocumentElement = rssDocument.createElement("rss");
      rssDocument.appendChild(rssDocumentElement);
      channelElement = rssDocument.createElement("channel");
      rssDocumentElement.setAttribute("version", "2.0");
      rssDocumentElement.appendChild(channelElement);
      XmlUtil.addTextNode(channelElement, "title", "FitNesse:");

      return rssDocument;
    }
예제 #6
0
    public void buildLink(Element itemElement, String pageName) throws Exception {
      String prefix = getRssLinkPrefix();
      String link = prefix + pageName;

      XmlUtil.addTextNode(itemElement, "link", link);
    }
예제 #7
0
 private static void makeNodes(Element itemElement, Map<String, String> itemProperties) {
   XmlUtil.addTextNode(itemElement, "title", itemProperties.get("path"));
   XmlUtil.addTextNode(itemElement, "author", itemProperties.get("author"));
   XmlUtil.addTextNode(itemElement, "pubDate", itemProperties.get("pubDate"));
 }