From 47455416691ca6b77e2c69ea6b8f96343246c13c Mon Sep 17 00:00:00 2001 From: BartChris Date: Tue, 30 Apr 2024 12:18:40 +0200 Subject: [PATCH] revert change to newspaper generation test --- .../test/java/org/kitodo/MockDatabase.java | 3 +- .../NewspaperProcessesGeneratorIT.java | 2 +- .../java/org/kitodo/selenium/CalendarST.java | 4 +- .../testframework/pages/ProcessesPage.java | 12 ++---- .../src/test/resources/metadata/10/meta.xml | 35 ---------------- Kitodo/src/test/resources/metadata/9/meta.xml | 40 ------------------- .../resources/scripts/not_working_script.sh | 14 ------- .../scripts/script_createDirUserHome.sh | 21 ---------- 8 files changed, 7 insertions(+), 124 deletions(-) delete mode 100644 Kitodo/src/test/resources/metadata/10/meta.xml delete mode 100644 Kitodo/src/test/resources/metadata/9/meta.xml delete mode 100755 Kitodo/src/test/resources/scripts/not_working_script.sh delete mode 100755 Kitodo/src/test/resources/scripts/script_createDirUserHome.sh diff --git a/Kitodo/src/test/java/org/kitodo/MockDatabase.java b/Kitodo/src/test/java/org/kitodo/MockDatabase.java index a63a7430192..f3f956a78b5 100644 --- a/Kitodo/src/test/java/org/kitodo/MockDatabase.java +++ b/Kitodo/src/test/java/org/kitodo/MockDatabase.java @@ -725,7 +725,7 @@ public static void removeProcessesForHierarchyTests() throws DataException { } - public static int insertProcessForCalendarHierarchyTests() throws DAOException, DataException { + public static void insertProcessForCalendarHierarchyTests() throws DAOException, DataException { Ruleset fivthRuleset = new Ruleset(); fivthRuleset.setTitle("Newspaper"); fivthRuleset.setFile("newspaper.xml"); @@ -741,7 +741,6 @@ public static int insertProcessForCalendarHierarchyTests() throws DAOException, tenthProcess.setRuleset(ServiceManager.getRulesetService().getById(5)); tenthProcess.setTitle("NewspaperOverallProcess"); ServiceManager.getProcessService().save(tenthProcess); - return tenthProcess.getId(); } private static void insertTemplates() throws DAOException, DataException { diff --git a/Kitodo/src/test/java/org/kitodo/production/process/NewspaperProcessesGeneratorIT.java b/Kitodo/src/test/java/org/kitodo/production/process/NewspaperProcessesGeneratorIT.java index a75e4779549..0f128dba220 100644 --- a/Kitodo/src/test/java/org/kitodo/production/process/NewspaperProcessesGeneratorIT.java +++ b/Kitodo/src/test/java/org/kitodo/production/process/NewspaperProcessesGeneratorIT.java @@ -218,7 +218,7 @@ public void shouldNotGenerateDuplicateProcessTitle() throws DAOException, DataEx Course course = NewspaperCourse.getDuplicatedCourse(); course.splitInto(Granularity.DAYS); GeneratesNewspaperProcessesThread generatesNewspaperProcessesThread = new GeneratesNewspaperProcessesThread(completeEdition, course); - generatesNewspaperProcessesThread.start(); + generatesNewspaperProcessesThread.run(); ProcessDTO byId = ServiceManager.getProcessService().findById(11); Assert.assertNull("Process should not have been created", byId.getTitle()); diff --git a/Kitodo/src/test/java/org/kitodo/selenium/CalendarST.java b/Kitodo/src/test/java/org/kitodo/selenium/CalendarST.java index 4792055b03b..01a0ee20ed9 100644 --- a/Kitodo/src/test/java/org/kitodo/selenium/CalendarST.java +++ b/Kitodo/src/test/java/org/kitodo/selenium/CalendarST.java @@ -48,11 +48,11 @@ public void logout() throws Exception { @Test public void createProcessFromCalendar() throws Exception { // add process to access calendar - newspaperTestProcessId = MockDatabase.insertProcessForCalendarHierarchyTests(); + MockDatabase.insertProcessForCalendarHierarchyTests(); login(); processesPage.goTo(); - processesPage.goToCalendar(newspaperTestProcessId); + processesPage.goToCalendar(); calendarPage.addBlock(); calendarPage.addIssue("Morning issue"); calendarPage.addIssue("Evening issue"); diff --git a/Kitodo/src/test/java/org/kitodo/selenium/testframework/pages/ProcessesPage.java b/Kitodo/src/test/java/org/kitodo/selenium/testframework/pages/ProcessesPage.java index ce89b1f3144..107dae74c4e 100644 --- a/Kitodo/src/test/java/org/kitodo/selenium/testframework/pages/ProcessesPage.java +++ b/Kitodo/src/test/java/org/kitodo/selenium/testframework/pages/ProcessesPage.java @@ -51,7 +51,7 @@ public class ProcessesPage extends Page { private static final String WAIT_FOR_COLUMN_SORT = "Wait for column sorting"; private static final String MULTI_VOLUME_WORK_PROCESS_TITLE = "Multi volume work test process"; private static final String WAIT_FOR_SELECTION_MENU = "Wait for process selection menu to open"; - private static final String CALENDER_ACTION_XPATH = "//a[@href='/kitodo/pages/calendarEdit.jsf?id=%s']"; + private static final String CALENDER_ACTION_XPATH = "//a[@href='/kitodo/pages/calendarEdit.jsf?id=10']"; @SuppressWarnings("unused") @FindBy(id = PROCESSES_TAB_VIEW) @@ -494,14 +494,8 @@ public void clickProcessesTableHeaderForSorting(int column) { .until(() -> !columnHeader.getAttribute("aria-sort").equals(previousAriaSort)); } - /** - * Navigate to calendar page to create child processes for process with provided ID 'processId'. - * @param processId ID of process for which child processes are created using the calendar - * @throws Exception when navigating to the calendar page fails - */ - public void goToCalendar(int processId) throws Exception { - String xpath = String.format(CALENDER_ACTION_XPATH, processId); - WebElement openCalendarLink = Browser.getDriver().findElementByXPath(xpath); + public void goToCalendar() throws Exception { + WebElement openCalendarLink = Browser.getDriver().findElementByXPath(CALENDER_ACTION_XPATH); if (isNotAt()) { goTo(); } diff --git a/Kitodo/src/test/resources/metadata/10/meta.xml b/Kitodo/src/test/resources/metadata/10/meta.xml deleted file mode 100644 index aa3231aa5c3..00000000000 --- a/Kitodo/src/test/resources/metadata/10/meta.xml +++ /dev/null @@ -1,35 +0,0 @@ - - - - - - - - - - I-5300 II,III,IV - - - - - - - -
- - -
- - - diff --git a/Kitodo/src/test/resources/metadata/9/meta.xml b/Kitodo/src/test/resources/metadata/9/meta.xml deleted file mode 100644 index 055d31fc1fb..00000000000 --- a/Kitodo/src/test/resources/metadata/9/meta.xml +++ /dev/null @@ -1,40 +0,0 @@ - - - - - Kitodo - kitodo-ugh-3.0-SNAPSHOT - 18-April-2018 13:20:13 - Kitodo - - - - - - - Second process - Second - Proc - - - - - - - - - file:/2/images/Sec_Proc_tif - - - - - - - - - - - - - - diff --git a/Kitodo/src/test/resources/scripts/not_working_script.sh b/Kitodo/src/test/resources/scripts/not_working_script.sh deleted file mode 100755 index 44a8c4df506..00000000000 --- a/Kitodo/src/test/resources/scripts/not_working_script.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/usr/bin/env bash -# -# (c) Kitodo. Key to digital objects e. V. -# -# This file is part of the Kitodo project. -# -# It is licensed under GNU General Public License version 3 or later. -# -# For the full copyright and license information, please read the -# GPL3-License.txt file that was distributed with this source code. -# - - -Hello World diff --git a/Kitodo/src/test/resources/scripts/script_createDirUserHome.sh b/Kitodo/src/test/resources/scripts/script_createDirUserHome.sh deleted file mode 100755 index d5cf7b41dca..00000000000 --- a/Kitodo/src/test/resources/scripts/script_createDirUserHome.sh +++ /dev/null @@ -1,21 +0,0 @@ -#!/bin/sh -# -# (c) Kitodo. Key to digital objects e. V. -# -# This file is part of the Kitodo project. -# -# It is licensed under GNU General Public License version 3 or later. -# -# For the full copyright and license information, please read the -# GPL3-License.txt file that was distributed with this source code. -# - -# -# Note: Ensure that Tomcat has permission to execute the given commands. -# - -User="$1" -Home="$2" - -/bin/mkdir "$Home" -/bin/chmod g+w "$Home"