public class JUnitSampler extends AbstractSampler implements ThreadListener
COMMENTS, ENABLED, GUI_CLASS, NAME, TEST_CLASS| Constructor and Description |
|---|
JUnitSampler() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
getAppendError()
If append error is not set, by default it is set to false,
which means users have to explicitly set the sampler to
append the assert errors.
|
boolean |
getAppendException()
If append exception is not set, by default it is set to
false. |
java.lang.String |
getClassname()
Gets the Classname attribute of the JavaConfig object
|
java.lang.String |
getConstructorString() |
boolean |
getCreateOneInstancePerSample() |
boolean |
getDoNotSetUpTearDown()
if the sample shouldn't call setup/teardown, the
method returns true.
|
java.lang.String |
getError() |
java.lang.String |
getErrorCode() |
java.lang.String |
getFailure() |
java.lang.String |
getFailureCode() |
java.lang.String |
getFilterString() |
boolean |
getJunit4()
Check if JUnit4 (annotations) are to be used instead of
the JUnit3 style (TestClass and specific method names)
|
java.lang.String |
getMethod() |
java.lang.String |
getSuccess() |
java.lang.String |
getSuccessCode() |
SampleResult |
sample(Entry entry)
Obtains statistics about the given Entry, and packages the information
into a SampleResult.
|
void |
setAppendError(boolean error)
Set whether to append errors or not.
|
void |
setAppendException(boolean exc)
Set whether to append exceptions or not.
|
void |
setClassname(java.lang.String classname)
Sets the Classname attribute of the JavaConfig object
|
void |
setConstructorString(java.lang.String constr)
Set the string label used to create an instance of the
test with the string constructor.
|
void |
setCreateOneInstancePerSample(boolean createOneInstancePerSample) |
void |
setDoNotSetUpTearDown(boolean setup)
set the setup/teardown option
|
void |
setError(java.lang.String error)
provide a descriptive error for the test method.
|
void |
setErrorCode(java.lang.String code)
Provide an unique error code for when the test
does not pass the assert test.
|
void |
setFailure(java.lang.String fail)
set the failure message
|
void |
setFailureCode(java.lang.String code)
Provide some unique code to denote a type of failure
|
void |
setFilterString(java.lang.String text)
set the filter string in comma separated format
|
void |
setJunit4(boolean junit4)
Set whether to use JUnit4 style or not.
|
void |
setMethod(java.lang.String methodName)
Method should add the JUnit testXXX method to the list at
the end, since the sequence matters.
|
void |
setSuccess(java.lang.String success)
set the success message
|
void |
setSuccessCode(java.lang.String code)
Set the success code.
|
void |
threadFinished()
Called for each thread after all samples have been processed.
|
void |
threadStarted()
Set up all variables that don't change between samples.
|
appliesaddPropertiesValues, addProperty, addProperty, addTestElement, canRemove, clear, clearTemporary, clearTestElementChildren, clone, emptyTemporary, equals, getComment, getName, getProperty, getPropertyAsBoolean, getPropertyAsBoolean, getPropertyAsDouble, getPropertyAsFloat, getPropertyAsInt, getPropertyAsInt, getPropertyAsLong, getPropertyAsLong, getPropertyAsString, getPropertyAsString, 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, traversePropertyfinalize, getClass, notify, notifyAll, toString, wait, wait, waitaddTestElement, canRemove, clear, clearTestElementChildren, clone, getComment, getName, getProperty, getPropertyAsBoolean, getPropertyAsBoolean, getPropertyAsDouble, getPropertyAsFloat, getPropertyAsInt, getPropertyAsInt, getPropertyAsLong, getPropertyAsLong, getPropertyAsString, getPropertyAsString, getThreadContext, getThreadName, isEnabled, isRunningVersion, isTemporary, propertyIterator, recoverRunningVersion, removed, removeProperty, setComment, setEnabled, setName, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setRunningVersion, setTemporary, setThreadContext, setThreadName, traversepublic void setClassname(java.lang.String classname)
classname - the new Classname valuepublic java.lang.String getClassname()
public void setConstructorString(java.lang.String constr)
constr - the string passed to the constructorpublic java.lang.String getConstructorString()
public java.lang.String getMethod()
public void setMethod(java.lang.String methodName)
methodName - name of the method to testpublic java.lang.String getSuccess()
public void setSuccess(java.lang.String success)
success - message to be used for successpublic java.lang.String getSuccessCode()
public void setSuccessCode(java.lang.String code)
code - unique success codepublic java.lang.String getFailure()
public void setFailure(java.lang.String fail)
fail - the failure messagepublic java.lang.String getFailureCode()
public void setFailureCode(java.lang.String code)
code - unique code to denote the type of failurepublic java.lang.String getError()
public void setError(java.lang.String error)
error - the description of the errorpublic java.lang.String getErrorCode()
public void setErrorCode(java.lang.String code)
code - unique error codepublic java.lang.String getFilterString()
public void setFilterString(java.lang.String text)
text - comma separated filterpublic boolean getDoNotSetUpTearDown()
public void setDoNotSetUpTearDown(boolean setup)
setup - flag whether the setup/teardown methods should not be calledpublic boolean getAppendError()
public void setAppendError(boolean error)
error - the setting to applypublic boolean getAppendException()
false.
Users have to explicitly set it to true to see the exceptions
in the result tree.public void setAppendException(boolean exc)
exc - the setting to apply.public boolean getJunit4()
public void setJunit4(boolean junit4)
junit4 - true if JUnit4 style is to be used.public SampleResult sample(Entry entry)
public void threadFinished()
ThreadListenerthreadFinished in interface ThreadListenerJMeterThread.threadFinished(org.apache.jmeter.engine.event.LoopIterationListener)public void threadStarted()
threadStarted in interface ThreadListenerJMeterThread.threadStarted()public void setCreateOneInstancePerSample(boolean createOneInstancePerSample)
createOneInstancePerSample - flag whether a new instance for each call should be createdpublic boolean getCreateOneInstancePerSample()
Copyright © 1998-2018 Apache Software Foundation. All Rights Reserved.