Class SystemSampler
java.lang.Object
org.apache.jmeter.testelement.AbstractTestElement
org.apache.jmeter.samplers.AbstractSampler
org.apache.jmeter.protocol.system.SystemSampler
- All Implemented Interfaces:
Serializable,Cloneable,org.apache.jmeter.engine.util.ConfigMergabilityIndicator,org.apache.jmeter.gui.Searchable,org.apache.jmeter.samplers.Sampler,org.apache.jmeter.testelement.TestElement
public class SystemSampler
extends org.apache.jmeter.samplers.AbstractSampler
A sampler for executing a System function.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.jmeter.testelement.TestElement
org.apache.jmeter.testelement.TestElement.Companion -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringstatic final Stringstatic final intstatic final Stringstatic final Stringstatic final StringFields inherited from interface org.apache.jmeter.testelement.TestElement
COMMENTS, Companion, ENABLED, GUI_CLASS, NAME, TEST_CLASS -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanapplies(org.apache.jmeter.config.ConfigTestElement configElement) org.apache.jmeter.config.ArgumentsGet the arguments (parameters) for the JavaSamplerClient to be executed with.booleanGets the Command attribute of the JavaConfig objectorg.apache.jmeter.config.ArgumentsGet the env variablesintgetStdin()longorg.apache.jmeter.samplers.SampleResultsample(org.apache.jmeter.samplers.Entry entry) Performs a test sample.voidsetArguments(org.apache.jmeter.config.Arguments args) Set the arguments (parameters) for the JavaSamplerClient to be executed with.voidsetCheckReturnCode(boolean checkit) voidsetCommand(String command) Sets the Command attribute of the JavaConfig objectvoidsetDirectory(String directory) Set the working directory to use for system commandsvoidsetEnvironmentVariables(org.apache.jmeter.config.Arguments arguments) voidsetExpectedReturnCode(int code) voidvoidvoidvoidsetTimout(long timeoutMs) Methods inherited from class org.apache.jmeter.testelement.AbstractTestElement
addPropertiesValues, addProperty, addProperty, addTestElement, canRemove, clear, clearTemporary, clearTestElementChildren, clone, emptyTemporary, equals, getComment, getName, getProperty, getPropertyAsBoolean, getPropertyAsBoolean, getPropertyAsDouble, getPropertyAsFloat, getPropertyAsInt, getPropertyAsInt, getPropertyAsLong, getPropertyAsLong, getPropertyAsString, getPropertyAsString, getPropertyOrNull, getSearchableTokens, getThreadContext, getThreadName, hashCode, isEnabled, isRunningVersion, isTemporary, logProperties, mergeIn, propertyIterator, recoverRunningVersion, removeProperty, setComment, setEnabled, setName, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setRunningVersion, setTemporary, setThreadContext, setThreadName, traverse, traverseCollection, traverseMap, traversePropertyMethods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.jmeter.testelement.TestElement
addTestElement, canRemove, clear, clearTestElementChildren, clone, get, get, get, get, get, get, get, get, get, getComment, getName, getOrCreate, getOrCreate, getOrNull, getOrNull, getOrNull, getProperty, getPropertyAsBoolean, getPropertyAsBoolean, getPropertyAsDouble, getPropertyAsFloat, getPropertyAsInt, getPropertyAsInt, getPropertyAsLong, getPropertyAsLong, getPropertyAsString, getPropertyAsString, getPropertyOrNull, getPropertyOrNull, getProps, getSchema, getString, getThreadContext, getThreadName, isEnabled, isRunningVersion, isTemporary, propertyIterator, recoverRunningVersion, removed, removeProperty, removeProperty, set, set, set, set, set, set, set, set, set, setComment, setEnabled, setName, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setRunningVersion, setTemporary, setThreadContext, setThreadName, traverse
-
Field Details
-
COMMAND
- See Also:
-
DIRECTORY
- See Also:
-
ARGUMENTS
- See Also:
-
ENVIRONMENT
- See Also:
-
CHECK_RETURN_CODE
- See Also:
-
EXPECTED_RETURN_CODE
- See Also:
-
DEFAULT_RETURN_CODE
public static final int DEFAULT_RETURN_CODE- See Also:
-
-
Constructor Details
-
SystemSampler
public SystemSampler()Create a SystemSampler.
-
-
Method Details
-
sample
public org.apache.jmeter.samplers.SampleResult sample(org.apache.jmeter.samplers.Entry entry) Performs a test sample.- Parameters:
entry- the Entry for this sample- Returns:
- test SampleResult
-
applies
public boolean applies(org.apache.jmeter.config.ConfigTestElement configElement) - Specified by:
appliesin interfaceorg.apache.jmeter.engine.util.ConfigMergabilityIndicator- Overrides:
appliesin classorg.apache.jmeter.samplers.AbstractSampler- See Also:
-
AbstractSampler.applies(org.apache.jmeter.config.ConfigTestElement)
-
getDirectory
- Returns:
- working directory to use for system commands
-
setDirectory
Set the working directory to use for system commands- Parameters:
directory- working directory to use for system commands
-
setCommand
Sets the Command attribute of the JavaConfig object- Parameters:
command- the new Command value
-
getCommand
Gets the Command attribute of the JavaConfig object- Returns:
- the Command value
-
setArguments
public void setArguments(org.apache.jmeter.config.Arguments args) Set the arguments (parameters) for the JavaSamplerClient to be executed with.- Parameters:
args- the new arguments. These replace any existing arguments.
-
getArguments
public org.apache.jmeter.config.Arguments getArguments()Get the arguments (parameters) for the JavaSamplerClient to be executed with.- Returns:
- the arguments
-
setCheckReturnCode
public void setCheckReturnCode(boolean checkit) - Parameters:
checkit- boolean indicates if we check or not return code
-
getCheckReturnCode
public boolean getCheckReturnCode()- Returns:
- boolean indicating if we check or not return code
-
setExpectedReturnCode
public void setExpectedReturnCode(int code) - Parameters:
code- expected return code
-
getExpectedReturnCode
public int getExpectedReturnCode()- Returns:
- expected return code
-
setEnvironmentVariables
public void setEnvironmentVariables(org.apache.jmeter.config.Arguments arguments) - Parameters:
arguments- Env vars
-
getEnvironmentVariables
public org.apache.jmeter.config.Arguments getEnvironmentVariables()Get the env variables- Returns:
- the arguments
-
getStdout
-
setStdout
-
getStderr
-
setStderr
-
getStdin
-
setStdin
-
getTimeout
public long getTimeout() -
setTimout
public void setTimout(long timeoutMs)
-