-
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.
Merge pull request #96 from keeps/jgomes-dev
Added snapshot workflow to github actions, parse of sip-s empty folders
- Loading branch information
Showing
6 changed files
with
166 additions
and
4 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 |
---|---|---|
@@ -0,0 +1,31 @@ | ||
name: Snapshot | ||
on: | ||
push: | ||
branches: | ||
- "master" | ||
|
||
jobs: | ||
deploy: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
- name: Set up JDK 1.8 | ||
uses: actions/setup-java@v1 | ||
with: | ||
java-version: 1.8 | ||
- name: Chache | ||
uses: actions/[email protected] | ||
with: | ||
path: ~/.m2/repository | ||
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} | ||
restore-keys: ${{ runner.os }}-maven- | ||
- name: Build Jar | ||
run: mvn --batch-mode clean package -P cli | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Deploy Jar | ||
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.