Package org.apache.jmeter.protocol.http.sampler

Examples of org.apache.jmeter.protocol.http.sampler.HTTPNullSampler


            assertNotNull(man.getCookieHeaderForURL(sampler.getUrl()));
        }

        public void testSendCookie2() throws Exception {
            man.add(new Cookie("id", "value", ".apache.org", "/", false, 9999999999L));
            HTTPSamplerBase sampler = new HTTPNullSampler();
            sampler.setDomain("jakarta.apache.org");
            sampler.setPath("/index.html");
            sampler.setMethod(HTTPSamplerBase.GET);
            assertNotNull(man.getCookieHeaderForURL(sampler.getUrl()));
        }
View Full Code Here


      argp = new Argument("test", "a.*e");
      assertFalse(HtmlParsingUtils.isArgumentMatched(arg, argp));
    }
   
    public void testIsAnchorMatched() throws Exception {
      HTTPSamplerBase target=new HTTPNullSampler();
      HTTPSamplerBase pattern=new HTTPNullSampler();

      assertTrue(HtmlParsingUtils.isAnchorMatched(target, pattern));

      target.setProtocol("http:");
      assertFalse(HtmlParsingUtils.isAnchorMatched(target, pattern));

      pattern.setProtocol(".*");
      assertTrue(HtmlParsingUtils.isAnchorMatched(target, pattern));
     
      target.setDomain("a.b.c");
      assertTrue(HtmlParsingUtils.isAnchorMatched(target, pattern));

      pattern.setDomain(".*");
      assertTrue(HtmlParsingUtils.isAnchorMatched(target, pattern));
     
      target.setPath("/abc");
      assertFalse(HtmlParsingUtils.isAnchorMatched(target, pattern));

      pattern.setPath(".*");
      assertTrue(HtmlParsingUtils.isAnchorMatched(target, pattern));
     
      target.addArgument("param2", "value2", "=");
      assertTrue(HtmlParsingUtils.isAnchorMatched(target, pattern));
     
      pattern.addArgument("param1", ".*", "=");
      assertFalse(HtmlParsingUtils.isAnchorMatched(target, pattern));
     
      target.addArgument("param1", "value1", "=");
      assertTrue(HtmlParsingUtils.isAnchorMatched(target, pattern));
    }
View Full Code Here

      Arguments args = sampler.getArguments();
      assertEquals("jfdkjdkfjddkfdfjkdjfdf", ((Argument) args.getArguments().get(0).getObjectValue()).getValue());
    }

    private HTTPSamplerBase createSampler() {
      HTTPSamplerBase sampler = new HTTPNullSampler();
      sampler.setDomain("server.com");
      sampler.setPath("index.html");
      sampler.setMethod(HTTPSamplerBase.GET);
      sampler.setProtocol("http");
      return sampler;
    }
View Full Code Here

            Arguments args = sampler.getArguments();
            assertEquals("jfdkjdkfjddkfdfjkdjfdf", ((Argument) args.getArguments().get(0).getObjectValue()).getValue());
        }

        private HTTPSamplerBase createSampler() {
            HTTPSamplerBase sampler = new HTTPNullSampler();
            sampler.setDomain("server.com");
            sampler.setPath("index.html");
            sampler.setMethod(HTTPConstants.GET);
            sampler.setProtocol("http");
            return sampler;
        }
View Full Code Here

  protected void setUp() {
    Arguments args = new Arguments();
    args.addArgument("username", "mstover");
    args.addArgument("password", "pass");
    args.addArgument("action", "login");
    config = new HTTPNullSampler();
    config.setName("Full Config");
    config.setProperty(HTTPSamplerBase.DOMAIN, "www.lazer.com");
    config.setProperty(HTTPSamplerBase.PATH, "login.jsp");
    config.setProperty(HTTPSamplerBase.METHOD, HTTPSamplerBase.POST);
    config.setProperty(new TestElementProperty(HTTPSamplerBase.ARGUMENTS, args));
    defaultConfig = new HTTPNullSampler();
    defaultConfig.setName("default");
    defaultConfig.setProperty(HTTPSamplerBase.DOMAIN, "www.xerox.com");
    defaultConfig.setProperty(HTTPSamplerBase.PATH, "default.html");
    partialConfig = new HTTPNullSampler();
    partialConfig.setProperty(HTTPSamplerBase.PATH, "main.jsp");
    partialConfig.setProperty(HTTPSamplerBase.METHOD, HTTPSamplerBase.GET);
  }
View Full Code Here

    assertEquals("te%24st=goto", config.getQueryString());
  }

  private HTTPSamplerBase makeContext(String url) throws MalformedURLException {
    URL u = new URL(url);
    HTTPSamplerBase context = new HTTPNullSampler();
    context.setDomain(u.getHost());
    context.setPath(u.getPath());
    context.setPort(u.getPort());
    context.setProtocol(u.getProtocol());
    context.parseArguments(u.getQuery());
    return context;
  }
View Full Code Here

    context.parseArguments(u.getQuery());
    return context;
  }

  private HTTPSamplerBase makeUrlConfig(String path) {
    HTTPSamplerBase config = new HTTPNullSampler();
    config.setDomain("www.apache.org");
    config.setMethod(HTTPSamplerBase.GET);
    config.setPath(path);
    config.setPort(80);
    config.setProtocol("http");
    return config;
  }
View Full Code Here

    public void setUp() {
      control = new ProxyControl();
      control.addIncludedPattern(".*\\.jsp");
      control.addExcludedPattern(".*apache.org.*");
      sampler = new HTTPNullSampler();
    }
View Full Code Here

    }

    public void testcleanURL() throws Exception {
      String res = tclp.cleanURL(URL1);
      assertEquals("/addrbook/", res);
      assertNull(tclp.stripFile(res, new HTTPNullSampler()));
    }
View Full Code Here

      Arguments args = sampler.getArguments();
      assertEquals("jfdkjdkfjddkfdfjkdjfdf", ((Argument) args.getArguments().get(0).getObjectValue()).getValue());
    }

    private HTTPSamplerBase createSampler() {
      HTTPSamplerBase sampler = new HTTPNullSampler();
      sampler.setDomain("server.com");
      sampler.setPath("index.html");
      sampler.setMethod(HTTPSamplerBase.GET);
      sampler.setProtocol("http");
      return sampler;
    }
View Full Code Here

TOP

Related Classes of org.apache.jmeter.protocol.http.sampler.HTTPNullSampler

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.