public class JdbcDatabaseTester extends AbstractDatabaseTester
Constructor and Description |
---|
JdbcDatabaseTester(String driverClass,
String connectionUrl)
Creates a new JdbcDatabaseTester with the specified properties.
Username and Password are set to null. |
JdbcDatabaseTester(String driverClass,
String connectionUrl,
String username,
String password)
Creates a new JdbcDatabaseTester with the specified properties.
|
Modifier and Type | Method and Description |
---|---|
IDatabaseConnection |
getConnection()
Returns the test database connection.
|
protected void |
initialize()
Verifies the configured properties and initializes the driver.
This method is called by getConnection() if the tester has not been
initialized yet. |
protected void |
setConnectionUrl(String connectionUrl)
Sets the value of the connection url.
|
protected void |
setDriverClass(String driverClass)
Sets the value of the JDBC driver classname.
|
void |
setPassword(String password)
Sets the value of the user's password.
|
void |
setUsername(String username)
Sets the value of the username from the connection.
|
String |
toString() |
closeConnection, getDataSet, getSchema, getSetUpOperation, getTearDownOperation, onSetup, onTearDown, setDataSet, setSchema, setSetUpOperation, setTearDownOperation
assertNotNull, assertNotNull, assertNotNullNorEmpty, assertTrue, assertTrue, fail
public JdbcDatabaseTester(String driverClass, String connectionUrl)
driverClass
- the classname of the JDBC driver to useconnectionUrl
- the connection urlpublic JdbcDatabaseTester(String driverClass, String connectionUrl, String username, String password)
driverClass
- the classname of the JDBC driver to useconnectionUrl
- the connection urlusername
- a username that can has access to the databasepassword
- the user's passwordpublic IDatabaseConnection getConnection() throws Exception
IDatabaseTester
Exception
public void setPassword(String password)
public void setUsername(String username)
protected void initialize() throws Exception
getConnection()
if the tester has not been
initialized yet.Exception
protected void setConnectionUrl(String connectionUrl)
protected void setDriverClass(String driverClass)
public String toString()
toString
in class AbstractDatabaseTester
Copyright © 2002-2012. All Rights Reserved.