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,- org.apache.jmeter.testelement.TestElement,- TestStateListener
This class implements the JMS Publisher sampler.
- See Also:
- 
Nested Class SummaryNested classes/interfaces inherited from interface org.apache.jmeter.testelement.TestElementorg.apache.jmeter.testelement.TestElement.Companion
- 
Field SummaryFieldsModifier and TypeFieldDescriptionstatic final StringEncoding value to sent parsed data but read with default system encodingConstant for system default encodingsstatic final StringEncoding value to sent data as is (no variabilisation)Fields inherited from interface org.apache.jmeter.testelement.TestElementCOMMENTS, Companion, ENABLED, GUI_CLASS, NAME, TEST_CLASS
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionbuildCache(String configChoice) return the source of the message Converts from old JMX files which used the local language stringGets file encoding to use.static String[]Init available encoding using constants, then JVM standard onesbooleansample()The implementation will publish n messages within a for loop.voidsetConfigChoice(String choice) set the source of the messagevoidvoidsetFileEncoding(String fileEncoding) Sets file encoding to use.voidsetInputFile(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 org.apache.jmeter.protocol.jms.sampler.BaseJMSSamplerconfigureIsReconnectErrorCode, getConnectionFactory, getDestination, getIsReconnectErrorCode, getIterationCount, getIterations, getJNDIInitialContextFactory, getMessageHeaders, getPassword, getProviderUrl, getReadResponse, getReadResponseAsBoolean, getReconnectionErrorCodes, getUseJNDIProperties, getUseJNDIPropertiesAsBoolean, getUsername, isDestinationStatic, isUseAuth, sample, setConnectionFactory, setDestination, setDestinationStatic, setIterations, setJNDIIntialContextFactory, setPassword, setProviderUrl, setReadResponse, setReconnectionErrorCodes, setUseAuth, setUseJNDIProperties, setUsernameMethods inherited from class org.apache.jmeter.samplers.AbstractSamplerappliesMethods inherited from class org.apache.jmeter.testelement.AbstractTestElementaddPropertiesValues, 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.Objectfinalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.jmeter.testelement.TestElementaddTestElement, 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- 
RAW_DATAEncoding value to sent data as is (no variabilisation)- See Also:
 
- 
DEFAULT_ENCODINGEncoding value to sent parsed data but read with default system encoding- See Also:
 
- 
NO_ENCODINGConstant for system default encodings
 
- 
- 
Constructor Details- 
PublisherSamplerpublic PublisherSampler()
 
- 
- 
Method Details- 
getSupportedEncodingsInit available encoding using constants, then JVM standard ones- Returns:
- Array of String containing supported encodings
 
- 
testStartedthe implementation calls testStarted() without any parameters.- Specified by:
- testStartedin interface- TestStateListener
- Parameters:
- test- name of host
- See Also:
 
- 
testEndedthe implementation calls testEnded() without any parameters.- Specified by:
- testEndedin interface- TestStateListener
- Parameters:
- host- name of host
- See Also:
 
- 
testEndedpublic void testEnded()endTest cleans up the client- Specified by:
- testEndedin interface- TestStateListener
- See Also:
 
- 
testStartedpublic 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 interface- TestStateListener
- See Also:
 
- 
sampleThe implementation will publish n messages within a for loop. Once n messages are published, it sets the attributes of SampleResult.- Specified by:
- samplein class- BaseJMSSampler
- Returns:
- the populated sample result
 
- 
buildCache
- 
setConfigChoiceset the source of the message- Parameters:
- choice- source of the messages. One of- JMSPublisherGui.USE_FILE_RSC,- JMSPublisherGui.USE_RANDOM_RSCor JMSPublisherGui#USE_TEXT_RSC
 
- 
getConfigChoicereturn the source of the message Converts from old JMX files which used the local language string- Returns:
- source of the messages
 
- 
setMessageChoiceset the type of the message- Parameters:
- choice- type of the message (Text, Object, Map)
 
- 
getMessageChoice- Returns:
- the type of the message (Text, Object, Map)
 
- 
setInputFileset the input file for the publisher- Parameters:
- file- input file for the publisher
 
- 
getInputFile- Returns:
- the path of the input file
 
- 
setRandomPathset the random path for the messages- Parameters:
- path- random path for the messages
 
- 
getRandomPath- Returns:
- the random path for messages
 
- 
setTextMessageset the text for the message- Parameters:
- message- text for the message
 
- 
getTextMessage- Returns:
- the text for the message
 
- 
getExpiration
- 
getPriority
- 
setPriority
- 
setExpiration
- 
setUseNonPersistentDeliverypublic void setUseNonPersistentDelivery(boolean value) - Parameters:
- value- boolean use NON_PERSISTENT
 
- 
getUseNonPersistentDeliverypublic boolean getUseNonPersistentDelivery()- Returns:
- true if NON_PERSISTENT delivery must be used
 
- 
getJMSProperties- Returns:
- JMSPropertiesJMS Properties
 
- 
setJMSProperties- Parameters:
- jmsProperties- JMS Properties
 
- 
getFileEncodingGets file encoding to use. IfRAW_DATA, content isn't parsed.- Returns:
- File encoding.
- See Also:
 
- 
setFileEncodingSets file encoding to use. IfRAW_DATA, content isn't parsed.- Parameters:
- fileEncoding- File encoding.
- See Also:
 
 
-