-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
João Gomes
committed
Mar 9, 2022
1 parent
fa1fd6a
commit ef7d55f
Showing
6 changed files
with
135 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,4 +29,3 @@ jobs: | |
run: mvn --batch-mode deploy -Djacoco.skip=true | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
51 changes: 51 additions & 0 deletions
51
src/test/java/org/roda_project/commons_ip2/model/impl/eark/ParseEARK2STest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
package org.roda_project.commons_ip2.model.impl.eark; | ||
|
||
import org.junit.AfterClass; | ||
import org.junit.Assert; | ||
import org.junit.BeforeClass; | ||
import org.junit.Test; | ||
import org.roda_project.commons_ip.model.ParseException; | ||
import org.roda_project.commons_ip.utils.IPException; | ||
import org.roda_project.commons_ip2.model.IPFileInterface; | ||
import org.roda_project.commons_ip2.model.SIP; | ||
import org.roda_project.commons_ip2.utils.Utils; | ||
import org.slf4j.Logger; | ||
import org.slf4j.LoggerFactory; | ||
|
||
import java.io.IOException; | ||
import java.nio.file.Files; | ||
import java.nio.file.Path; | ||
import java.nio.file.Paths; | ||
import java.util.List; | ||
|
||
/** | ||
* {@author João Gomes <[email protected]>}. | ||
*/ | ||
public class ParseEARK2STest { | ||
private static final String REPRESENTATION_STATUS_NORMALIZED = "NORMALIZED"; | ||
private static final Logger LOGGER = LoggerFactory.getLogger(ParseEARK2STest.class); | ||
|
||
private static Path tempFolder; | ||
|
||
@BeforeClass | ||
public static void setup() throws IOException { | ||
tempFolder = Files.createTempDirectory("temp"); | ||
} | ||
|
||
@AfterClass | ||
public static void cleanup() throws Exception { | ||
Utils.deletePath(tempFolder); | ||
} | ||
|
||
@Test | ||
public void buildEARKSip2withFolders() throws IPException, InterruptedException, ParseException { | ||
LOGGER.info("Creating EARK SIP 2"); | ||
Path zipSIPS = Paths.get("src/test/resources/SIP-S/shallowFileFolderAndEmptyFolder.zip"); | ||
// 1) invoke static method parse and that's it | ||
SIP earkSIP = EARKSIP.parse(zipSIPS, tempFolder); | ||
|
||
List<IPFileInterface> files = earkSIP.getRepresentations().get(0).getData(); | ||
Assert.assertEquals(4, files.size()); | ||
LOGGER.info("Done creating full E-ARK SIP-S"); | ||
} | ||
} |
Binary file not shown.
Binary file not shown.