本文整理汇总了Java中org.apache.jmeter.config.Arguments.getArgumentsAsMap方法的典型用法代码示例。如果您正苦于以下问题:Java Arguments.getArgumentsAsMap方法的具体用法?Java Arguments.getArgumentsAsMap怎么用?Java Arguments.getArgumentsAsMap使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.jmeter.config.Arguments
的用法示例。
在下文中一共展示了Arguments.getArgumentsAsMap方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: javaConfigTest
import org.apache.jmeter.config.Arguments; //导入方法依赖的package包/类
public void javaConfigTest() {
JavaConfigInitializer initer = new JavaConfigInitializer();
JavaConfig ele = (JavaConfig) initer.initilizeElement();
ModelTester.testBasicFields("Java Request Defaults", ele);
Assert.assertTrue("org.apache.jmeter.protocol.java.test.JavaTest"
.equals(ele.getPropertyAsString("classname")));
Arguments args = ele.getArguments();
Assert.assertTrue(args.getArgumentCount() == 8);
Map<String, String> argMap = args.getArgumentsAsMap();
Assert.assertTrue("".equals(argMap.get("Label")));
Assert.assertTrue("".equals(argMap.get("ResponseMessage")));
Assert.assertTrue("".equals(argMap.get("ResponseCode")));
Assert.assertTrue("".equals(argMap.get("ResultData")));
Assert.assertTrue("".equals(argMap.get("SamplerData")));
Assert.assertTrue("0xFF".equals(argMap.get("Sleep_Mask")));
Assert.assertTrue("100".equals(argMap.get("Sleep_Time")));
Assert.assertTrue("OK".equals(argMap.get("Status")));
}
示例2: convertArgumentsToJmsProperties
import org.apache.jmeter.config.Arguments; //导入方法依赖的package包/类
/**
* Converts {@link Arguments} to {@link JMSProperties} defaulting to String type
* Used to convert version <= 2.10 test plans
* @param args {@link Arguments} to be converted
* @return jmsProperties The converted {@link JMSProperties}
*/
public static JMSProperties convertArgumentsToJmsProperties(Arguments args) {
JMSProperties jmsProperties = new JMSProperties();
Map<String,String> map = args.getArgumentsAsMap();
for (Map.Entry<String, String> entry : map.entrySet()) {
jmsProperties.addJmsProperty(entry.getKey(), entry.getValue());
}
return jmsProperties;
}
示例3: replaceValues
import org.apache.jmeter.config.Arguments; //导入方法依赖的package包/类
/**
* Scan all test elements passed in for values matching the value of any of
* the variables in any of the variable-holding elements in the collection.
*
* @param sampler A TestElement to replace values on
* @param configs More TestElements to replace values on
* @param variables Collection of Arguments to use to do the replacement, ordered
* by ascending priority.
*/
private void replaceValues(TestElement sampler, TestElement[] configs, Collection<Arguments> variables)
{
// Build the replacer from all the variables in the collection:
ValueReplacer replacer = new ValueReplacer();
for (Arguments variable : variables)
{
final Map<String, String> map = variable.getArgumentsAsMap();
for (Iterator<String> vals = map.values().iterator(); vals.hasNext();)
{
final Object next = vals.next();
if ("".equals(next))
{// Drop any empty values (Bug 45199)
vals.remove();
}
}
replacer.addVariables(map);
}
try
{
boolean cachedRegexpMatch = regexMatch;
replacer.reverseReplace(sampler, cachedRegexpMatch);
for (TestElement config : configs)
{
if (config != null)
{
replacer.reverseReplace(config, cachedRegexpMatch);
}
}
}
catch (InvalidVariableException e)
{
LOG.warn("Invalid variables included for replacement into recorded " + "sample", e);
}
}
示例4: getUserDefinedVariables
import org.apache.jmeter.config.Arguments; //导入方法依赖的package包/类
@JsonIgnore
public Map<String, String> getUserDefinedVariables() {
Arguments args = getVariables();
return args.getArgumentsAsMap();
}
示例5: getUserDefinedVariables
import org.apache.jmeter.config.Arguments; //导入方法依赖的package包/类
public Map<String, String> getUserDefinedVariables() {
Arguments args = getVariables();
return args.getArgumentsAsMap();
}
示例6: JavaSamplerContext
import org.apache.jmeter.config.Arguments; //导入方法依赖的package包/类
/**
* Create a new JavaSampler with the specified initialization parameters.
*
* @param args
* the initialization parameters.
*/
public JavaSamplerContext(Arguments args) {
this.params = args.getArgumentsAsMap();
}