org.dbunit
Class PropertiesBasedJdbcDatabaseTester

java.lang.Object
  extended by org.dbunit.assertion.SimpleAssert
      extended by org.dbunit.AbstractDatabaseTester
          extended by org.dbunit.JdbcDatabaseTester
              extended by org.dbunit.PropertiesBasedJdbcDatabaseTester
All Implemented Interfaces:
IDatabaseTester

public class PropertiesBasedJdbcDatabaseTester
extends JdbcDatabaseTester

DatabaseTester that configures a DriverManager from environment properties.
This class defines a set of keys for system properties that need to be present in the environment before using it. Example:

System.setProperty( PropertiesBasedJdbcDatabaseTester.DBUNIT_DRIVER_CLASS, "com.mycompany.myDriver" ); System.setProperty( PropertiesBasedJdbcDatabaseTester.DBUNIT_CONNECTION_URL, "jdbc:mydb://host/dbname" ); System.setProperty( PropertiesBasedJdbcDatabaseTester.DBUNIT_USERNAME, "myuser" ); System.setProperty( PropertiesBasedJdbcDatabaseTester.DBUNIT_PASSWORD, "mypasswd" ); System.setProperty( PropertiesBasedJdbcDatabaseTester.DBUNIT_SCHEMA, "myschema" );

Since:
2.2.0
Version:
$Revision$ $Date$
Author:
Andres Almiray(aalmiray@users.sourceforge.net), Felipe Leme (dbunit@felipeal.net), Last changed by: $Author$

Field Summary
static String DBUNIT_CONNECTION_URL
          A key for property that defines the connection url
static String DBUNIT_DRIVER_CLASS
          A key for property that defines the driver classname
static String DBUNIT_PASSWORD
          A key for property that defines the user's password
static String DBUNIT_SCHEMA
          A key for property that defines the database schema
static String DBUNIT_USERNAME
          A key for property that defines the username
 
Constructor Summary
PropertiesBasedJdbcDatabaseTester()
          Creates a new JdbcDatabaseTester using specific System.getProperty(String) values as initialization parameters
 
Method Summary
 
Methods inherited from class org.dbunit.JdbcDatabaseTester
getConnection, toString
 
Methods inherited from class org.dbunit.AbstractDatabaseTester
closeConnection, getDataSet, getSchema, getSetUpOperation, getTearDownOperation, onSetup, onTearDown, setDataSet, setOperationListener, setSchema, setSetUpOperation, setTearDownOperation
 
Methods inherited from class org.dbunit.assertion.SimpleAssert
assertNotNull, assertNotNull, assertNotNullNorEmpty, assertTrue, assertTrue, fail
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

DBUNIT_CONNECTION_URL

public static final String DBUNIT_CONNECTION_URL
A key for property that defines the connection url

See Also:
Constant Field Values

DBUNIT_DRIVER_CLASS

public static final String DBUNIT_DRIVER_CLASS
A key for property that defines the driver classname

See Also:
Constant Field Values

DBUNIT_PASSWORD

public static final String DBUNIT_PASSWORD
A key for property that defines the user's password

See Also:
Constant Field Values

DBUNIT_USERNAME

public static final String DBUNIT_USERNAME
A key for property that defines the username

See Also:
Constant Field Values

DBUNIT_SCHEMA

public static final String DBUNIT_SCHEMA
A key for property that defines the database schema

See Also:
Constant Field Values
Constructor Detail

PropertiesBasedJdbcDatabaseTester

public PropertiesBasedJdbcDatabaseTester()
                                  throws Exception
Creates a new JdbcDatabaseTester using specific System.getProperty(String) values as initialization parameters

Throws:
Exception


Copyright © 2002–2014. All rights reserved.