Skip to content

Commit

Permalink
Dynamically copy resources for test process in WorkflowControllerServ…
Browse files Browse the repository at this point in the history
…iceIT
  • Loading branch information
solth committed Nov 30, 2023
1 parent dd1c4ee commit 2219be0
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,10 @@
import org.kitodo.data.database.exceptions.DAOException;
import org.kitodo.data.exceptions.DataException;
import org.kitodo.production.services.ServiceManager;
import org.kitodo.production.services.data.ProcessService;
import org.kitodo.production.services.data.TaskService;
import org.kitodo.production.services.file.FileService;
import org.kitodo.utils.ProcessTestUtils;

public class WorkflowControllerServiceIT {

Expand All @@ -58,11 +60,14 @@ public class WorkflowControllerServiceIT {
private static final FileService fileService = ServiceManager.getFileService();
private static final TaskService taskService = ServiceManager.getTaskService();
private static final WorkflowControllerService workflowService = new WorkflowControllerService();
private static int workflowTestProcessId = -1;

@Before
public void prepareDatabase() throws Exception {
MockDatabase.startNode();
MockDatabase.insertProcessesForWorkflowFull();
workflowTestProcessId = Math.toIntExact(ServiceManager.getProcessService().count());
ProcessTestUtils.copyTestFiles(workflowTestProcessId, "testmetaNewspaper.xml");
SecurityTestUtils.addUserDataToSecurityContext(ServiceManager.getUserService().getById(1), 1);

usersDirectory.mkdir();
Expand All @@ -77,6 +82,7 @@ public void prepareDatabase() throws Exception {

@After
public void cleanDatabase() throws Exception {
ProcessService.deleteProcess(workflowTestProcessId);
MockDatabase.stopNode();
MockDatabase.cleanDatabase();
SecurityTestUtils.cleanSecurityContext();
Expand Down Expand Up @@ -300,7 +306,7 @@ public void shouldCloseAndAssignNextForProcessWithParallelTasks() throws Excepti

@Test
public void shouldCloseForProcessWithScriptParallelTasks() throws Exception {
assumeTrue(!SystemUtils.IS_OS_WINDOWS && !SystemUtils.IS_OS_MAC);
assumeTrue(!SystemUtils.IS_OS_WINDOWS);
// if you want to execute test on windows change sh to bat in
// gateway-test5.bpmn20.xml

Expand Down
Empty file modified Kitodo/src/test/resources/scripts/not_working_script.sh
100755 → 100644
Empty file.
Empty file modified Kitodo/src/test/resources/scripts/script_createDirUserHome.sh
100755 → 100644
Empty file.

0 comments on commit 2219be0

Please sign in to comment.