本文整理汇总了Java中org.apache.jmeter.config.Arguments类的典型用法代码示例。如果您正苦于以下问题:Java Arguments类的具体用法?Java Arguments怎么用?Java Arguments使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Arguments类属于org.apache.jmeter.config包,在下文中一共展示了Arguments类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getDefaultParameters
import org.apache.jmeter.config.Arguments; //导入依赖的package包/类
/**
* Set default parameters and their values
*
* @return
*/
@Override
public Arguments getDefaultParameters() {
Arguments defaultParameters = new Arguments();
defaultParameters.addArgument(ProducerConfig.BOOTSTRAP_SERVERS_CONFIG, ProducerKeys.BOOTSTRAP_SERVERS_CONFIG_DEFAULT);
defaultParameters.addArgument(ProducerKeys.ZOOKEEPER_SERVERS, ProducerKeys.ZOOKEEPER_SERVERS_DEFAULT);
defaultParameters.addArgument(ProducerKeys.KAFKA_TOPIC_CONFIG, ProducerKeys.KAFKA_TOPIC_CONFIG_DEFAULT);
defaultParameters.addArgument(ProducerConfig.KEY_SERIALIZER_CLASS_CONFIG, ProducerKeys.KEY_SERIALIZER_CLASS_CONFIG_DEFAULT);
defaultParameters.addArgument(ProducerConfig.VALUE_SERIALIZER_CLASS_CONFIG, ProducerKeys.VALUE_SERIALIZER_CLASS_CONFIG_DEFAULT);
defaultParameters.addArgument(ProducerConfig.COMPRESSION_TYPE_CONFIG, ProducerKeys.COMPRESSION_TYPE_CONFIG_DEFAULT);
defaultParameters.addArgument(ProducerConfig.BATCH_SIZE_CONFIG, ProducerKeys.BATCH_SIZE_CONFIG_DEFAULT);
defaultParameters.addArgument(ProducerConfig.LINGER_MS_CONFIG, ProducerKeys.LINGER_MS_CONFIG_DEFAULT);
defaultParameters.addArgument(ProducerConfig.BUFFER_MEMORY_CONFIG, ProducerKeys.BUFFER_MEMORY_CONFIG_DEFAULT);
defaultParameters.addArgument(ProducerConfig.ACKS_CONFIG, ProducerKeys.ACKS_CONFIG_DEFAULT);
defaultParameters.addArgument(ProducerConfig.SEND_BUFFER_CONFIG, ProducerKeys.SEND_BUFFER_CONFIG_DEFAULT);
defaultParameters.addArgument(ProducerConfig.RECEIVE_BUFFER_CONFIG, ProducerKeys.RECEIVE_BUFFER_CONFIG_DEFAULT);
defaultParameters.addArgument(CommonClientConfigs.SECURITY_PROTOCOL_CONFIG, SecurityProtocol.PLAINTEXT.name);
defaultParameters.addArgument(PropsKeys.MESSAGE_PLACEHOLDER_KEY, PropsKeys.MSG_PLACEHOLDER);
defaultParameters.addArgument(ProducerKeys.KERBEROS_ENABLED, ProducerKeys.KERBEROS_ENABLED_DEFULAT);
defaultParameters.addArgument(ProducerKeys.JAVA_SEC_AUTH_LOGIN_CONFIG, ProducerKeys.JAVA_SEC_AUTH_LOGIN_CONFIG_DEFAULT);
defaultParameters.addArgument(ProducerKeys.JAVA_SEC_KRB5_CONFIG, ProducerKeys.JAVA_SEC_KRB5_CONFIG_DEFAULT);
defaultParameters.addArgument(ProducerKeys.SASL_KERBEROS_SERVICE_NAME, ProducerKeys.SASL_KERBEROS_SERVICE_NAME_DEFAULT);
defaultParameters.addArgument(ProducerKeys.SASL_MECHANISM, ProducerKeys.SASL_MECHANISM_DEFAULT);
return defaultParameters;
}
示例2: configure
import org.apache.jmeter.config.Arguments; //导入依赖的package包/类
@Override
public void configure(TestElement element) {
super.configure(element);
if (element instanceof WebSocketConnectionSampler) {
WebSocketConnectionSampler WebSocketConnectionSamplerTestElement = (WebSocketConnectionSampler) element;
webSocketConnectionSamplerPanel.setServer(WebSocketConnectionSamplerTestElement.getServer());
webSocketConnectionSamplerPanel.setPort(Integer.toString(WebSocketConnectionSamplerTestElement.getPort()));
webSocketConnectionSamplerPanel.setConnectionTimeout(WebSocketConnectionSamplerTestElement.getConnectionTimeout());
webSocketConnectionSamplerPanel.setProtocol(WebSocketConnectionSamplerTestElement.getProtocol());
webSocketConnectionSamplerPanel.setPath(WebSocketConnectionSamplerTestElement.getPath());
webSocketConnectionSamplerPanel.setContentEncoding(WebSocketConnectionSamplerTestElement.getContentEncoding());
webSocketConnectionSamplerPanel.setConnectionId(WebSocketConnectionSamplerTestElement.getConnectionId());
webSocketConnectionSamplerPanel.setImplementation(WebSocketConnectionSamplerTestElement.getImplementation());
webSocketConnectionSamplerPanel.setCloseConnectionPattern(WebSocketConnectionSamplerTestElement.getCloseConnectionPattern());
Arguments queryStringParameters = WebSocketConnectionSamplerTestElement.getQueryStringParameters();
if (queryStringParameters != null) {
webSocketConnectionSamplerPanel.getAttributePanel().configure(queryStringParameters);
}
Arguments queryStringPatterns = WebSocketConnectionSamplerTestElement.getQueryStringPatterns();
if (queryStringPatterns != null) {
webSocketConnectionSamplerPanel.getPatternsPanel().configure(queryStringParameters);
}
}
}
示例3: createPostContent
import org.apache.jmeter.config.Arguments; //导入依赖的package包/类
/** Retorna el cuerpo que sera enviado en el post, de acuerdo a los parametros que obtenga */
public DataPostContent createPostContent(String method){
DataPostContent dpc = null;
if (method.equals("POST")) {
dpc = new DataPostContent();
//TODO set things
Arguments fafa = getArguments();
String valor = "";
for (JMeterProperty jmp : fafa) {
valor = ((HTTPArgument) jmp.getObjectValue()).getEncodedValue();
}
dpc.setPayload(valor.getBytes());
// TODO Code to send a file, need to figure out where is goes
dpc.setDataPath(getProperty(HTTP2Request.PATH).getStringValue());
}
return dpc;
}
示例4: sampleTest2
import org.apache.jmeter.config.Arguments; //导入依赖的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);
}
示例5: createPostContentTest
import org.apache.jmeter.config.Arguments; //导入依赖的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());
}
示例6: testFlow
import org.apache.jmeter.config.Arguments; //导入依赖的package包/类
@Test
public void testFlow() throws Exception {
StatusNotifierCallbackTest.StatusNotifierCallbackImpl notifier = new StatusNotifierCallbackTest.StatusNotifierCallbackImpl();
BlazeMeterBackendListenerClient client = new BLCEmul();
final Arguments arguments = new Arguments();
arguments.addArgument(BlazeMeterUploader.SHARE_TEST, Boolean.toString(false));
arguments.addArgument(BlazeMeterUploader.PROJECT, "project");
arguments.addArgument(BlazeMeterUploader.TITLE, "title");
client.setupTest(new BackendListenerContext(arguments));
client.setInformer(notifier);
client.initiateOnline();
assertNotNull(client.getApiClient());
client.handleSampleResults(BlazemeterAPIClientTest.generateResults(), null);
client.teardownTest(null);
String output = notifier.getBuffer().toString();
assertTrue(output.contains("No BlazeMeter API key provided, will upload anonymously"));
}
示例7: getDefaultParameters
import org.apache.jmeter.config.Arguments; //导入依赖的package包/类
@Override
public Arguments getDefaultParameters() {
Arguments arguments = new Arguments();
arguments.addArgument(KEY_TEST_NAME, "Test");
arguments.addArgument(KEY_NODE_NAME, "Test-Node");
arguments.addArgument(InfluxDBConfig.KEY_INFLUX_DB_HOST, "localhost");
arguments.addArgument(InfluxDBConfig.KEY_INFLUX_DB_PORT, Integer.toString(InfluxDBConfig.DEFAULT_PORT));
arguments.addArgument(InfluxDBConfig.KEY_INFLUX_DB_USER, "");
arguments.addArgument(InfluxDBConfig.KEY_INFLUX_DB_PASSWORD, "");
arguments.addArgument(InfluxDBConfig.KEY_INFLUX_DB_DATABASE, InfluxDBConfig.DEFAULT_DATABASE);
arguments.addArgument(InfluxDBConfig.KEY_RETENTION_POLICY, InfluxDBConfig.DEFAULT_RETENTION_POLICY);
arguments.addArgument(KEY_SAMPLERS_LIST, ".*");
arguments.addArgument(KEY_USE_REGEX_FOR_SAMPLER_LIST, "true");
arguments.addArgument(KEY_RECORD_SUB_SAMPLES, "true");
return arguments;
}
开发者ID:NovaTecConsulting,项目名称:JMeter-InfluxDB-Writer,代码行数:17,代码来源:JMeterInfluxDBBackendListenerClient.java
示例8: getDefaultParameters
import org.apache.jmeter.config.Arguments; //导入依赖的package包/类
@Override
public Arguments getDefaultParameters() {
Arguments parameters = new Arguments();
parameters.addArgument(ElasticsearchListenerParameters.ELASTICSEARCH_URL, "http://localhost:9200");
parameters.addArgument(ElasticsearchListenerParameters.ELASTICSEARCH_INDEX, null);
parameters.addArgument(ElasticsearchListenerParameters.ELASTICSEARCH_TYPE, null);
parameters.addArgument(ElasticsearchListenerParameters.ELASTICSEARCH_AUTH_METHOD, null);
parameters.addArgument(ElasticsearchListenerParameters.ELASTICSEARCH_USER, null);
parameters.addArgument(ElasticsearchListenerParameters.ELASTICSEARCH_PASSWORD, null);
parameters.addArgument(ElasticsearchListenerParameters.TIMEZONE_ID, "GMT");
parameters.addArgument(ElasticsearchListenerParameters.RESULT_EXCLUDED_ATTRIBUTES, null);
parameters.addArgument(ElasticsearchListenerParameters.PROXY_URL, null);
parameters.addArgument(ElasticsearchListenerParameters.PROXY_AUTH_METHOD, null);
parameters.addArgument(ElasticsearchListenerParameters.PROXY_USER, null);
parameters.addArgument(ElasticsearchListenerParameters.PROXY_PASSWORD, null);
parameters.addArgument(ElasticsearchListenerParameters.PROXY_WORKSTATION, null);
parameters.addArgument(ElasticsearchListenerParameters.PROXY_DOMAIN, null);
parameters.addArgument(ElasticsearchListenerParameters.X_CONN_TRUST_ALL_CERTS, "false");
return parameters;
}
开发者ID:vadim-klimov,项目名称:apache-jmeter-listener-elasticsearch,代码行数:25,代码来源:ElasticsearchListener.java
示例9: getDefaultParameters
import org.apache.jmeter.config.Arguments; //导入依赖的package包/类
/**
* Provide a list of parameters which this test supports. Any parameter
* names and associated values returned by this method will appear in the
* GUI by default so the user doesn't have to remember the exact names. The
* user can add other parameters which are not listed here. If this method
* returns null then no parameters will be listed. If the value for some
* parameter is null then that parameter will be listed in the GUI with an
* empty value.
*
* @return a specification of the parameters used by this test which should
* be listed in the GUI, or null if no parameters should be listed.
*/
@Override
public Arguments getDefaultParameters() {
Arguments params = new Arguments();
params.addArgument("APIGATEWAY_BASE_URL", "${APIGATEWAY_BASE_URL}");
params.addArgument("ACCESS_KEY_ID", "${ACCESS_KEY_ID}");
params.addArgument("SECRET_KEY", "${SECRET_KEY}");
params.addArgument("SESSION_TOKEN", "${SESSION_TOKEN}");
params.addArgument("REGION", "${REGION}");
params.addArgument("BOOKING_NAME", "${BOOKING_NAME}");
params.addArgument("COURT", "${COURT}");
params.addArgument("COURTSPAN", "${COURTSPAN}");
params.addArgument("SLOT", "${SLOT}");
params.addArgument("SLOTSPAN", "${SLOTSPAN}");
params.addArgument("DATE", "${DATE}");
params.addArgument("PUT_OR_DELETE", "${PUT_OR_DELETE}");
return params;
}
示例10: sample
import org.apache.jmeter.config.Arguments; //导入依赖的package包/类
/**
* Performs a test sample.
*
* The <code>sample()</code> method retrieves the reference to the Java
* client and calls its <code>runTest()</code> method.
*
* @see JavaSamplerClient#runTest(JavaSamplerContext)
*
* @param entry
* the Entry for this sample
* @return test SampleResult
*/
@Override
public SampleResult sample(Entry entry) {
Arguments args = getArguments();
args.addArgument(TestElement.NAME, getName()); // Allow Sampler access
// to test element name
context = new JavaSamplerContext(args);
if (javaClient == null) {
log.debug(whoAmI() + "\tCreating Java Client");
javaClient = createJavaClient();
javaClient.setupTest(context);
}
SampleResult result = javaClient.runTest(context);
// Only set the default label if it has not been set
if (result != null && result.getSampleLabel().length() == 0) {
result.setSampleLabel(getName());
}
return result;
}
示例11: initilizeElement
import org.apache.jmeter.config.Arguments; //导入依赖的package包/类
@Override
public TestElement initilizeElement() {
SystemSampler ele = new SystemSampler();
this.baseElement(ele, "OS Process Sampler");
Arguments args = (Arguments) new ArgumentsInitializer().initilizeElement();
Arguments envVars = (Arguments) new ArgumentsInitializer().initilizeElement();
ele.setArguments(args);
ele.setEnvironmentVariables(envVars);
ele.setCheckReturnCode(false);
ele.setCommand(EMPTY_STRING);
ele.setDirectory(EMPTY_STRING);
ele.setExpectedReturnCode(0);
return ele;
}
示例12: createArgs
import org.apache.jmeter.config.Arguments; //导入依赖的package包/类
private Arguments createArgs() {
Arguments args = new Arguments(); //can't use arg initer bc this has no TestElement.name
args.setEnabled(true);
args.setTestClass(args.getClass().getName());
args.addArgument("Label", EMPTY_STRING);
args.addArgument("ResponseMessage", EMPTY_STRING);
args.addArgument("ResponseCode", EMPTY_STRING);
args.addArgument("ResultData", EMPTY_STRING);
args.addArgument("SamplerData", EMPTY_STRING);
args.addArgument("Sleep_Mask", "0xFF");
args.addArgument("Sleep_Time", "100");
args.addArgument("Status", "OK");
return args;
}
示例13: initilizeElement
import org.apache.jmeter.config.Arguments; //导入依赖的package包/类
@Override
public TestElement initilizeElement() {
LDAPSampler ele = new LDAPSampler();
Arguments args = (Arguments) new ArgumentsInitializer().initilizeElement();
ele.setArguments(args);
ele.setProperty(ConfigTestElement.USERNAME, EMPTY_STRING);
ele.setProperty(ConfigTestElement.PASSWORD, EMPTY_STRING);
ele.setProperty("base_entry_dn", EMPTY_STRING);
ele.setProperty("port", EMPTY_STRING);
ele.setProperty("rootdn", EMPTY_STRING);
ele.setProperty("servername", EMPTY_STRING);
ele.setProperty("test", "add");
ele.setProperty("user_defined", false);
this.baseElement(ele, "LDAP Request");
return ele;
}
示例14: initilizeElement
import org.apache.jmeter.config.Arguments; //导入依赖的package包/类
@Override
public TestElement initilizeElement() {
HTTPSamplerProxy ele = new HTTPSamplerProxy();
this.baseElement(ele, DEFAULT_NAME);
ArgumentsInitializer initer = new ArgumentsInitializer();
ele.setArguments((Arguments) initer.initilizeElement());
ele.setProperty(HTTPSamplerProxy.DOMAIN, EMPTY_STRING);
ele.setProperty(HTTPSamplerProxy.PORT, EMPTY_STRING);
ele.setProperty(HTTPSamplerProxy.PROTOCOL, EMPTY_STRING);
ele.setProperty(HTTPSamplerProxy.CONTENT_ENCODING, EMPTY_STRING);
ele.setProperty(HTTPSamplerProxy.PATH, EMPTY_STRING);
ele.setProperty(HTTPSamplerProxy.METHOD, EMPTY_STRING);
ele.setProperty(HTTPSamplerProxy.FOLLOW_REDIRECTS, true);
ele.setProperty(HTTPSamplerProxy.AUTO_REDIRECTS, false);
ele.setProperty(HTTPSamplerProxy.USE_KEEPALIVE, true);
ele.setProperty(HTTPSamplerProxy.DO_MULTIPART_POST, false);
ele.setProperty(HTTPSamplerProxy.EMBEDDED_URL_RE, EMPTY_STRING);
ele.setProperty(HTTPSamplerProxy.CONNECT_TIMEOUT, EMPTY_STRING);
ele.setProperty(HTTPSamplerProxy.RESPONSE_TIMEOUT, EMPTY_STRING);
ele.setProperty(HTTPSamplerProxy.METHOD , HTTPSamplerProxy.DEFAULT_METHOD);
return ele;
}
示例15: initilizeElement
import org.apache.jmeter.config.Arguments; //导入依赖的package包/类
@Override
public TestElement initilizeElement() {
AjpSampler ele = new AjpSampler();
this.baseElement(ele, "AJP/1.3 Sampler");
ArgumentsInitializer initer = new ArgumentsInitializer();
ele.setArguments((Arguments) initer.initilizeElement());
ele.setFollowRedirects(true);
ele.setMethod(HTTPSamplerBase.GET);
ele.setDoMultipartPost(false);
ele.setContentEncoding(EMPTY_STRING);
ele.setDomain(EMPTY_STRING);
ele.setEmbeddedUrlRE(EMPTY_STRING);
ele.setPath(EMPTY_STRING);
ele.setAutoRedirects(false);
ele.setFollowRedirects(true);
ele.setUseKeepAlive(true);
ele.setPort(80);
ele.setProtocol(EMPTY_STRING);
return ele;
}