Search in sources :

Example 16 with TaskanaEngineConfiguration

use of pro.taskana.configuration.TaskanaEngineConfiguration 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 17 with TaskanaEngineConfiguration

use of pro.taskana.configuration.TaskanaEngineConfiguration 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)

Example 18 with TaskanaEngineConfiguration

use of pro.taskana.configuration.TaskanaEngineConfiguration in project taskana by Taskana.

the class ProvideClassificationReportAccTest 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 19 with TaskanaEngineConfiguration

use of pro.taskana.configuration.TaskanaEngineConfiguration in project taskana by Taskana.

the class ProvideDetailedClassificationReportAccTest 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 20 with TaskanaEngineConfiguration

use of pro.taskana.configuration.TaskanaEngineConfiguration in project taskana by Taskana.

the class ProvideWorkbasketLevelReportAccTest 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)

Aggregations

TaskanaEngineConfiguration (pro.taskana.configuration.TaskanaEngineConfiguration)20 DBCleaner (pro.taskana.impl.configuration.DBCleaner)16 DataSource (javax.sql.DataSource)11 TestDataGenerator (pro.taskana.database.TestDataGenerator)8 Before (org.junit.Before)6 TaskanaEngineImpl (pro.taskana.impl.TaskanaEngineImpl)6 Test (org.junit.Test)5 TaskanaEngineConfigurationTest (pro.taskana.impl.configuration.TaskanaEngineConfigurationTest)4 TaskanaEngine (pro.taskana.TaskanaEngine)3 WithAccessId (pro.taskana.security.WithAccessId)3 Classification (pro.taskana.Classification)2 Task (pro.taskana.Task)2 Workbasket (pro.taskana.Workbasket)2 NotAuthorizedException (pro.taskana.exceptions.NotAuthorizedException)2 ClassificationImpl (pro.taskana.impl.ClassificationImpl)2 TaskImpl (pro.taskana.impl.TaskImpl)2 TaskServiceImpl (pro.taskana.impl.TaskServiceImpl)2 WorkbasketImpl (pro.taskana.impl.WorkbasketImpl)2 IOException (java.io.IOException)1 InputStream (java.io.InputStream)1