Package org.apache.jorphan.io

Examples of org.apache.jorphan.io.TextFile


     *
     * @param path
     * @return the contents of the file
     */
    public String getFileContent(String path) {
        TextFile tf = new TextFile(path);
        return tf.getText();
    }
View Full Code Here


      HTTPSampleResult result = new HTTPSampleResult();
      HTTPSamplerBase context = (HTTPSamplerBase) SaveService.loadTree(
          new FileInputStream(System.getProperty("user.dir") + "/testfiles/Load_JMeter_Page.jmx")).getArray()[0];
      jmctx.setCurrentSampler(context);
      jmctx.setCurrentSampler(config);
      result.setResponseData(new TextFile(System.getProperty("user.dir") + HTMLFileName).getText().getBytes());
      result.setSampleLabel(context.toString());
      result.setSamplerData(context.toString());
      result.setURL(new URL("http://issues.apache.org/fakepage.html"));
      jmctx.setPreviousResult(result);
      AnchorModifier modifier = new AnchorModifier();
View Full Code Here

   *
   * @param path
   * @return the contents of the file
   */
  public String getFileContent(String path) {
    TextFile tf = new TextFile(path);
    return tf.getText();
  }
View Full Code Here

    Document doc = null;
    // if either a file or path location is given,
    // get the file object.
    if (file.length() > 0) {// we have a file
            if (this.getReadResponse()) {
                TextFile tfile = new TextFile(file);
                fileContents = tfile.getText();
            }
      doc = XDB.parse(new FileInputStream(file));
    } else {// must be a "here" document
      fileContents = getXmlData();
      if (fileContents != null && fileContents.length() > 0) {
View Full Code Here

     *
     * @param path
     * @return the contents of the file
     */
    public String getFileContent(String path) {
        TextFile tf = new TextFile(path);
        return tf.getText();
    }
View Full Code Here

  public void testToString() throws Exception {
    assertEquals("EON Developers", config.getValue("group1"));
    config.setProperty("website/url", "http://mydomain.com/homepage.jsp");
    String props = config.toString();
    TextFile tf = new TextFile(findTestFile("testfiles/configurationTest.xml"));
    tf.setText(config.toString());
    ConfigurationTree newTree = ConfigurationTree.fromXML(new FileReader(
        findTestFile("testfiles/configurationTest.xml")));
    assertEquals("EON Developers", newTree.getValue("group1"));
    assertEquals(props, newTree.toString());
    assertEquals("math", config.getPropertyNames("school/subjects")[2]);
View Full Code Here

      HTTPSampleResult result = new HTTPSampleResult();
      HTTPSamplerBase context = (HTTPSamplerBase) SaveService.loadTree(
          new FileInputStream(System.getProperty("user.dir") + "/testfiles/Load_JMeter_Page.jmx")).getArray()[0];
      jmctx.setCurrentSampler(context);
      jmctx.setCurrentSampler(config);
      result.setResponseData(new TextFile(System.getProperty("user.dir") + HTMLFileName).getText().getBytes());
      result.setSampleLabel(context.toString());
      result.setSamplerData(context.toString());
      result.setURL(new URL("http://issues.apache.org/fakepage.html"));
      jmctx.setPreviousResult(result);
      AnchorModifier modifier = new AnchorModifier();
View Full Code Here

   */
  private File retrieveRuntimeXmlData() {
    String file = getRandomFileName();
    if (file.length() > 0) {
      if (this.getReadResponse()) {
        TextFile tfile = new TextFile(file);
        FILE_CONTENTS = tfile.getText();
      }
      return new File(file);
    } else {
      return null;
    }
View Full Code Here

   *
   * @param path
   * @return
   */
  public String getFileContent(String path) {
    TextFile tf = new TextFile(path);
    return tf.getText();
  }
View Full Code Here

 
  private static boolean trimLastLine(String filename)
  {
    try
    {
      TextFile text = new TextFile(filename);
      String xml = text.getText();
      xml = xml.substring(0,xml.indexOf("</testResults>"));
      text.setText(xml);
    }
    catch(Exception e)
    {
      return false;
    }
View Full Code Here

TOP

Related Classes of org.apache.jorphan.io.TextFile

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.