use of org.apache.jmeter.config.Argument in project jmeter by apache.
the class SmtpPanel method setHeaderFields.
public void setHeaderFields(CollectionProperty fields) {
clearHeaderFields();
for (int i = 0; i < fields.size(); i++) {
Argument argument = (Argument) fields.get(i).getObjectValue();
String name = argument.getName();
JButton removeButton = addHeaderActionPerformed(null);
JTextField nameTF = removeButtons.get(removeButton);
nameTF.setText(name);
JTextField valueTF = headerFields.get(nameTF);
valueTF.setText(argument.getValue());
}
validate();
}
use of org.apache.jmeter.config.Argument in project jmeter by apache.
the class SendMailCommand method addHeader.
/**
* Adds a header-part to current HashMap of headers - to be called by
* SmtpSampler-object
*
* @param headerName
* Key for current header
* @param headerValue
* Value for current header
*/
public void addHeader(String headerName, String headerValue) {
if (this.headerFields == null) {
this.headerFields = new CollectionProperty();
}
Argument argument = new Argument(headerName, headerValue);
this.headerFields.addItem(argument);
}
use of org.apache.jmeter.config.Argument in project jmeter by apache.
the class HTTPArgument method convertArgumentsToHTTP.
/**
* Converts all {@link Argument} entries in the collection to {@link HTTPArgument} entries.
*
* @param args collection of {@link Argument} and/or {@link HTTPArgument} entries
*/
public static void convertArgumentsToHTTP(Arguments args) {
List<Argument> newArguments = new LinkedList<>();
for (JMeterProperty jMeterProperty : args.getArguments()) {
Argument arg = (Argument) jMeterProperty.getObjectValue();
if (!(arg instanceof HTTPArgument)) {
newArguments.add(new HTTPArgument(arg));
} else {
newArguments.add(arg);
}
}
args.removeAllArguments();
args.setArguments(newArguments);
}
Aggregations