Class PublisherSampler
java.lang.Object
org.apache.jmeter.testelement.AbstractTestElement
org.apache.jmeter.samplers.AbstractSampler
org.apache.jmeter.protocol.jms.sampler.BaseJMSSampler
org.apache.jmeter.protocol.jms.sampler.PublisherSampler
- All Implemented Interfaces:
Serializable, Cloneable, ConfigMergabilityIndicator, Searchable, Sampler, TestElement, TestStateListener
This class implements the JMS Publisher sampler.
- See Also:
-
Field Summary
Fields inherited from interface TestElement
COMMENTS, ENABLED, GUI_CLASS, NAME, TEST_CLASS -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionreturn the source of the message Converts from old JMX files which used the local language stringgetFileContent(String path) The implementation uses TextFile to load the contents of the file and returns a string.booleansample()The implementation will publish n messages within a for loop.voidsetConfigChoice(String choice) set the source of the messagevoidvoidsetInputFile(String file) set the input file for the publishervoidsetJMSProperties(JMSProperties jmsProperties) voidsetMessageChoice(String choice) set the type of the messagevoidvoidsetRandomPath(String path) set the random path for the messagesvoidsetTextMessage(String message) set the text for the messagevoidsetUseNonPersistentDelivery(boolean value) voidendTest cleans up the clientvoidthe implementation calls testEnded() without any parameters.voidCalled just before the start of the test from the main engine thread.voidtestStarted(String test) the implementation calls testStarted() without any parameters.Methods inherited from class BaseJMSSampler
getConnectionFactory, getDestination, getIterationCount, getIterations, getJNDIInitialContextFactory, getMessageHeaders, getPassword, getProviderUrl, getReadResponse, getReadResponseAsBoolean, getUseJNDIProperties, getUseJNDIPropertiesAsBoolean, getUsername, isDestinationStatic, isUseAuth, sample, setConnectionFactory, setDestination, setDestinationStatic, setIterations, setJNDIIntialContextFactory, setPassword, setProviderUrl, setReadResponse, setUseAuth, setUseJNDIProperties, setUsernameMethods inherited from class AbstractSampler
appliesMethods inherited from class 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, 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 Object
finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface TestElement
addTestElement, canRemove, clear, clearTestElementChildren, clone, getComment, getName, getProperty, getPropertyAsBoolean, getPropertyAsBoolean, getPropertyAsDouble, getPropertyAsFloat, getPropertyAsInt, getPropertyAsInt, getPropertyAsLong, getPropertyAsLong, getPropertyAsString, getPropertyAsString, getThreadContext, getThreadName, isEnabled, isRunningVersion, isTemporary, propertyIterator, recoverRunningVersion, removeProperty, setComment, setEnabled, setName, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setRunningVersion, setTemporary, setThreadContext, setThreadName, traverse
-
Constructor Details
-
PublisherSampler
public PublisherSampler()
-
-
Method Details
-
testStarted
the implementation calls testStarted() without any parameters.- Specified by:
testStartedin interfaceTestStateListener- Parameters:
test- name of host- See Also:
-
testEnded
the implementation calls testEnded() without any parameters.- Specified by:
testEndedin interfaceTestStateListener- Parameters:
host- name of host- See Also:
-
testEnded
public void testEnded()endTest cleans up the client- Specified by:
testEndedin interfaceTestStateListener- See Also:
-
testStarted
public void testStarted()Description copied from interface:TestStateListenerCalled just before the start of the test from the main engine thread. This is before the test elements are cloned. Note that not all the test variables will have been set up at this point.
N.B. testStarted() and testEnded() are called from different threads.
- Specified by:
testStartedin interfaceTestStateListener- See Also:
-
sample
The implementation will publish n messages within a for loop. Once n messages are published, it sets the attributes of SampleResult.- Specified by:
samplein classBaseJMSSampler- Returns:
- the populated sample result
-
getFileContent
-
setConfigChoice
set the source of the message- Parameters:
choice- source of the messages. One ofJMSPublisherGui.USE_FILE_RSC,JMSPublisherGui.USE_RANDOM_RSCor JMSPublisherGui#USE_TEXT_RSC
-
getConfigChoice
return the source of the message Converts from old JMX files which used the local language string- Returns:
- source of the messages
-
setMessageChoice
set the type of the message- Parameters:
choice- type of the message (Text, Object, Map)
-
getMessageChoice
- Returns:
- the type of the message (Text, Object, Map)
-
setInputFile
set the input file for the publisher- Parameters:
file- input file for the publisher
-
getInputFile
- Returns:
- the path of the input file
-
setRandomPath
set the random path for the messages- Parameters:
path- random path for the messages
-
getRandomPath
- Returns:
- the random path for messages
-
setTextMessage
set the text for the message- Parameters:
message- text for the message
-
getTextMessage
- Returns:
- the text for the message
-
getExpiration
-
getPriority
-
setPriority
-
setExpiration
-
setUseNonPersistentDelivery
public void setUseNonPersistentDelivery(boolean value) - Parameters:
value- boolean use NON_PERSISTENT
-
getUseNonPersistentDelivery
public boolean getUseNonPersistentDelivery()- Returns:
- true if NON_PERSISTENT delivery must be used
-
getJMSProperties
- Returns:
JMSPropertiesJMS Properties
-
setJMSProperties
- Parameters:
jmsProperties- JMS Properties
-