Skip to content

Commit

Permalink
Remove support for test files before PR kitodo#5876
Browse files Browse the repository at this point in the history
  • Loading branch information
matthias-ronge committed Feb 2, 2024
1 parent cfdd2d9 commit ca0422d
Showing 1 changed file with 3 additions and 29 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
package org.kitodo.production.services.command;

// abbreviations
import static java.nio.charset.StandardCharsets.UTF_8;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.containsString;
import static org.junit.Assert.assertEquals;
Expand All @@ -28,13 +27,11 @@
import java.sql.Date;
import java.time.LocalDate;
import java.time.ZoneId;
import java.util.Objects;

// open source code
import org.apache.commons.lang3.SystemUtils;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import org.kitodo.ExecutionPermission;
Expand All @@ -55,10 +52,6 @@
public class ImportProcessesIT {
private static final Path ERRORS_DIR_PATH = Paths.get("src/test/resources/errors");

// keep and restore original meta.xml files
@Deprecated // will be able to be removed after merge with PR #5876
private String fourMeta, fiveMeta, sixMeta;

@BeforeClass
public static void prepareDatabase() throws Exception {
MockDatabase.startNode();
Expand Down Expand Up @@ -114,17 +107,6 @@ public static void createOutputDirectories() throws Exception {
Files.createDirectories(ERRORS_DIR_PATH);
}

@Deprecated // will be able to be removed after merge with PR #5876
@Before
public void keepMetaXmlFiles() throws Exception {
Path fourMetaPath = Paths.get("src/test/resources/metadata/4/meta.xml");
if (Files.exists(fourMetaPath)) {
fourMeta = Files.readString(fourMetaPath, UTF_8);
fiveMeta = Files.readString(Paths.get("src/test/resources/metadata/5/meta.xml"), UTF_8);
sixMeta = Files.readString(Paths.get("src/test/resources/metadata/6/meta.xml"), UTF_8);
}
}

@AfterClass
public static void deleteCreatedFiles() throws Exception {
TreeDeleter.deltree(Paths.get("src/test/resources/metadata/4/images"));
Expand All @@ -134,17 +116,9 @@ public static void deleteCreatedFiles() throws Exception {

@After
public void restoreMetaXmlFiles() throws Exception {
if (Objects.nonNull(fourMeta)) {
// case able to be removed after merge with PR #5876
Files.writeString(Paths.get("src/test/resources/metadata/4/meta.xml"), fourMeta, UTF_8);
Files.writeString(Paths.get("src/test/resources/metadata/5/meta.xml"), fiveMeta, UTF_8);
Files.writeString(Paths.get("src/test/resources/metadata/6/meta.xml"), sixMeta, UTF_8);
} else {
// true after merge with PR #5876
Files.deleteIfExists(Paths.get("src/test/resources/metadata/4/meta.xml"));
Files.deleteIfExists(Paths.get("src/test/resources/metadata/5/meta.xml"));
Files.deleteIfExists(Paths.get("src/test/resources/metadata/6/meta.xml"));
}
Files.deleteIfExists(Paths.get("src/test/resources/metadata/4/meta.xml"));
Files.deleteIfExists(Paths.get("src/test/resources/metadata/5/meta.xml"));
Files.deleteIfExists(Paths.get("src/test/resources/metadata/6/meta.xml"));
}

@AfterClass
Expand Down

0 comments on commit ca0422d

Please sign in to comment.