Class DataSourceElement
- java.lang.Object
-
- org.apache.jmeter.testelement.AbstractTestElement
-
- org.apache.jmeter.protocol.jdbc.config.DataSourceElement
-
- All Implemented Interfaces:
Serializable,Cloneable,ConfigElement,Searchable,TestBean,TestElement,TestStateListener
public class DataSourceElement extends AbstractTestElement implements ConfigElement, TestStateListener, TestBean
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from interface org.apache.jmeter.testelement.TestElement
COMMENTS, ENABLED, GUI_CLASS, NAME, TEST_CLASS
-
-
Constructor Summary
Constructors Constructor Description DataSourceElement()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddConfigElement(ConfigElement config)Add a configuration element to this one.Objectclone()booleanexpectsModification()If your config element expects to be modified in the process of a test run, and you want those modifications to carry over from sample to sample (as in a cookie manager - you want to save all cookies that get set throughout the test), then return true for this method.StringgetCheckQuery()static ConnectiongetConnection(String poolName)StringgetConnectionAge()StringgetDataSource()StringgetDbUrl()StringgetDriver()StringgetPassword()StringgetPoolMax()StringgetTimeout()StringgetTransactionIsolation()StringgetTrimInterval()StringgetUsername()booleanisAutocommit()booleanisKeepAlive()voidsetAutocommit(boolean autocommit)voidsetCheckQuery(String checkQuery)voidsetConnectionAge(String connectionAge)voidsetDataSource(String dataSource)voidsetDbUrl(String dbUrl)voidsetDriver(String driver)voidsetKeepAlive(boolean keepAlive)voidsetPassword(String password)voidsetPoolMax(String poolMax)voidsetTimeout(String timeout)voidsetTransactionIsolation(String transactionIsolation)voidsetTrimInterval(String trimInterval)voidsetUsername(String username)voidtestEnded()Called once for all threads after the end of a test.voidtestEnded(String host)Called once for all threads after the end of a test.voidtestStarted()Called just before the start of the test from the main engine thread.voidtestStarted(String host)Called just before the start of the test from the main engine thread.-
Methods inherited from class org.apache.jmeter.testelement.AbstractTestElement
addPropertiesValues, addProperty, addProperty, addTestElement, canRemove, clear, clearTemporary, clearTestElementChildren, 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, traverseProperty
-
-
-
-
Method Detail
-
testEnded
public void testEnded()
Description copied from interface:TestStateListenerCalled once for all threads after the end of a test. This will use the same element instances as at the start of the test.
N.B. testStarted() and testEnded() are called from different threads.
- Specified by:
testEndedin interfaceTestStateListener- See Also:
StandardJMeterEngine.stopTest()
-
testEnded
public void testEnded(String host)
Description copied from interface:TestStateListenerCalled once for all threads after the end of a test. This will use the same element instances as at the start of the test.
N.B. testStarted() and testEnded() are called from different threads.
- Specified by:
testEndedin interfaceTestStateListener- Parameters:
host- name of host- See Also:
StandardJMeterEngine.stopTest()
-
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:
StandardJMeterEngine.run()
-
testStarted
public void testStarted(String host)
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- Parameters:
host- name of host- See Also:
StandardJMeterEngine.run()
-
clone
public Object clone()
- Specified by:
clonein interfaceConfigElement- Specified by:
clonein interfaceTestElement- Overrides:
clonein classAbstractTestElement
-
getConnection
public static Connection getConnection(String poolName) throws SQLException
- Throws:
SQLException
-
addConfigElement
public void addConfigElement(ConfigElement config)
Description copied from interface:ConfigElementAdd a configuration element to this one. This allows config elements to combine and give a "layered" effect. For example, HTTPConfigElements have properties for domain, path, method, and parameters. If element A has everything filled in, but null for domain, and element B is added, which has only domain filled in, then after adding B to A, A will have the domain from B. If A already had a domain, then the correct behavior is for A to ignore the addition of element B.- Specified by:
addConfigElementin interfaceConfigElement- Parameters:
config- the element to be added to this ConfigElement
-
expectsModification
public boolean expectsModification()
Description copied from interface:ConfigElementIf your config element expects to be modified in the process of a test run, and you want those modifications to carry over from sample to sample (as in a cookie manager - you want to save all cookies that get set throughout the test), then return true for this method. Your config element will not be cloned for each sample. If your config elements are more static in nature, return false. If in doubt, return false.- Specified by:
expectsModificationin interfaceConfigElement- Returns:
- true if the element expects to be modified over the course of a test run
-
getCheckQuery
public String getCheckQuery()
- Returns:
- Returns the checkQuery.
-
setCheckQuery
public void setCheckQuery(String checkQuery)
- Parameters:
checkQuery- The checkQuery to set.
-
getConnectionAge
public String getConnectionAge()
- Returns:
- Returns the connectionAge.
-
setConnectionAge
public void setConnectionAge(String connectionAge)
- Parameters:
connectionAge- The connectionAge to set.
-
getDataSource
public String getDataSource()
- Returns:
- Returns the poolname.
-
setDataSource
public void setDataSource(String dataSource)
- Parameters:
dataSource- The poolname to set.
-
getDbUrl
public String getDbUrl()
- Returns:
- Returns the dbUrl.
-
setDbUrl
public void setDbUrl(String dbUrl)
- Parameters:
dbUrl- The dbUrl to set.
-
getDriver
public String getDriver()
- Returns:
- Returns the driver.
-
setDriver
public void setDriver(String driver)
- Parameters:
driver- The driver to set.
-
getPassword
public String getPassword()
- Returns:
- Returns the password.
-
setPassword
public void setPassword(String password)
- Parameters:
password- The password to set.
-
getPoolMax
public String getPoolMax()
- Returns:
- Returns the poolMax.
-
setPoolMax
public void setPoolMax(String poolMax)
- Parameters:
poolMax- The poolMax to set.
-
getTimeout
public String getTimeout()
- Returns:
- Returns the timeout.
-
setTimeout
public void setTimeout(String timeout)
- Parameters:
timeout- The timeout to set.
-
getTrimInterval
public String getTrimInterval()
- Returns:
- Returns the trimInterval.
-
setTrimInterval
public void setTrimInterval(String trimInterval)
- Parameters:
trimInterval- The trimInterval to set.
-
getUsername
public String getUsername()
- Returns:
- Returns the username.
-
setUsername
public void setUsername(String username)
- Parameters:
username- The username to set.
-
isAutocommit
public boolean isAutocommit()
- Returns:
- Returns the autocommit.
-
setAutocommit
public void setAutocommit(boolean autocommit)
- Parameters:
autocommit- The autocommit to set.
-
isKeepAlive
public boolean isKeepAlive()
- Returns:
- Returns the keepAlive.
-
setKeepAlive
public void setKeepAlive(boolean keepAlive)
- Parameters:
keepAlive- The keepAlive to set.
-
getTransactionIsolation
public String getTransactionIsolation()
- Returns:
- the transaction isolation level
-
setTransactionIsolation
public void setTransactionIsolation(String transactionIsolation)
- Parameters:
transactionIsolation- The transaction isolation level to set.NULLto use the default of the driver.
-
-