Apache JMeter
2.1.1

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

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

public abstract class BaseJMSSampler
extends AbstractSampler
implements TestListener

Author:
pete BaseJMSSampler is an abstract class which provides implementation for common properties. Rather than duplicate the code, it's contained in the base class.
See Also:
Serialized Form

Field Summary
static String CONN_FACTORY
           
static String CREDENTIALS
           
static String ITERATIONS
           
static String JNDI_INITIAL_CONTEXT_FAC
           
static String not_req
           
static String PRINCIPAL
           
static String PROVIDER_URL
           
static String READ_RESPONSE
           
static String required
           
static String TOPIC
           
static String USE_AUTH
           
static String USE_PROPERTIES_FILE
           
 
Fields inherited from interface org.apache.jmeter.testelement.TestElement
ENABLED, GUI_CLASS, NAME, TEST_CLASS
 
Constructor Summary
BaseJMSSampler()
           
 
Method Summary
 String getConnectionFactory()
          return the connection factory parameter used to lookup the connection factory from the JMS server
 int getIterationCount()
          return the number of iterations as int instead of string
 String getIterations()
          get the iterations as string
 String getJNDIInitialContextFactory()
          method returns the initial context factory for jndi initial context lookup.
 String getPassword()
          return the password used to login to the jms server
 String getProviderUrl()
          method returns the provider url for jndi to connect to
 String getReadResponse()
          return whether the sampler should read the response
 boolean getReadResponseAsBoolean()
          return whether the sampler should read the response as a boolean value
 String getTopic()
          return the topic used for the benchmark
 String getUseAuth()
          return whether jndi requires authentication
 String getUseJNDIProperties()
          return whether the sampler should use properties file instead of UI parameters.
 boolean getUseJNDIPropertiesAsBoolean()
          return the properties as boolean true/false.
 String getUsername()
          return the username used to login to the jms server
 SampleResult sample(Entry e)
          Obtains statistics about the given Entry, and packages the information into a SampleResult.
 void setConnectionFactory(String factory)
          set the connection factory for
 void setIterations(String count)
          set the number of iterations the sampler should aggregate
 void setJNDIIntialContextFactory(String icf)
          set the initial context factory
 void setPassword(String pwd)
          Set the password to login to the jms server
 void setProviderUrl(String url)
          set the provider user for jndi
 void setReadResponse(String read)
          set whether the sampler should read the response or not
 void setTopic(String topic)
          set the topic
 void setUseAuth(String auth)
          Set whether authentication is required for JNDI
 void setUseJNDIProperties(String properties)
          if the sampler should use jndi.properties file, call the method with true
 void setUsername(String user)
          set the username to login into the jms server if needed
abstract  void testEnded()
          Called once for all threads after the end of a test
abstract  void testEnded(String host)
           
abstract  void testIterationStart(LoopIterationEvent event)
          Each time through a Thread Group's test script, an iteration event is fired.
abstract  void testStarted()
          Called just before the start of the test Note that not all the test variables will have been set up at this point.
abstract  void testStarted(String host)
           
 
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

JNDI_INITIAL_CONTEXT_FAC

public static final String JNDI_INITIAL_CONTEXT_FAC
See Also:
Constant Field Values

PROVIDER_URL

public static final String PROVIDER_URL
See Also:
Constant Field Values

CONN_FACTORY

public static final String CONN_FACTORY
See Also:
Constant Field Values

TOPIC

public static final String TOPIC
See Also:
Constant Field Values

PRINCIPAL

public static final String PRINCIPAL
See Also:
Constant Field Values

CREDENTIALS

public static final String CREDENTIALS
See Also:
Constant Field Values

ITERATIONS

public static final String ITERATIONS
See Also:
Constant Field Values

USE_AUTH

public static final String USE_AUTH
See Also:
Constant Field Values

USE_PROPERTIES_FILE

public static final String USE_PROPERTIES_FILE
See Also:
Constant Field Values

READ_RESPONSE

public static String READ_RESPONSE

required

public static String required

not_req

public static String not_req
Constructor Detail

BaseJMSSampler

public BaseJMSSampler()
Method Detail

testEnded

public abstract void testEnded(String host)
Specified by:
testEnded in interface TestListener

testStarted

public abstract void testStarted(String host)
Specified by:
testStarted in interface TestListener

testEnded

public abstract void testEnded()
Description copied from interface: TestListener
Called once for all threads after the end of a test

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

testStarted

public abstract void testStarted()
Description copied from interface: TestListener
Called just before the start of the test Note that not all the test variables will have been set up at this point.

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

testIterationStart

public abstract void testIterationStart(LoopIterationEvent event)
Description copied from interface: TestListener
Each time through a Thread Group's test script, an iteration event is fired.

Specified by:
testIterationStart in interface TestListener
Parameters:
event -

sample

public SampleResult sample(Entry e)
Description copied from interface: Sampler
Obtains statistics about the given Entry, and packages the information into a SampleResult.

Specified by:
sample in interface Sampler

setJNDIIntialContextFactory

public void setJNDIIntialContextFactory(String icf)
set the initial context factory

Parameters:
icf -

getJNDIInitialContextFactory

public String getJNDIInitialContextFactory()
method returns the initial context factory for jndi initial context lookup.

Returns:

setProviderUrl

public void setProviderUrl(String url)
set the provider user for jndi


getProviderUrl

public String getProviderUrl()
method returns the provider url for jndi to connect to

Returns:

setConnectionFactory

public void setConnectionFactory(String factory)
set the connection factory for

Parameters:
factory -

getConnectionFactory

public String getConnectionFactory()
return the connection factory parameter used to lookup the connection factory from the JMS server

Returns:

setTopic

public void setTopic(String topic)
set the topic

Parameters:
topic -

getTopic

public String getTopic()
return the topic used for the benchmark

Returns:

setUsername

public void setUsername(String user)
set the username to login into the jms server if needed

Parameters:
user -

getUsername

public String getUsername()
return the username used to login to the jms server

Returns:

setPassword

public void setPassword(String pwd)
Set the password to login to the jms server

Parameters:
pwd -

getPassword

public String getPassword()
return the password used to login to the jms server

Returns:

setIterations

public void setIterations(String count)
set the number of iterations the sampler should aggregate

Parameters:
count -

getIterations

public String getIterations()
get the iterations as string

Returns:

getIterationCount

public int getIterationCount()
return the number of iterations as int instead of string

Returns:

setUseAuth

public void setUseAuth(String auth)
Set whether authentication is required for JNDI

Parameters:
auth -

getUseAuth

public String getUseAuth()
return whether jndi requires authentication

Returns:

setReadResponse

public void setReadResponse(String read)
set whether the sampler should read the response or not

Parameters:
read -

getReadResponse

public String getReadResponse()
return whether the sampler should read the response

Returns:

getReadResponseAsBoolean

public boolean getReadResponseAsBoolean()
return whether the sampler should read the response as a boolean value

Returns:

setUseJNDIProperties

public void setUseJNDIProperties(String properties)
if the sampler should use jndi.properties file, call the method with true

Parameters:
properties -

getUseJNDIProperties

public String getUseJNDIProperties()
return whether the sampler should use properties file instead of UI parameters.

Returns:

getUseJNDIPropertiesAsBoolean

public boolean getUseJNDIPropertiesAsBoolean()
return the properties as boolean true/false.

Returns:

Apache JMeter
2.1.1

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