Apache JMeter

org.apache.jmeter.protocol.jms.sampler
Class PublisherSampler

java.lang.Object
  extended by org.apache.jmeter.testelement.AbstractTestElement
      extended by org.apache.jmeter.samplers.AbstractSampler
          extended by org.apache.jmeter.protocol.jms.sampler.BaseJMSSampler
              extended by org.apache.jmeter.protocol.jms.sampler.PublisherSampler
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, Sampler, TestElement, TestListener

public class PublisherSampler
extends BaseJMSSampler
implements TestListener

This class implements the JMS Publisher sampler.

See Also:
Serialized Form

Field Summary
 
Fields inherited from interface org.apache.jmeter.testelement.TestElement
COMMENTS, ENABLED, GUI_CLASS, NAME, TEST_CLASS
 
Constructor Summary
PublisherSampler()
           
 
Method Summary
 java.lang.String getConfigChoice()
          return the config choice Converts from old JMX files which used the local language string
 java.lang.String getFileContent(java.lang.String path)
          The implementation uses TextFile to load the contents of the file and returns a string.
 java.lang.String getInputFile()
          return the path of the input file
 java.lang.String getMessageChoice()
          return the source of the message
 java.lang.String getRandomPath()
          return the random path for messages
 java.lang.String getTextMessage()
          return the text for the message
 SampleResult sample()
          The implementation will publish n messages within a for loop.
 SampleResult sample(Entry e)
          The implementation calls sample() without any parameters
 void setConfigChoice(java.lang.String choice)
          set the config choice
 void setInputFile(java.lang.String file)
          set the input file for the publisher
 void setMessageChoice(java.lang.String choice)
          set the source of the message
 void setRandomPath(java.lang.String path)
          set the random path for the messages
 void setTextMessage(java.lang.String message)
          set the text for the message
 void testEnded()
          endTest cleans up the client
 void testEnded(java.lang.String test)
          the implementation calls testEnded() without any parameters.
 void testIterationStart(LoopIterationEvent event)
          NO implementation provided for the sampler.
 void testStarted()
           Called just before the start of the test from the main engine thread.
 void testStarted(java.lang.String test)
          the implementation calls testStarted() without any parameters.
 
Methods inherited from class org.apache.jmeter.protocol.jms.sampler.BaseJMSSampler
getConnectionFactory, getIterationCount, getIterations, getJNDIInitialContextFactory, getPassword, getProviderUrl, getReadResponse, getReadResponseAsBoolean, getTopic, getUseJNDIProperties, getUseJNDIPropertiesAsBoolean, getUsername, isUseAuth, setConnectionFactory, setIterations, setJNDIIntialContextFactory, setPassword, setProviderUrl, setReadResponse, setTopic, setUseAuth, setUseJNDIProperties, setUsername
 
Methods inherited from class org.apache.jmeter.testelement.AbstractTestElement
addProperty, addTestElement, canRemove, clear, clearTemporary, clone, emptyTemporary, equals, getComment, getName, getProperty, getPropertyAsBoolean, getPropertyAsBoolean, getPropertyAsDouble, getPropertyAsFloat, getPropertyAsInt, getPropertyAsInt, getPropertyAsLong, getPropertyAsString, getPropertyAsString, getThreadContext, getThreadName, hashCode, isEnabled, isRunningVersion, isTemporary, logProperties, mergeIn, propertyIterator, recoverRunningVersion, removeProperty, setComment, setName, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setRunningVersion, setTemporary, setThreadContext, setThreadName, traverse, traverseCollection, traverseMap, traverseProperty
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.jmeter.testelement.TestElement
addTestElement, canRemove, clear, clone, getComment, getName, getProperty, getPropertyAsBoolean, getPropertyAsBoolean, getPropertyAsDouble, getPropertyAsFloat, getPropertyAsInt, getPropertyAsInt, getPropertyAsLong, getPropertyAsString, getPropertyAsString, getThreadContext, getThreadName, isEnabled, isRunningVersion, isTemporary, propertyIterator, recoverRunningVersion, removeProperty, setComment, setName, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setRunningVersion, setTemporary, setThreadContext, setThreadName, traverse
 

Constructor Detail

PublisherSampler

public PublisherSampler()
Method Detail

testStarted

public void testStarted(java.lang.String test)
the implementation calls testStarted() without any parameters.

Specified by:
testStarted in interface TestListener
See Also:
StandardJMeterEngine.run()

testEnded

public void testEnded(java.lang.String test)
the implementation calls testEnded() without any parameters.

Specified by:
testEnded in interface TestListener
See Also:
StandardJMeterEngine.stopTest()

testEnded

public void testEnded()
endTest cleans up the client

Specified by:
testEnded in interface TestListener
See Also:
junit.framework.TestListener#endTest(junit.framework.Test)

testStarted

public void testStarted()
Description copied from interface: TestListener

Called 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:
testStarted in interface TestListener
See Also:
StandardJMeterEngine.run()

testIterationStart

public void testIterationStart(LoopIterationEvent event)
NO implementation provided for the sampler. It is necessary in this case.

Specified by:
testIterationStart in interface TestListener

sample

public SampleResult sample(Entry e)
The implementation calls sample() without any parameters

Specified by:
sample in interface Sampler
Overrides:
sample in class BaseJMSSampler

sample

public SampleResult sample()
The implementation will publish n messages within a for loop. Once n messages are published, it sets the attributes of SampleResult.

Specified by:
sample in class BaseJMSSampler
Returns:
the populated sample result

getFileContent

public java.lang.String getFileContent(java.lang.String path)
The implementation uses TextFile to load the contents of the file and returns a string.

Parameters:
path -
Returns:
the contents of the file

setConfigChoice

public void setConfigChoice(java.lang.String choice)
set the config choice

Parameters:
choice -

getConfigChoice

public java.lang.String getConfigChoice()
return the config choice Converts from old JMX files which used the local language string


setMessageChoice

public void setMessageChoice(java.lang.String choice)
set the source of the message

Parameters:
choice -

getMessageChoice

public java.lang.String getMessageChoice()
return the source of the message


setInputFile

public void setInputFile(java.lang.String file)
set the input file for the publisher

Parameters:
file -

getInputFile

public java.lang.String getInputFile()
return the path of the input file


setRandomPath

public void setRandomPath(java.lang.String path)
set the random path for the messages

Parameters:
path -

getRandomPath

public java.lang.String getRandomPath()
return the random path for messages


setTextMessage

public void setTextMessage(java.lang.String message)
set the text for the message

Parameters:
message -

getTextMessage

public java.lang.String getTextMessage()
return the text for the message


Apache JMeter

Copyright © 1998-2010 Apache Software Foundation. All Rights Reserved.