Examples of XMLOutputter


Examples of net.sourceforge.marathon.junit.textui.XMLOutputter

    public void testOutput() throws IOException {
        Map<Test, MarathonTestResult> testOutputMap = new HashMap<Test, MarathonTestResult>();
        TestSuite suite = (TestSuite) new TestCreator(false, new StdOutConsole()).getTest("AllTests");
        createResult(suite, testOutputMap);
        StringWriter writer = new StringWriter();
        XMLOutputter outputter = new XMLOutputter();
        outputter.output(writer, suite, testOutputMap);
        String actual = writer.toString();
        String expected = "<?xml version=\"1.0\" ?>\n" + "<test projectname='' reportdir='testDir' >\n"
                + "<testsuite name=\"AllTests\" >\n" + "  <testsuite name=\"subdir.AllTests\" >\n"
                + "    <testcase name=\"subtest1\" status=\"0\" time=\"0\" >\n" + "    </testcase>\n"
                + "    <testcase name=\"subtest2\" status=\"2\" time=\"0.102\" >\n<![CDATA["
View Full Code Here

Examples of nl.vu.few.anytimereasoning.workbench.utils.XMLOutputter

  }
 
  private void saveResults(RunResult results, String filename){
    XMLManager xmlManager = new XMLManager();
    Document doc = xmlManager.buildApproximationStepDocument(results, filename);
    XMLOutputter xmlOut = new XMLOutputter();
    xmlOut.saveToFileNoAppend(doc, filename);
  }
View Full Code Here

Examples of org.apache.maven.archetype.common.util.XMLOutputter

    public void write( Model project, Document document, OutputStream stream )
        throws java.io.IOException
    {
        updateModel( project, "project", new Counter( 0 ), document.getRootElement() );

        XMLOutputter outputter = new XMLOutputter();
        outputter.setFormat( Format.getPrettyFormat().setIndent( "  " ).setLineSeparator( LS ) );
        outputter.output( document, stream );
    } // -- void write(Model, Document, OutputStream)
View Full Code Here

Examples of org.jdom.output.XMLOutputter

            ArgCheck.isNotNull(doc,CorePlugin.Util.getString("JdomHelper.The_Document_reference_may_not_be_null_45")); //$NON-NLS-1$
        }
        if(stream == null){
            ArgCheck.isNotNull(stream,CorePlugin.Util.getString("JdomHelper.The_OutputStream_reference_may_not_be_null_46")); //$NON-NLS-1$
        }
        XMLOutputter outputter = new XMLOutputter(getFormat(indent, newlines));
        outputter.output( doc, stream );
    }
View Full Code Here

Examples of org.jdom.output.XMLOutputter

            ArgCheck.isNotNull(doc,CorePlugin.Util.getString("JdomHelper.The_Document_reference_may_not_be_null_47")); //$NON-NLS-1$
        }
        if(writer == null){
            ArgCheck.isNotNull(writer,CorePlugin.Util.getString("JdomHelper.The_Writer_reference_may_not_be_null_48")); //$NON-NLS-1$
        }
        XMLOutputter outputter = new XMLOutputter(getFormat(indent, newlines));
        outputter.output( doc, writer );
    }
View Full Code Here

Examples of org.jdom.output.XMLOutputter

     */
    public static String write( Document doc , String indent, boolean newlines ) throws IOException {
        if(doc == null){
            ArgCheck.isNotNull(doc,CorePlugin.Util.getString("JdomHelper.The_Document_reference_may_not_be_null_49")); //$NON-NLS-1$
        }
        XMLOutputter outputter = new XMLOutputter(getFormat(indent, newlines));
        StringWriter writer = new StringWriter();
        outputter.output( doc, writer );
       
        return writer.getBuffer().toString();
    }
View Full Code Here

Examples of org.jdom.output.XMLOutputter

    rootElement.addContent(exceptionElement);

      }

      // Output xml
      XMLOutputter outputter = new XMLOutputter(JdomHelper.getFormat(
        "  ", true)); //$NON-NLS-1$
      outputter.output(new Document(rootElement), outputStream);

  } catch (SQLException e) {
      throw new QueryTestFailedException(
        "Failed to convert results to JDOM: " + e.getMessage()); //$NON-NLS-1$
  } catch (JDOMException e) {
View Full Code Here

Examples of org.jdom.output.XMLOutputter

      // add the results elements to the root element
      rootElement.addContent(resultElement);

      // Output xml
      XMLOutputter outputter = new XMLOutputter(JdomHelper.getFormat(
        "  ", true)); //$NON-NLS-1$
      outputter.output(new Document(rootElement), outputStream);

  } catch (SQLException e) {
      throw new QueryTestFailedException(
        "Failed to convert error results to JDOM: " + e.getMessage()); //$NON-NLS-1$
  } catch (JDOMException e) {
View Full Code Here

Examples of org.jdom.output.XMLOutputter

      Element eResult = (Element)aResult.buildOutputFromObject();
      eControlArea.addContent(eResult);
      syncErrorDoc.getRootElement().removeContent(eControlArea);
      syncErrorDoc.getRootElement().addContent(eControlArea);
      TextMessage syncErrorMessage = getSyncErrorPublisher().createTextMessage();
      XMLOutputter xmlOut = new XMLOutputter();
      syncErrorMessage.setText(xmlOut.outputString(syncErrorDoc));
      if (getSyncErrorPublisher().getDefaultCommandName().length() == 0 ||
        getSyncErrorPublisher().getDefaultCommandName() == null) {
        getSyncErrorPublisher().setDefaultCommandName("EnterpriseSyncErrorSync");
      }
      syncErrorMessage.setStringProperty(MessageProducer.MESSAGE_ID,msgId.toString());
View Full Code Here

Examples of org.jdom.output.XMLOutputter

  * Uses the Xerces SAXParser to validate an existing JDOM Document object.
  *<P>
  * @return boolean true if the document is valid, false if the document is not valid
  */
  public final synchronized boolean isValid(Document inDoc) {
    XMLOutputter xmlOut = new XMLOutputter();
    ByteArrayOutputStream bArray = new ByteArrayOutputStream();
    String parserName = "org.apache.xerces.parsers.SAXParser";
    try {
      xmlOut.output(inDoc, bArray);
    }
    catch (IOException e) {
      logger.fatal(e.getMessage(), e);
    }
    byte[] b = bArray.toByteArray();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.