Apache JMeter
2.1.1

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

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

public class PublisherSampler
extends BaseJMSSampler
implements TestListener

Author:
pete To change the template for this generated type comment go to Window>Preferences>Java>Code Generation>Code and Comments
See Also:
Serialized Form

Field Summary
static String CONFIG_CHOICE
           
static String INPUT_FILE
           
static String MESSAGE_CHOICE
           
static String RANDOM_PATH
           
static String TEXT_MSG
           
 
Fields inherited from class org.apache.jmeter.protocol.jms.sampler.BaseJMSSampler
CONN_FACTORY, CREDENTIALS, ITERATIONS, JNDI_INITIAL_CONTEXT_FAC, not_req, PRINCIPAL, PROVIDER_URL, READ_RESPONSE, required, TOPIC, USE_AUTH, USE_PROPERTIES_FILE
 
Fields inherited from interface org.apache.jmeter.testelement.TestElement
ENABLED, GUI_CLASS, NAME, TEST_CLASS
 
Constructor Summary
PublisherSampler()
           
 
Method Summary
 String getConfigChoice()
          return the config choice
 String getFileContent(String path)
          The implementation uses TextFile to load the contents of the file and returns a string.
 String getInputFile()
          return the path of the input file
 String getMessageChoice()
          return the source of the message
 String getMessageContent()
          Method will check the setting and get the contents for the message.
 String getRandomPath()
          return the random path for messages
 String getTextMessage()
          return the text for the message
 void initClient()
          initialize the Publisher client.
 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(String choice)
          set the config choice
 void setInputFile(String file)
          set the input file for the publisher
 void setMessageChoice(String choice)
          set the source of the message
 void setRandomPath(String path)
          set the random path for the messages
 void setTextMessage(String message)
          set the text for the message
 void testEnded()
          endTest cleans up the client
 void testEnded(String test)
          the implementation calls testEnded() without any parameters.
 void testIterationStart(LoopIterationEvent event)
          NO implementation provided for the sampler.
 void testStarted()
          the implementation creates a new StringBuffer
 void testStarted(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, getUseAuth, getUseJNDIProperties, getUseJNDIPropertiesAsBoolean, getUsername, 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, getName, getProperty, getPropertyAsBoolean, getPropertyAsBoolean, getPropertyAsDouble, getPropertyAsFloat, getPropertyAsInt, getPropertyAsLong, getPropertyAsString, getThreadContext, getThreadName, isEnabled, isRunningVersion, isTemporary, logProperties, mergeIn, nextIsNull, propertyIterator, recoverRunningVersion, removeProperty, setName, setProperty, setProperty, setRunningVersion, setTemporary, setThreadContext, setThreadName, threadFinished, threadStarted, traverse, traverseCollection, traverseMap, traverseProperty
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.jmeter.testelement.TestElement
addTestElement, canRemove, clear, clone, getProperty, getPropertyAsBoolean, getPropertyAsFloat, getPropertyAsInt, getPropertyAsLong, getPropertyAsString, getThreadContext, getThreadName, isEnabled, isRunningVersion, isTemporary, propertyIterator, recoverRunningVersion, removeProperty, setProperty, setProperty, setRunningVersion, setTemporary, setThreadContext, setThreadName, threadFinished, threadStarted, traverse
 

Field Detail

INPUT_FILE

public static final String INPUT_FILE
See Also:
Constant Field Values

RANDOM_PATH

public static final String RANDOM_PATH
See Also:
Constant Field Values

TEXT_MSG

public static final String TEXT_MSG
See Also:
Constant Field Values

CONFIG_CHOICE

public static final String CONFIG_CHOICE
See Also:
Constant Field Values

MESSAGE_CHOICE

public static final String MESSAGE_CHOICE
See Also:
Constant Field Values
Constructor Detail

PublisherSampler

public PublisherSampler()
Method Detail

testStarted

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

Specified by:
testStarted in interface TestListener
Specified by:
testStarted in class BaseJMSSampler

testEnded

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

Specified by:
testEnded in interface TestListener
Specified by:
testEnded in class BaseJMSSampler

testEnded

public void testEnded()
endTest cleans up the client

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

testStarted

public void testStarted()
the implementation creates a new StringBuffer

Specified by:
testStarted in interface TestListener
Specified by:
testStarted in class BaseJMSSampler

testIterationStart

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

Specified by:
testIterationStart in interface TestListener
Specified by:
testIterationStart in class BaseJMSSampler

initClient

public void initClient()
initialize the Publisher client.


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.

Returns:

getMessageContent

public String getMessageContent()
Method will check the setting and get the contents for the message.

Returns:

getFileContent

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

Parameters:
path -
Returns:

setConfigChoice

public void setConfigChoice(String choice)
set the config choice

Parameters:
choice -

getConfigChoice

public String getConfigChoice()
return the config choice

Returns:

setMessageChoice

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

Parameters:
choice -

getMessageChoice

public String getMessageChoice()
return the source of the message

Returns:

setInputFile

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

Parameters:
file -

getInputFile

public String getInputFile()
return the path of the input file

Returns:

setRandomPath

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

Parameters:
path -

getRandomPath

public String getRandomPath()
return the random path for messages

Returns:

setTextMessage

public void setTextMessage(String message)
set the text for the message

Parameters:
message -

getTextMessage

public String getTextMessage()
return the text for the message

Returns:

Apache JMeter
2.1.1

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