本文整理汇总了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);
}
示例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());
}
示例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);
}
示例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;
}
示例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;
}
示例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);
}