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.
|
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.
|
String |
getCheckQuery() |
static Connection |
getConnection(String poolName)
Utility routine to get the connection from the pool.
Purpose: allows JDBCSampler to be entirely independent of the pooling classes allows the pool storage mechanism to be changed if necessary |
String |
getConnectionAge() |
static String |
getConnectionInfo(String poolName)
Gets a textual description about the pools configuration.
|
String |
getConnectionProperties() |
String |
getDataSource() |
String |
getDbUrl() |
String |
getDriver() |
String |
getInitQuery() |
String |
getPassword() |
String |
getPoolMax() |
String |
getTimeout() |
String |
getTransactionIsolation() |
String |
getTrimInterval() |
String |
getUsername() |
boolean |
isAutocommit() |
boolean |
isKeepAlive() |
boolean |
isPreinit() |
void |
setAutocommit(boolean autocommit) |
void |
setCheckQuery(String checkQuery) |
void |
setConnectionAge(String connectionAge) |
void |
setConnectionProperties(String connectionProperties) |
void |
setDataSource(String dataSource) |
void |
setDbUrl(String dbUrl) |
void |
setDriver(String driver) |
void |
setInitQuery(String initQuery) |
void |
setKeepAlive(boolean keepAlive) |
void |
setPassword(String password) |
void |
setPoolMax(String poolMax) |
void |
setPreinit(boolean preinit) |
void |
setTimeout(String timeout) |
void |
setTransactionIsolation(String transactionIsolation) |
void |
setTrimInterval(String trimInterval) |
void |
setUsername(String username) |
void |
testEnded()
Called once for all threads after the end of a test.
|
void |
testEnded(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(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, traverseProperty
finalize, getClass, notify, notifyAll, toString, wait, wait, wait
removed
public void testEnded()
TestStateListener
Called 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 TestStateListener
StandardJMeterEngine.stopTest()
public void testEnded(String host)
TestStateListener
Called 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 TestStateListener
host
- name of hostStandardJMeterEngine.stopTest()
public void testStarted()
TestStateListener
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.
testStarted
in interface TestStateListener
StandardJMeterEngine.run()
public void testStarted(String host)
TestStateListener
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.
testStarted
in interface TestStateListener
host
- name of hostStandardJMeterEngine.run()
public Object clone()
clone
in interface ConfigElement
clone
in interface TestElement
clone
in class AbstractTestElement
public static String getConnectionInfo(String poolName) throws SQLException
poolName
- Pool namepoolName
or a short message,
when the JMeter object specified by poolName
is not a
poolSQLException
- when an error occurs, while gathering information about the
connectionpublic static Connection getConnection(String poolName) throws SQLException
poolName
- name of the pool to get a connection fromSQLException
- when an error occurs while getting the connection from the
poolpublic void addConfigElement(ConfigElement config)
ConfigElement
addConfigElement
in interface ConfigElement
config
- the element to be added to this ConfigElementpublic boolean expectsModification()
ConfigElement
expectsModification
in interface ConfigElement
public String getCheckQuery()
public void setCheckQuery(String checkQuery)
checkQuery
- The checkQuery to set.public String getConnectionAge()
public void setConnectionAge(String connectionAge)
connectionAge
- The connectionAge to set.public String getDataSource()
public void setDataSource(String dataSource)
dataSource
- The poolname to set.public String getDbUrl()
public void setDbUrl(String dbUrl)
dbUrl
- The dbUrl to set.public String getDriver()
public void setDriver(String driver)
driver
- The driver to set.public String getPassword()
public void setPassword(String password)
password
- The password to set.public String getPoolMax()
public void setPoolMax(String poolMax)
poolMax
- The poolMax to set.public String getTimeout()
public void setTimeout(String timeout)
timeout
- The timeout to set.public String getTrimInterval()
public void setTrimInterval(String trimInterval)
trimInterval
- The trimInterval to set.public String getUsername()
public void setUsername(String username)
username
- The username to set.public boolean isAutocommit()
public void setAutocommit(boolean autocommit)
autocommit
- The autocommit to set.public boolean isPreinit()
public void setPreinit(boolean preinit)
preinit
- The preinit to set.public boolean isKeepAlive()
public void setKeepAlive(boolean keepAlive)
keepAlive
- The keepAlive to set.public String getTransactionIsolation()
public void setTransactionIsolation(String transactionIsolation)
transactionIsolation
- The transaction isolation level to set. NULL
to
use the default of the driver.public String getInitQuery()
public void setInitQuery(String initQuery)
initQuery
- the initQuery to setpublic String getConnectionProperties()
public void setConnectionProperties(String connectionProperties)
connectionProperties
- the connectionProperties to setCopyright © 1998-2019 Apache Software Foundation. All Rights Reserved.