Package org.apache.jorphan.io

Examples of org.apache.jorphan.io.TextFile


            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


        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();
            }
            FileInputStream fileInputStream = null;
            try {
                fileInputStream = new FileInputStream(file);
                doc = XDB.parse(fileInputStream);
View Full Code Here

            config.setRunningVersion(true);
            SampleResult result = new SampleResult();
            HTTPSampler context = (HTTPSampler) SaveService.loadSubTree(new FileInputStream(System.getProperty("user.dir") + "/testfiles/Load_JMeter_Page.jmx")).getArray()[0];
            JMeterContextService.getContext().setCurrentSampler(context);
            JMeterContextService.getContext().setCurrentSampler(config);
            result.setResponseData(new TextFile(System.getProperty("user.dir") + "/testfiles/jmeter_home_page.html").getText().getBytes());
            result.setSampleLabel(context.toString());
            result.setSamplerData(context.toString());
            JMeterContextService.getContext().setPreviousResult(result);
            AnchorModifier modifier = new AnchorModifier();
            modifier.process();
View Full Code Here

  private String retrieveRuntimeXmlData()
  {
    String file = getRandomFileName();
    if(file.length() > 0)
    {
      TextFile contents = new TextFile(file);
      if(contents.exists())
      {
        return contents.getText();
      }
    }
    return getXmlData();
  }
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

    private static boolean trimLastLine(String filename)
    {
        try
        {
            TextFile text = new TextFile(filename);

            if (!text.exists())
            {
                return false;
            }
            String xml = text.getText();

            xml = xml.substring(0, xml.indexOf("</testResults>"));
            text.setText(xml);
        }
        catch (Exception e)
        {
            return false;
        }
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

                                + "/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());
View Full Code Here

   *
   * @param path
   * @return
   */
  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

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.