Examples of UrlConfig


Examples of org.apache.jmeter.protocol.http.config.UrlConfig

  {
    NamedNodeMap atts = tempNode.getAttributes();
    if(atts.getNamedItem("action") == null)
      throw new MalformedURLException();
    String action = atts.getNamedItem("action").getNodeValue();
    UrlConfig url = createUrlFromAnchor(action, context);
    return url;
  }
View Full Code Here

Examples of org.apache.jmeter.protocol.http.config.UrlConfig

   * @param  e  Description of Parameter
   * @return    The UrlConfig value
   */
  public UrlConfig getUrlConfig(Entry e)
  {
    UrlConfig urlConfig = (UrlConfig)e.getConfigElement(UrlConfig.class);
    catClass.debug("getUrlConfig1 : Returning urlConfig - " + urlConfig);
    return urlConfig;
  }
View Full Code Here

Examples of org.apache.jmeter.protocol.http.config.UrlConfig

  private SampleResult sample(Entry e, boolean redirected)
  {
    catClass.debug("Start : sample2");
    long time;
    SampleResult res = new HttpSampleResult();
    UrlConfig url = getUrlConfig(e);
    if(redirected)
    {
      url.removeArguments();
    }
    URL u = null;
    try
    {
      u = url.getUrl();
      res.putValue(SampleResult.SAMPLE_LABEL, u.toString());
      res.putValue(SampleResult.DISPLAY_NAME, u.toString());
      res.putValue(HTTPSampler.URL,u);
      // specify the data to the result.
      res.putValue(HttpSampleResult.DATA, url);
View Full Code Here

Examples of org.apache.jmeter.protocol.http.config.UrlConfig

    return ok;
  }

  private void placeConfigElement(UrlConfig config)
  {
    UrlConfig urlConfig = null;
    JMeterTreeModel treeModel = GuiPackage.getInstance().getTreeModel();
    List nodes = treeModel.getNodesOfType(LogicController.class);
    if(nodes.size() == 0)
    {
      nodes = treeModel.getNodesOfType(ThreadGroup.class);
    }
    Iterator iter = nodes.iterator();
    while (iter.hasNext())
    {
      JMeterTreeNode node = (JMeterTreeNode)iter.next();
      JMeterComponentModel sample = (JMeterComponentModel)node.getUserObject();
      if(sample instanceof LogicController)
      {
        treeModel.compileComponent(node);
        Iterator iter2 = ((LogicController)sample).getConfigElements().iterator();
        while(iter2.hasNext())
        {
          try
          {
            urlConfig = (UrlConfig)iter2.next();
            break;
          }
          catch(ClassCastException e)
          {
            urlConfig = null;
          }
        }
      }
      if(urlConfig == null || (urlConfig.getDomain() == null ||
          urlConfig.getDomain().equals("") ||
          urlConfig.getDomain().equals(config.getDomain())) &&
          (urlConfig.getPath() == null ||
          urlConfig.getPath().equals("/") ||
          urlConfig.getPath().equals(config.getPath())))
      {
        if(urlConfig != null && urlConfig.getDomain() != null &&
            !urlConfig.getDomain().equals(""))
        {
          config.setDomain("");
        }
        if(urlConfig != null && urlConfig.getPath() != null &&
            !urlConfig.getPath().equals("/"))
        {
          config.setPath("");
        }
        HttpTestSample test = new HttpTestSample();
        test.setDefaultUrl(config);
View Full Code Here

Examples of org.apache.jmeter.protocol.http.config.UrlConfig

    public void testFiltering() throws Exception
    {
      ProxyControl control = new ProxyControl();
      control.addIncludedPattern(".*\\.jsp");
      control.addExcludedPattern(".*apache.org.*");
      UrlConfig config = new UrlConfig();
      config.setDomain("jakarta.org");
      config.setPath("index.jsp");
      assertTrue(control.filterUrl(config));
      config.setDomain("www.apache.org");
      assertTrue(!control.filterUrl(config));
      config.setPath("header.gif");
      config.setDomain("jakarta.org");
      assertTrue(!control.filterUrl(config));
    }
View Full Code Here

Examples of org.apache.jmeter.protocol.http.config.UrlConfig

   *
   *@exception  Exception  Description of Exception
   ***********************************************************/
  public void testSimpleParse() throws Exception
  {
    UrlConfig config = makeUrlConfig(".*/index\\.html");
    URL context = new URL("http://www.apache.org/subdir/previous.html");
    Entry entry = new Entry();
    entry.addConfigElement(config);
    String responseText = "<html><head><title>Test page</title></head><body>" +
        "<a href=\"index.html\">Goto index page</a></body></html>";
View Full Code Here

Examples of org.apache.jmeter.protocol.http.config.UrlConfig

        ((UrlConfig)entry.getConfigElement(UrlConfig.class)).getUrl().toString());
  }

  public void testSimpleParse2() throws Exception
  {
    UrlConfig config = makeUrlConfig("/index\\.html");
    URL context = new URL("http://www.apache.org/subdir/previous.html");
    String responseText = "<html><head><title>Test page</title></head><body>" +
        "<a href=\"/index.html\">Goto index page</a>hfdfjiudfjdfjkjfkdjf"+
        "<b>bold text</b><a href=lowerdir/index.html>lower</a></body></html>";
    Entry entry = new Entry();
View Full Code Here

Examples of org.apache.jmeter.protocol.http.config.UrlConfig

  }

  public void testSimpleParse3() throws Exception
  {
    UrlConfig config = makeUrlConfig(".*index.*");
    config.addArgument("param1","value1");
    URL context = new URL("http://www.apache.org/subdir/previous.html");
    String responseText = "<html><head><title>Test page</title></head><body>" +
        "<a href=\"/home/index.html?param1=value1\">Goto index page</a></body></html>";
    Entry entry = new Entry();
    entry.addConfigElement(config);
    SampleResult result = new SampleResult();
    result.putValue(SampleResult.TEXT_RESPONSE,responseText.getBytes());
    result.putValue(HTTPSampler.URL,context);
    parser.modifyEntry(entry, result);
    String newUrl = ((UrlConfig)entry.getConfigElement(UrlConfig.class)).getUrl().toString();
    assertEquals("http://www.apache.org:80/home/index.html?param1=value1",newUrl);
    assertTrue(!config.getUrl().toString().equals(newUrl));
  }
View Full Code Here

Examples of org.apache.jmeter.protocol.http.config.UrlConfig

    assertTrue(!config.getUrl().toString().equals(newUrl));
  }

  public void testSimpleParse4() throws Exception
  {
    UrlConfig config = makeUrlConfig("/subdir/index\\..*");
    URL context = new URL("http://www.apache.org/subdir/previous.html");
    String responseText = "<html><head><title>Test page</title></head><body>" +
        "<A HREF=\"index.html\">Goto index page</A></body></html>";
    Entry entry = new Entry();
    entry.addConfigElement(config);
    SampleResult result = new SampleResult();
    result.putValue(SampleResult.TEXT_RESPONSE,responseText.getBytes());
    result.putValue(HTTPSampler.URL,context);
    parser.modifyEntry(entry, result);
    String newUrl = ((UrlConfig)entry.getConfigElement(UrlConfig.class)).getUrl().toString();
    assertEquals("http://www.apache.org:80/subdir/index.html",newUrl);
    assertTrue(!config.getUrl().toString().equals(newUrl));
  }
View Full Code Here

Examples of org.apache.jmeter.protocol.http.config.UrlConfig

    assertTrue(!config.getUrl().toString().equals(newUrl));
  }

  public void testSimpleParse5() throws Exception
  {
    UrlConfig config = makeUrlConfig("/subdir/index\\.h.*");
    URL context = new URL("http://www.apache.org/subdir/one/previous.html");
    String responseText = "<html><head><title>Test page</title></head><body>" +
        "<a href=\"../index.html\">Goto index page</a></body></html>";
    Entry entry = new Entry();
    entry.addConfigElement(config);
    SampleResult result = new SampleResult();
    result.putValue(SampleResult.TEXT_RESPONSE,responseText.getBytes());
    result.putValue(HTTPSampler.URL,context);
    parser.modifyEntry(entry, result);
    String newUrl = ((UrlConfig)entry.getConfigElement(UrlConfig.class)).getUrl().toString();
    assertEquals("http://www.apache.org:80/subdir/index.html",newUrl);
    assertTrue(!config.getUrl().toString().equals(newUrl));
  }
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.