-
Notifications
You must be signed in to change notification settings - Fork 0
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 #3 from Edirom/feature/junit
Feature/junit
- Loading branch information
Showing
7 changed files
with
102 additions
and
14 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
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 |
---|---|---|
|
@@ -17,3 +17,5 @@ | |
!*.ent | ||
!*.xsd | ||
!*.yml | ||
!test-input.*.zip | ||
!required.sh |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/bin/bash | ||
# installs lilypond into /usr/local/lilypond and /usr/local/bin as shortcut | ||
curl -o /tmp/lilypond.sh https://lilypond.org/download/binaries/linux-64/lilypond-2.20.0-1.linux-64.sh | ||
chmod a+x /tmp/lilypond.sh && /tmp/lilypond.sh --batch |
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/de/edirom/meigarage/lilypond/LilyPondConverterTest.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 de.edirom.meigarage.lilypond; | ||
|
||
import pl.psnc.dl.ege.configuration.EGEConfigurationManager; | ||
import pl.psnc.dl.ege.exception.ConverterException; | ||
import pl.psnc.dl.ege.types.ConversionActionArguments; | ||
import pl.psnc.dl.ege.types.DataType; | ||
|
||
import java.io.*; | ||
import java.nio.file.Files; | ||
import java.nio.file.Paths; | ||
|
||
import static org.junit.Assert.*; | ||
|
||
public class LilyPondConverterTest { | ||
private LilyPondConverter converter; | ||
|
||
@org.junit.Before | ||
public void setUp() throws Exception { | ||
converter = new LilyPondConverter(); | ||
} | ||
|
||
@org.junit.After | ||
public void tearDown() throws Exception { | ||
converter = null; | ||
} | ||
|
||
@org.junit.Test | ||
public void convert() throws IOException, ConverterException { | ||
InputStream is = new FileInputStream("src/test/resources/test-input.ly.zip"); | ||
OutputStream os = new FileOutputStream("src/test/resources/test-output.png.zip"); | ||
DataType inputType = new DataType("lilypond","text/x-lilypond"); | ||
DataType outputType = new DataType("png","image/png"); | ||
ConversionActionArguments conversionActionArguments = new ConversionActionArguments(inputType, outputType, null); | ||
String tempDir = "src/test/temp"; | ||
converter.convert(is, os, conversionActionArguments, tempDir); | ||
assertNotNull(new File("src/test/resources/test-output.png.zip")); | ||
InputStream isout = new FileInputStream("src/test/resources/test-output.png.zip"); | ||
EGEConfigurationManager.getInstance().getStandardIOResolver().decompressStream(isout, new File("src/test/resources/test-output.png")); | ||
//System.out.println(new String(Files. readAllBytes(Paths.get("src/test/resources/test-output.txt/result.txt")), "UTF-8")); | ||
assertNotEquals("", new String(Files.readAllBytes(Paths.get("src/test/resources/test-output.png/test.png")), "UTF-8")); | ||
is.close(); | ||
os.close(); | ||
isout.close(); | ||
} | ||
|
||
@org.junit.Test | ||
public void getPossibleConversions() { | ||
assertNotNull(converter.getPossibleConversions()); | ||
System.out.println(converter.getPossibleConversions()); | ||
} | ||
} |
Binary file not shown.