Search in sources :

Example 1 with DBCleaner

use of pro.taskana.impl.configuration.DBCleaner 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 DBCleaner

use of pro.taskana.impl.configuration.DBCleaner 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 DBCleaner

use of pro.taskana.impl.configuration.DBCleaner in project taskana by Taskana.

the class ClassificationServiceImplIntAutoCommitTest method setup.

@Before
public void setup() throws FileNotFoundException, SQLException, LoginException {
    dataSource = TaskanaEngineConfigurationTest.getDataSource();
    taskanaEngineConfiguration = new TaskanaEngineConfiguration(dataSource, false, false);
    taskanaEngine = taskanaEngineConfiguration.buildTaskanaEngine();
    classificationService = taskanaEngine.getClassificationService();
    taskanaEngineImpl = (TaskanaEngineImpl) taskanaEngine;
    taskanaEngineImpl.setConnectionManagementMode(ConnectionManagementMode.AUTOCOMMIT);
    DBCleaner cleaner = new DBCleaner();
    cleaner.clearDb(dataSource, false);
}
Also used : TaskanaEngineConfiguration(pro.taskana.configuration.TaskanaEngineConfiguration) DBCleaner(pro.taskana.impl.configuration.DBCleaner) Before(org.junit.Before)

Example 4 with DBCleaner

use of pro.taskana.impl.configuration.DBCleaner in project taskana by Taskana.

the class TaskServiceImplIntAutocommitTest method resetDb.

@BeforeClass
public static void resetDb() throws SQLException {
    DataSource ds = TaskanaEngineConfigurationTest.getDataSource();
    DBCleaner cleaner = new DBCleaner();
    cleaner.clearDb(ds, true);
}
Also used : DBCleaner(pro.taskana.impl.configuration.DBCleaner) DataSource(javax.sql.DataSource) BeforeClass(org.junit.BeforeClass)

Example 5 with DBCleaner

use of pro.taskana.impl.configuration.DBCleaner in project taskana by Taskana.

the class TaskServiceImplIntAutocommitTest method setup.

@Before
public void setup() throws FileNotFoundException, SQLException, LoginException {
    dataSource = TaskanaEngineConfigurationTest.getDataSource();
    taskanaEngineConfiguration = new TaskanaEngineConfiguration(dataSource, false, false);
    taskanaEngine = taskanaEngineConfiguration.buildTaskanaEngine();
    taskanaEngineImpl = (TaskanaEngineImpl) taskanaEngine;
    taskanaEngineImpl.setConnectionManagementMode(ConnectionManagementMode.AUTOCOMMIT);
    taskServiceImpl = (TaskServiceImpl) taskanaEngine.getTaskService();
    classificationService = taskanaEngine.getClassificationService();
    workbasketService = taskanaEngine.getWorkbasketService();
    DBCleaner cleaner = new DBCleaner();
    cleaner.clearDb(dataSource, false);
}
Also used : TaskanaEngineConfiguration(pro.taskana.configuration.TaskanaEngineConfiguration) DBCleaner(pro.taskana.impl.configuration.DBCleaner) Before(org.junit.Before)

Aggregations

DBCleaner (pro.taskana.impl.configuration.DBCleaner)22 TaskanaEngineConfiguration (pro.taskana.configuration.TaskanaEngineConfiguration)16 DataSource (javax.sql.DataSource)15 TestDataGenerator (pro.taskana.database.TestDataGenerator)8 Before (org.junit.Before)6 BeforeClass (org.junit.BeforeClass)6 TaskanaEngineImpl (pro.taskana.impl.TaskanaEngineImpl)6 Test (org.junit.Test)2 Classification (pro.taskana.Classification)2 Task (pro.taskana.Task)2 TaskanaEngine (pro.taskana.TaskanaEngine)2 Workbasket (pro.taskana.Workbasket)2 TaskServiceImpl (pro.taskana.impl.TaskServiceImpl)2 TaskanaEngineConfigurationTest (pro.taskana.impl.configuration.TaskanaEngineConfigurationTest)2 Connection (java.sql.Connection)1 ClassificationServiceImpl (pro.taskana.impl.ClassificationServiceImpl)1 WorkbasketServiceImpl (pro.taskana.impl.WorkbasketServiceImpl)1 WithAccessId (pro.taskana.security.WithAccessId)1