Search in sources :

Example 6 with TaskServiceImpl

use of pro.taskana.impl.TaskServiceImpl in project taskana by Taskana.

the class TaskServiceImplIntAutocommitTest method testStartTransactionFail.

@Test(expected = TaskNotFoundException.class)
public void testStartTransactionFail() throws FileNotFoundException, SQLException, TaskNotFoundException, NotAuthorizedException, WorkbasketNotFoundException, ClassificationNotFoundException, ClassificationAlreadyExistException, TaskAlreadyExistException, InvalidWorkbasketException, InvalidArgumentException, WorkbasketAlreadyExistException, DomainNotFoundException {
    Workbasket wb = workbasketService.newWorkbasket("wb1k1", "DOMAIN_A");
    wb.setName("sdf");
    wb.setType(WorkbasketType.GROUP);
    taskanaEngine.getWorkbasketService().createWorkbasket(wb);
    Classification classification = classificationService.newClassification("TEST", "DOMAIN_A", "TASK");
    classification = taskanaEngine.getClassificationService().createClassification(classification);
    classification = taskanaEngine.getClassificationService().getClassification(classification.getKey(), classification.getDomain());
    TaskImpl task = (TaskImpl) taskServiceImpl.newTask(wb.getKey(), "DOMAIN_A");
    task.setName("Unit Test Task");
    task.setClassificationKey(classification.getKey());
    task.setPrimaryObjRef(JunitHelper.createDefaultObjRef());
    taskServiceImpl.createTask(task);
    taskServiceImpl.getTask(task.getId());
    TaskanaEngineImpl te2 = (TaskanaEngineImpl) taskanaEngineConfiguration.buildTaskanaEngine();
    TaskServiceImpl taskServiceImpl2 = (TaskServiceImpl) te2.getTaskService();
    taskServiceImpl2.getTask(wb.getId());
}
Also used : TaskImpl(pro.taskana.impl.TaskImpl) Classification(pro.taskana.Classification) TaskanaEngineImpl(pro.taskana.impl.TaskanaEngineImpl) TaskServiceImpl(pro.taskana.impl.TaskServiceImpl) Workbasket(pro.taskana.Workbasket) TaskanaEngineConfigurationTest(pro.taskana.impl.configuration.TaskanaEngineConfigurationTest) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)6 TaskServiceImpl (pro.taskana.impl.TaskServiceImpl)6 TaskanaEngineConfigurationTest (pro.taskana.impl.configuration.TaskanaEngineConfigurationTest)6 Classification (pro.taskana.Classification)5 Task (pro.taskana.Task)5 TaskanaEngine (pro.taskana.TaskanaEngine)4 Workbasket (pro.taskana.Workbasket)4 Connection (java.sql.Connection)3 TaskanaEngineImpl (pro.taskana.impl.TaskanaEngineImpl)3 WithAccessId (pro.taskana.security.WithAccessId)3 TaskanaEngineConfiguration (pro.taskana.configuration.TaskanaEngineConfiguration)2 DBCleaner (pro.taskana.impl.configuration.DBCleaner)2 DataSource (javax.sql.DataSource)1 WorkbasketAccessItem (pro.taskana.WorkbasketAccessItem)1 ClassificationServiceImpl (pro.taskana.impl.ClassificationServiceImpl)1 TaskImpl (pro.taskana.impl.TaskImpl)1 WorkbasketImpl (pro.taskana.impl.WorkbasketImpl)1 WorkbasketServiceImpl (pro.taskana.impl.WorkbasketServiceImpl)1