Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix serial migration #4356

Merged
merged 13 commits into from
Apr 23, 2021
Merged

Conversation

Kathrin-Huber
Copy link
Contributor

fixes #4270
resolves #4268
fix #4267

@andre-hohmann
Copy link
Collaborator

The tests were successful:

  • The superordinate processes can be opened in the metadata editor and the correct id is inserted in the METS-file
  • The process title of the superordinate processes are generated correctly
  • The superordinate processes have no workflow

private void checkTaskAndId(Process parentProcess) throws IOException {
URI parentMetadataFilePath = fileService.getMetadataFilePath(parentProcess, true, true);
Workpiece workpiece = ServiceManager.getMetsService().loadWorkpiece(parentMetadataFilePath);
ImportService.checkTasks(parentProcess, workpiece.getRootElement().getType());
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the method checkTasks is required here as well (and not just during import), wouldn't it make sense to move that method from ImportService to WorkflowControllerService or ProcessService?

@Test
public void testHierarchyMigration() throws DAOException, ProcessGenerationException, CommandException,
DataException, IOException, SAXException, ParserConfigurationException {
HierarchyMigrationTask hierarchyMigrationTask = new HierarchyMigrationTask(Arrays.asList(project));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
HierarchyMigrationTask hierarchyMigrationTask = new HierarchyMigrationTask(Arrays.asList(project));
HierarchyMigrationTask hierarchyMigrationTask = new HierarchyMigrationTask(Collections.singletonList(project));


import java.io.File;
import java.io.IOException;
import java.util.Arrays;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
import java.util.Arrays;
import java.util.Collections;

}

private static void createTestMetaAnchorfile() throws Exception {
List<String> lines = Arrays.asList("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
List<String> lines = Arrays.asList("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n"
List<String> lines = Collections.singletonList("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n"

}

private static void createTestMetafile() throws Exception {
List<String> lines = Arrays.asList("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
List<String> lines = Arrays.asList("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n"
List<String> lines = Collections.singletonList("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n"

Copy link
Member

@solth solth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You forgot to remove one unused import

@Kathrin-Huber Kathrin-Huber merged commit 11a326c into kitodo:master Apr 23, 2021
@Kathrin-Huber Kathrin-Huber deleted the fix_serial_migration branch April 23, 2021 05:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants