public class DataSourceElement extends AbstractTestElement implements ConfigElement, TestStateListener, TestBean
COMMENTS, ENABLED, GUI_CLASS, NAME, TEST_CLASS| Constructor and Description |
|---|
DataSourceElement() |
| Modifier and Type | Method and Description |
|---|---|
void |
addConfigElement(ConfigElement config)
Add a configuration element to this one.
|
java.lang.Object |
clone() |
boolean |
expectsModification()
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.
|
java.lang.String |
getCheckQuery() |
static java.sql.Connection |
getConnection(java.lang.String poolName)
Utility routine to get the connection from the pool.
|
java.lang.String |
getConnectionAge() |
static java.lang.String |
getConnectionInfo(java.lang.String poolName)
Gets a textual description about the pools configuration.
|
java.lang.String |
getDataSource() |
java.lang.String |
getDbUrl() |
java.lang.String |
getDriver() |
java.lang.String |
getPassword() |
java.lang.String |
getPoolMax() |
java.lang.String |
getTimeout() |
java.lang.String |
getTransactionIsolation() |
java.lang.String |
getTrimInterval() |
java.lang.String |
getUsername() |
boolean |
isAutocommit() |
boolean |
isKeepAlive() |
void |
setAutocommit(boolean autocommit) |
void |
setCheckQuery(java.lang.String checkQuery) |
void |
setConnectionAge(java.lang.String connectionAge) |
void |
setDataSource(java.lang.String dataSource) |
void |
setDbUrl(java.lang.String dbUrl) |
void |
setDriver(java.lang.String driver) |
void |
setKeepAlive(boolean keepAlive) |
void |
setPassword(java.lang.String password) |
void |
setPoolMax(java.lang.String poolMax) |
void |
setTimeout(java.lang.String timeout) |
void |
setTransactionIsolation(java.lang.String transactionIsolation) |
void |
setTrimInterval(java.lang.String trimInterval) |
void |
setUsername(java.lang.String username) |
void |
testEnded()
Called once for all threads after the end of a test.
|
void |
testEnded(java.lang.String host)
Called once for all threads after the end of a test.
|
void |
testStarted()
Called just before the start of the test from the main engine thread.
|
void |
testStarted(java.lang.String host)
Called just before the start of the test from the main engine thread.
|
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, traversePropertyfinalize, getClass, notify, notifyAll, toString, wait, wait, waitremovedpublic void testEnded()
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.
testEnded in interface TestStateListenerStandardJMeterEngine.stopTest()public void testEnded(java.lang.String host)
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.
testEnded in interface TestStateListenerhost - name of hostStandardJMeterEngine.stopTest()public void testStarted()
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.
testStarted in interface TestStateListenerStandardJMeterEngine.run()public void testStarted(java.lang.String host)
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.
testStarted in interface TestStateListenerhost - name of hostStandardJMeterEngine.run()public java.lang.Object clone()
clone in interface ConfigElementclone in interface TestElementclone in class AbstractTestElementpublic static java.lang.String getConnectionInfo(java.lang.String poolName)
throws java.sql.SQLException
poolName - Pool namepoolName or a short message,
when the JMeter object specified by poolName is not a
pooljava.sql.SQLException - when an error occurs, while gathering information about the
connectionpublic static java.sql.Connection getConnection(java.lang.String poolName)
throws java.sql.SQLException
poolName - name of the pool to get a connection fromjava.sql.SQLException - when an error occurs while getting the connection from the
poolpublic void addConfigElement(ConfigElement config)
ConfigElementaddConfigElement in interface ConfigElementconfig - the element to be added to this ConfigElementpublic boolean expectsModification()
ConfigElementexpectsModification in interface ConfigElementpublic java.lang.String getCheckQuery()
public void setCheckQuery(java.lang.String checkQuery)
checkQuery - The checkQuery to set.public java.lang.String getConnectionAge()
public void setConnectionAge(java.lang.String connectionAge)
connectionAge - The connectionAge to set.public java.lang.String getDataSource()
public void setDataSource(java.lang.String dataSource)
dataSource - The poolname to set.public java.lang.String getDbUrl()
public void setDbUrl(java.lang.String dbUrl)
dbUrl - The dbUrl to set.public java.lang.String getDriver()
public void setDriver(java.lang.String driver)
driver - The driver to set.public java.lang.String getPassword()
public void setPassword(java.lang.String password)
password - The password to set.public java.lang.String getPoolMax()
public void setPoolMax(java.lang.String poolMax)
poolMax - The poolMax to set.public java.lang.String getTimeout()
public void setTimeout(java.lang.String timeout)
timeout - The timeout to set.public java.lang.String getTrimInterval()
public void setTrimInterval(java.lang.String trimInterval)
trimInterval - The trimInterval to set.public java.lang.String getUsername()
public void setUsername(java.lang.String username)
username - The username to set.public boolean isAutocommit()
public void setAutocommit(boolean autocommit)
autocommit - The autocommit to set.public boolean isKeepAlive()
public void setKeepAlive(boolean keepAlive)
keepAlive - The keepAlive to set.public java.lang.String getTransactionIsolation()
public void setTransactionIsolation(java.lang.String transactionIsolation)
transactionIsolation - The transaction isolation level to set. NULL to
use the default of the driver.Copyright © 1998-2018 Apache Software Foundation. All Rights Reserved.