public void testGrabSessionId3() throws Exception {
   String html = "href='index.html?session_id=jfdkjdkfjddkfdfjkdjfdf'";
   response = new SampleResult();
   response.setResponseData(html.getBytes());
   URLRewritingModifier mod = new URLRewritingModifier();
   mod.setArgumentName("session_id");
   HTTPSampler sampler = createSampler();
   context.setCurrentSampler(sampler);
   context.setPreviousResult(response);
   mod.process();
   Arguments args = sampler.getArguments();
   assertEquals(
       "jfdkjdkfjddkfdfjkdjfdf",
       ((Argument) args.getArguments().get(0).getObjectValue()).getValue());
 }
 public void testGrabSessionId4() throws Exception {
   String html = "href='index.html;%24sid%24KQNq3AAADQZoEQAxlkX8uQV5bjqVBPbT'";
   response = new SampleResult();
   response.setResponseData(html.getBytes());
   URLRewritingModifier mod = new URLRewritingModifier();
   mod.setArgumentName("%24sid%24");
   mod.setPathExtension(true);
   mod.setPathExtensionNoEquals(true);
   HTTPSampler sampler = createSampler();
   context.setCurrentSampler(sampler);
   context.setPreviousResult(response);
   mod.process();
   Arguments args = sampler.getArguments();
   assertEquals("index.html;%24sid%24KQNq3AAADQZoEQAxlkX8uQV5bjqVBPbT", sampler.getPath());
 }
 public void testGrabSessionId() throws Exception {
   String html =
       "location: http://server.com/index.html?session_id=jfdkjdkf%20jddkfdfjkdjfdf%22;";
   response = new SampleResult();
   response.setResponseData(html.getBytes());
   URLRewritingModifier mod = new URLRewritingModifier();
   mod.setArgumentName("session_id");
   HTTPSampler sampler = createSampler();
   sampler.addArgument("session_id", "adfasdfdsafasdfasd");
   context.setCurrentSampler(sampler);
   context.setPreviousResult(response);
   mod.process();
   Arguments args = sampler.getArguments();
   assertEquals(
       "jfdkjdkf jddkfdfjkdjfdf\"",
       ((Argument) args.getArguments().get(0).getObjectValue()).getValue());
   assertEquals(
       "http://server.com/index.html?session_id=jfdkjdkf+jddkfdfjkdjfdf%22", sampler.toString());
 }