当前位置: 首页>>代码示例>>Java>>正文


Java HTTPArgument.setAlwaysEncoded方法代码示例

本文整理汇总了Java中org.apache.jmeter.protocol.http.util.HTTPArgument.setAlwaysEncoded方法的典型用法代码示例。如果您正苦于以下问题:Java HTTPArgument.setAlwaysEncoded方法的具体用法?Java HTTPArgument.setAlwaysEncoded怎么用?Java HTTPArgument.setAlwaysEncoded使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.jmeter.protocol.http.util.HTTPArgument的用法示例。


在下文中一共展示了HTTPArgument.setAlwaysEncoded方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: sampleTest2

import org.apache.jmeter.protocol.http.util.HTTPArgument; //导入方法依赖的package包/类
@Test
public void sampleTest2() throws Exception {
 http2Req.testStarted();
 
 Arguments args = new Arguments();
       String text = "{\"header\":{\"applicationId\":\"HJS\"},\"initSession\":{}}";
       HTTPArgument arg = new HTTPArgument("", text.replaceAll("\n","\r\n"), false);
       arg.setAlwaysEncoded(false);
       args.addArgument(arg);
       http2Req.setProperty(new TestElementProperty(HTTP2Request.ARGUMENTS, args));

 URL url = new URL("https", "www.sprint.com", 443, "/apiservices/framework/initSession");
 
 HTTP2Connection connection = Mockito.mock(HTTP2Connection.class);
 
 Mockito.when(connection.isClosed()).thenReturn(true);
 Mockito.doNothing().when(connection).connect(Mockito.any(String.class), Mockito.any(Integer.class));
 Mockito.when(connection.getConnectionId()).thenReturn("10www.sprint.com443");
 
 HTTP2SampleResult sampleResult =new HTTP2SampleResult(url, "POST");
 http2Req.addConnection("10www.sprint.com443", connection);
 http2Req.setConnection(url, sampleResult);
 http2Req.setProperty(new BooleanProperty(HTTP2Request.SYNCREQUEST, true));
 HTTP2SampleResult sample = http2Req.sample(url, "POST", false, 0, http2Req.getConnection(), sampleResult);
 
}
 
开发者ID:Blazemeter,项目名称:jmeter-bzm-plugins,代码行数:27,代码来源:HTTP2RequestTest.java

示例2: createPostContentTest

import org.apache.jmeter.protocol.http.util.HTTPArgument; //导入方法依赖的package包/类
@Test
public void createPostContentTest() throws Exception {
 String text = "{\"header\":{\"applicationId\":\"HJS\"},\"initSession\":{}}";
 
 
 DataPostContent dataPostExp = new DataPostContent();
 dataPostExp.setDataPath("/apiservices/framework/initSession");
 dataPostExp.setPayload(text.getBytes());
 		 
 Arguments args = new Arguments();
       
       HTTPArgument arg = new HTTPArgument("", text.replaceAll("\n","\r\n"), false);
       arg.setAlwaysEncoded(false);
       args.addArgument(arg);
       http2Req.setProperty(new TestElementProperty(HTTP2Request.ARGUMENTS, args));
 http2Req.setProperty(HTTP2Request.PATH, "/apiservices/framework/initSession");
       DataPostContent dataPostRes = http2Req.createPostContent("POST");
       
       assertEquals(dataPostExp.getDataPath(), dataPostRes.getDataPath());     
       
}
 
开发者ID:Blazemeter,项目名称:jmeter-bzm-plugins,代码行数:22,代码来源:HTTP2RequestTest.java

示例3: addNonEncodedArgument

import org.apache.jmeter.protocol.http.util.HTTPArgument; //导入方法依赖的package包/类
/**
 * Add a value that is not URL encoded, and make sure it
 * appears in the GUI that it will not be encoded when
 * the request is sent.
 *
 * @param name
 * @param value
 */
private void addNonEncodedArgument(String name, String value) {
    Arguments myArgs = getArguments();
    // The value is not encoded
    HTTPArgument arg = new HTTPArgument(name, value, false);
    // Let the GUI show that it will not be encoded
    arg.setAlwaysEncoded(false);
    myArgs.addArgument(arg);
}
 
开发者ID:johrstrom,项目名称:cloud-meter,代码行数:17,代码来源:MultipartUrlConfig.java

示例4: getTestElement

import org.apache.jmeter.protocol.http.util.HTTPArgument; //导入方法依赖的package包/类
public TestElement getTestElement() {
    Preconditions.checkNotNull(name);
    Preconditions.checkNotNull(value);

    HTTPArgument httpArgument = new HTTPArgument();
    httpArgument.setProperty(TestElement.GUI_CLASS, HTTPArgumentsPanel.class.getName().toString());
    httpArgument.setProperty(TestElement.TEST_CLASS, HTTPSamplerProxy.class.getName().toString());
    httpArgument.setName(name);
    httpArgument.setValue(value);
    httpArgument.setMetaData(getOptionalValue(metaData, "="));
    httpArgument.setUseEquals(getOptionalValue(useEquals, true));
    httpArgument.setAlwaysEncoded(getOptionalValue(setAlwaysEncoded, true));
    return httpArgument;
}
 
开发者ID:lithiumtech,项目名称:mineraloil-jmeter,代码行数:15,代码来源:HTTPArgumentElement.java

示例5: makeNewArgument

import org.apache.jmeter.protocol.http.util.HTTPArgument; //导入方法依赖的package包/类
@Override
protected HTTPArgument makeNewArgument() {
    HTTPArgument arg = new HTTPArgument("", "");
    arg.setAlwaysEncoded(false);
    arg.setUseEquals(true);
    return arg;
}
 
开发者ID:botelhojp,项目名称:apache-jmeter-2.10,代码行数:8,代码来源:HTTPArgumentsPanel.java

示例6: addNonEncodedArgument

import org.apache.jmeter.protocol.http.util.HTTPArgument; //导入方法依赖的package包/类
public void addNonEncodedArgument(String name, String value, String metadata) {
    HTTPArgument arg = new HTTPArgument(name, value, metadata, false);
    arg.setAlwaysEncoded(false);
    this.getArguments().addArgument(arg);
}
 
开发者ID:johrstrom,项目名称:cloud-meter,代码行数:6,代码来源:HTTPSamplerBase.java


注:本文中的org.apache.jmeter.protocol.http.util.HTTPArgument.setAlwaysEncoded方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。