Java Code Examples for org.dbunit.PropertiesBasedJdbcDatabaseTester

The following examples show how to use org.dbunit.PropertiesBasedJdbcDatabaseTester. These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
public AbstractDaoTestCase(String testName) {
    super(testName);
    ApplicationContext springApplicationContext =
            new FileSystemXmlApplicationContext(SPRING_FILE_PATH);
    springBeanFactory = springApplicationContext;
    DriverManagerDataSource dmds =
            (DriverManagerDataSource)springBeanFactory.getBean("dataSource");
    System.setProperty(
            PropertiesBasedJdbcDatabaseTester.DBUNIT_DRIVER_CLASS,
            JDBC_DRIVER);
    System.setProperty(
            PropertiesBasedJdbcDatabaseTester.DBUNIT_CONNECTION_URL,
            dmds.getUrl());
    System.setProperty(PropertiesBasedJdbcDatabaseTester.DBUNIT_USERNAME,
            dmds.getUsername());
    System.setProperty(PropertiesBasedJdbcDatabaseTester.DBUNIT_PASSWORD,
            dmds.getPassword());
}
 
Example 2
public AbstractDaoTestCase(String testName) {
    super(testName);
    ApplicationContext springApplicationContext =
            new FileSystemXmlApplicationContext(SPRING_FILE_PATH);
    springBeanFactory = springApplicationContext;
    DriverManagerDataSource dmds =
            (DriverManagerDataSource)springBeanFactory.getBean("dataSource");
    System.setProperty(
            PropertiesBasedJdbcDatabaseTester.DBUNIT_DRIVER_CLASS,
            JDBC_DRIVER);
    System.setProperty(
            PropertiesBasedJdbcDatabaseTester.DBUNIT_CONNECTION_URL,
            dmds.getUrl());
    System.setProperty(PropertiesBasedJdbcDatabaseTester.DBUNIT_USERNAME,
            dmds.getUsername());
    System.setProperty(PropertiesBasedJdbcDatabaseTester.DBUNIT_PASSWORD,
            dmds.getPassword());
}
 
Example 3
Source Project: LicenseScout   Source File: DatabaseWriterTest.java    License: Apache License 2.0 5 votes vote down vote up
public DatabaseWriterTest(String name) {
    super(name);
    System.setProperty(PropertiesBasedJdbcDatabaseTester.DBUNIT_DRIVER_CLASS, DRIVER_CLASS);
    System.setProperty(PropertiesBasedJdbcDatabaseTester.DBUNIT_CONNECTION_URL, JDBC_URL);
    System.setProperty(PropertiesBasedJdbcDatabaseTester.DBUNIT_USERNAME, USERNAME);
    System.setProperty(PropertiesBasedJdbcDatabaseTester.DBUNIT_PASSWORD, PASSWORD);
}
 
Example 4
private void setUpDatabase() {
    System.setProperty(
            PropertiesBasedJdbcDatabaseTester.DBUNIT_DRIVER_CLASS,
            JDBC_DRIVER);
    System.setProperty(
            PropertiesBasedJdbcDatabaseTester.DBUNIT_CONNECTION_URL,
            DATABASE);
    System.setProperty(PropertiesBasedJdbcDatabaseTester.DBUNIT_USERNAME,
            USER);
    System.setProperty(PropertiesBasedJdbcDatabaseTester.DBUNIT_PASSWORD,
            PASSWORD);
}
 
Example 5
Source Project: Zebra   Source File: SingleDBBaseTestCase.java    License: Apache License 2.0 4 votes vote down vote up
public SingleDBBaseTestCase() {
	System.setProperty(PropertiesBasedJdbcDatabaseTester.DBUNIT_DRIVER_CLASS, getDriverName());
	System.setProperty(PropertiesBasedJdbcDatabaseTester.DBUNIT_CONNECTION_URL, getDBUrl());
}