Search in sources :

Example 1 with TestDataGenerator

use of pro.taskana.database.TestDataGenerator in project taskana by Taskana.

the class ProvideCategoryReportAccTest method resetDb.

public static void resetDb() throws SQLException, IOException {
    DataSource dataSource = TaskanaEngineConfigurationTest.getDataSource();
    DBCleaner cleaner = new DBCleaner();
    cleaner.clearDb(dataSource, true);
    dataSource = TaskanaEngineConfigurationTest.getDataSource();
    taskanaEngineConfiguration = new TaskanaEngineConfiguration(dataSource, false);
    taskanaEngineConfiguration.setGermanPublicHolidaysEnabled(false);
    taskanaEngine = taskanaEngineConfiguration.buildTaskanaEngine();
    ((TaskanaEngineImpl) taskanaEngine).setConnectionManagementMode(ConnectionManagementMode.AUTOCOMMIT);
    cleaner.clearDb(dataSource, false);
    TestDataGenerator testDataGenerator = new TestDataGenerator();
    testDataGenerator.generateMonitoringTestData(dataSource);
}
Also used : TaskanaEngineConfiguration(pro.taskana.configuration.TaskanaEngineConfiguration) TaskanaEngineImpl(pro.taskana.impl.TaskanaEngineImpl) DBCleaner(pro.taskana.impl.configuration.DBCleaner) DataSource(javax.sql.DataSource) TestDataGenerator(pro.taskana.database.TestDataGenerator)

Example 2 with TestDataGenerator

use of pro.taskana.database.TestDataGenerator in project taskana by Taskana.

the class ProvideCustomFieldValueReportAccTest method resetDb.

public static void resetDb() throws SQLException, IOException {
    DataSource dataSource = TaskanaEngineConfigurationTest.getDataSource();
    DBCleaner cleaner = new DBCleaner();
    cleaner.clearDb(dataSource, true);
    dataSource = TaskanaEngineConfigurationTest.getDataSource();
    taskanaEngineConfiguration = new TaskanaEngineConfiguration(dataSource, false);
    taskanaEngineConfiguration.setGermanPublicHolidaysEnabled(false);
    taskanaEngine = taskanaEngineConfiguration.buildTaskanaEngine();
    taskanaEngine.setConnectionManagementMode(ConnectionManagementMode.AUTOCOMMIT);
    cleaner.clearDb(dataSource, false);
    TestDataGenerator testDataGenerator = new TestDataGenerator();
    testDataGenerator.generateMonitoringTestData(dataSource);
}
Also used : TaskanaEngineConfiguration(pro.taskana.configuration.TaskanaEngineConfiguration) DBCleaner(pro.taskana.impl.configuration.DBCleaner) DataSource(javax.sql.DataSource) TestDataGenerator(pro.taskana.database.TestDataGenerator)

Example 3 with TestDataGenerator

use of pro.taskana.database.TestDataGenerator in project taskana by Taskana.

the class ProvideTaskStatusReportAccTest method resetDb.

public static void resetDb() throws SQLException, IOException {
    DataSource dataSource = TaskanaEngineConfigurationTest.getDataSource();
    DBCleaner cleaner = new DBCleaner();
    cleaner.clearDb(dataSource, true);
    dataSource = TaskanaEngineConfigurationTest.getDataSource();
    taskanaEngineConfiguration = new TaskanaEngineConfiguration(dataSource, false);
    taskanaEngineConfiguration.setGermanPublicHolidaysEnabled(false);
    taskanaEngine = taskanaEngineConfiguration.buildTaskanaEngine();
    taskanaEngine.setConnectionManagementMode(TaskanaEngine.ConnectionManagementMode.AUTOCOMMIT);
    cleaner.clearDb(dataSource, false);
    TestDataGenerator testDataGenerator = new TestDataGenerator();
    testDataGenerator.generateMonitoringTestData(dataSource);
}
Also used : TaskanaEngineConfiguration(pro.taskana.configuration.TaskanaEngineConfiguration) DBCleaner(pro.taskana.impl.configuration.DBCleaner) DataSource(javax.sql.DataSource) TestDataGenerator(pro.taskana.database.TestDataGenerator)

Example 4 with TestDataGenerator

use of pro.taskana.database.TestDataGenerator in project taskana by Taskana.

the class AbstractAccTest method resetDb.

public static void resetDb(boolean... dropTables) throws SQLException {
    DataSource dataSource = TaskanaEngineConfigurationTest.getDataSource();
    DBCleaner cleaner = new DBCleaner();
    if (dropTables == null || dropTables.length == 0) {
        cleaner.clearDb(dataSource, true);
    } else {
        cleaner.clearDb(dataSource, dropTables[0]);
    }
    dataSource = TaskanaEngineConfigurationTest.getDataSource();
    taskanaEngineConfiguration = new TaskanaEngineConfiguration(dataSource, false);
    taskanaEngine = taskanaEngineConfiguration.buildTaskanaEngine();
    ((TaskanaEngineImpl) taskanaEngine).setConnectionManagementMode(ConnectionManagementMode.AUTOCOMMIT);
    cleaner.clearDb(dataSource, false);
    TestDataGenerator testDataGenerator = new TestDataGenerator();
    testDataGenerator.generateTestData(dataSource);
}
Also used : TaskanaEngineConfiguration(pro.taskana.configuration.TaskanaEngineConfiguration) TaskanaEngineImpl(pro.taskana.impl.TaskanaEngineImpl) DBCleaner(pro.taskana.impl.configuration.DBCleaner) DataSource(javax.sql.DataSource) TestDataGenerator(pro.taskana.database.TestDataGenerator)

Example 5 with TestDataGenerator

use of pro.taskana.database.TestDataGenerator in project taskana by Taskana.

the class GetTaskIdsOfCategoryReportAccTest method resetDb.

public static void resetDb() throws SQLException, IOException {
    DataSource dataSource = TaskanaEngineConfigurationTest.getDataSource();
    DBCleaner cleaner = new DBCleaner();
    cleaner.clearDb(dataSource, true);
    dataSource = TaskanaEngineConfigurationTest.getDataSource();
    taskanaEngineConfiguration = new TaskanaEngineConfiguration(dataSource, false);
    taskanaEngineConfiguration.setGermanPublicHolidaysEnabled(false);
    taskanaEngine = taskanaEngineConfiguration.buildTaskanaEngine();
    ((TaskanaEngineImpl) taskanaEngine).setConnectionManagementMode(ConnectionManagementMode.AUTOCOMMIT);
    cleaner.clearDb(dataSource, false);
    TestDataGenerator testDataGenerator = new TestDataGenerator();
    testDataGenerator.generateMonitoringTestData(dataSource);
}
Also used : TaskanaEngineConfiguration(pro.taskana.configuration.TaskanaEngineConfiguration) TaskanaEngineImpl(pro.taskana.impl.TaskanaEngineImpl) DBCleaner(pro.taskana.impl.configuration.DBCleaner) DataSource(javax.sql.DataSource) TestDataGenerator(pro.taskana.database.TestDataGenerator)

Aggregations

DataSource (javax.sql.DataSource)8 TaskanaEngineConfiguration (pro.taskana.configuration.TaskanaEngineConfiguration)8 TestDataGenerator (pro.taskana.database.TestDataGenerator)8 DBCleaner (pro.taskana.impl.configuration.DBCleaner)8 TaskanaEngineImpl (pro.taskana.impl.TaskanaEngineImpl)5