本文整理汇总了Java中org.apache.jmeter.config.Arguments.addArgument方法的典型用法代码示例。如果您正苦于以下问题:Java Arguments.addArgument方法的具体用法?Java Arguments.addArgument怎么用?Java Arguments.addArgument使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.jmeter.config.Arguments
的用法示例。
在下文中一共展示了Arguments.addArgument方法的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: 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);
}
示例3: 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());
}
示例4: 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"));
}
示例5: 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
示例6: 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
示例7: 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;
}
示例8: 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;
}
示例9: 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;
}
示例10: getDefaultParameters
import org.apache.jmeter.config.Arguments; //导入方法依赖的package包/类
@Override
public Arguments getDefaultParameters() {
Arguments defaultParameters = new Arguments();
defaultParameters.addArgument("ZK_HOST", "localhost:2181");
defaultParameters.addArgument("COLLECTION", "cloud");
defaultParameters.addArgument("BATCH_SIZE", "100");
defaultParameters.addArgument("NUM_DOCS_PER_LOOP", "10000");
defaultParameters.addArgument("THREAD_ID", "${__threadNum}");
defaultParameters.addArgument("ID_PREFIX", "id-");
defaultParameters.addArgument("RANDOM_SEED", "5150");
defaultParameters.addArgument("COMMIT_AT_END", "true");
defaultParameters.addArgument("FUSION_INDEX_PIPELINE",
"http://localhost:8765/lucid/api/v1/index-pipelines/conn_logging/collections/${collection}/index");
defaultParameters.addArgument("ENDPOINT_TYPE", "fusion");
defaultParameters.addArgument("FUSION_CONTENT_TYPE", FusionPipelineClient.PIPELINE_DOC_CONTENT_TYPE);
return defaultParameters;
}
示例11: getDefaultParameters
import org.apache.jmeter.config.Arguments; //导入方法依赖的package包/类
@Override
public Arguments getDefaultParameters() {
Arguments defaultParameters = new Arguments();
defaultParameters.addArgument("ZK_HOST", "localhost:9983");
defaultParameters.addArgument("COLLECTION", "gettingstarted");
defaultParameters.addArgument("RANDOM_SEED", "5150");
defaultParameters.addArgument("LOG_DIR", "/tmp/solr_logs");
defaultParameters.addArgument("SLOW_QUERY_THRESHOLD_MS", "1500");
defaultParameters.addArgument("MODE", "solr");
defaultParameters.addArgument("FUSION_QUERY_ENDPOINTS", "");
defaultParameters.addArgument("FUSION_USER", "admin");
defaultParameters.addArgument("FUSION_PASS", "");
defaultParameters.addArgument("FUSION_REALM", "native");
defaultParameters.addArgument("FUSION_AUTH", "true");
return defaultParameters;
}
示例12: testArguments
import org.apache.jmeter.config.Arguments; //导入方法依赖的package包/类
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());
assertEquals("config1=configValue", args.getArgument(1).toString());
te.recoverRunningVersion();
te.addTestElement(te2);
assertEquals(2, args.getArgumentCount());
assertEquals("config1=configValue", args.getArgument(1).toString());
}
示例13: createArguments
import org.apache.jmeter.config.Arguments; //导入方法依赖的package包/类
private Arguments createArguments() {
final Arguments arguments = new Arguments();
arguments.addArgument(PROJECT, getProject());
arguments.addArgument(TITLE, getTitle());
arguments.addArgument(COLOR, getColorFlag());
arguments.addArgument(UPLOAD_TOKEN, getUploadToken());
arguments.addArgument(USE_ONLINE, Boolean.toString(isUseOnline()));
arguments.addArgument(STORE_DIR, getStoreDir());
arguments.addArgument(FILE_NAME, fileName);
return arguments;
}
示例14: createArguments
import org.apache.jmeter.config.Arguments; //导入方法依赖的package包/类
private Arguments createArguments() {
final Arguments arguments = new Arguments();
arguments.addArgument(SHARE_TEST, Boolean.toString(isShareTest()));
arguments.addArgument(PROJECT, getProject());
arguments.addArgument(TITLE, getTitle());
arguments.addArgument(UPLOAD_TOKEN, getUploadToken());
return arguments;
}
示例15: getDefaultParameters
import org.apache.jmeter.config.Arguments; //导入方法依赖的package包/类
@Override
public Arguments getDefaultParameters() {
Arguments parameters = new Arguments();
parameters.addArgument(ES_SCHEME, "http");
parameters.addArgument(ES_HOST, null);
parameters.addArgument(ES_PORT, "9200");
parameters.addArgument(ES_INDEX, null);
parameters.addArgument(ES_TIMESTAMP, "yyyy-MM-dd'T'HH:mm:ss.SSSZZ");
parameters.addArgument(ES_STATUS_CODE, "531");
parameters.addArgument(ES_BULK_SIZE, "100");
parameters.addArgument(ES_TIMEOUT_MS, Long.toString(DEFAULT_TIMEOUT_MS));
return parameters;
}