Package org.apache.jmeter.config

Examples of org.apache.jmeter.config.Arguments


            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());
        }
View Full Code Here


                mod.setPathExtension(false);
                HTTPSampler sampler = createSampler();
                context.setCurrentSampler(sampler);
                context.setPreviousResult(response);
                mod.process();
                Arguments args = sampler.getArguments();
                assertEquals(
                    "For case i="+i,
                    "myId",
                    ((Argument) args.getArguments().get(0).getObjectValue())
                        .getValue());
            }
        }
View Full Code Here

    /**
   * Constructor for the HTTPSampler2 object.
   */
  public HTTPSampler2()
  {
    setArguments(new Arguments());
  }
View Full Code Here

  /**
   * Constructor for the HTTPSampler object.
   */
  public HTTPSampler()
  {
    setArguments(new Arguments());
  }
View Full Code Here

            assertEquals("value_+here", clone.getEncodedValue());
        }

        public void testConversion() throws Exception
        {
            Arguments args = new Arguments();
            args.addArgument("name.?", "value_ here");
            args.addArgument("name$of property", "value_.+");
            HTTPArgument.convertArgumentsToHTTP(args);
            CollectionProperty argList = args.getArguments();
            HTTPArgument httpArg =
                (HTTPArgument) argList.get(0).getObjectValue();
            assertEquals("name.%3F", httpArg.getEncodedName());
            assertEquals("value_+here", httpArg.getEncodedValue());
            httpArg = (HTTPArgument) argList.get(1).getObjectValue();
View Full Code Here

        setProperty(new TestElementProperty(USER_DEFINED_VARIABLES, vars));
    }

    public Map getUserDefinedVariables()
    {
        Arguments args = getVariables();
        return args.getArgumentsAsMap();
    }
View Full Code Here

        return args.getArgumentsAsMap();
    }

    private Arguments getVariables()
    {
        Arguments args =
            (Arguments) getProperty(USER_DEFINED_VARIABLES).getObjectValue();
        if (args == null)
        {
            args = new Arguments();
            setUserDefinedVariables(args);
        }
        return args;
    }
View Full Code Here

        assertEquals(new NullProperty("login"),config.getProperty("login"));
    }
   
    public void testArguments() throws Exception
    {
        Arguments args = new Arguments();
        args.addArgument("arg1","val1","=");
        TestElementProperty prop = new TestElementProperty("args",args);
        ConfigTestElement te = new ConfigTestElement();
        te.addProperty(prop);
        te.setRunningVersion(true);
        Arguments config = new Arguments();
        config.addArgument("config1","configValue","=");
        TestElementProperty configProp = new TestElementProperty("args",config);
        ConfigTestElement te2 = new ConfigTestElement();
        te2.addProperty(configProp);
        te.addTestElement(te2);
        assertEquals(2,args.getArgumentCount());
View Full Code Here

      }
    }
    URL newUrl = new URL(loc);
    urlConfig.putProperty(UrlConfig.DOMAIN, newUrl.getHost());
    urlConfig.putProperty(UrlConfig.PATH, newUrl.getFile());
    urlConfig.putProperty(UrlConfig.ARGUMENTS,new Arguments());
  }
View Full Code Here

    List children = xmlParent.takeChildObjects(this);
    if(children.size() == 1) {
      // Include or Exclude list, encapsulated as a set of Arguments
      Object model = ((TagHandler)children.get(0)).getModel();
      if (model instanceof Arguments) {
        Arguments args = (Arguments) model;
        List list = null;
        ProxyControl proxy = (ProxyControl) config;
        if (currentProperty.equals("includes")) {
          list = proxy.getIncludePatterns();
        } else if (currentProperty.equals("excludes")) {
          list = proxy.getExcludePatterns();
        }
        if (list != null) {
          for (Iterator iter = args.iterator(); iter.hasNext(); ) {
            Argument arg = (Argument) iter.next();
            list.add(arg.getValue());
          }
        }
      }
View Full Code Here

TOP

Related Classes of org.apache.jmeter.config.Arguments

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.