diff --git a/.gitignore b/.gitignore index ec3fd83..f096505 100644 --- a/.gitignore +++ b/.gitignore @@ -19,3 +19,4 @@ !test-input.*.zip !required.sh !meico.jar +!expected-output.mpm diff --git a/src/main/java/de/edirom/meigarage/meico/ConverterConfiguration.java b/src/main/java/de/edirom/meigarage/meico/ConverterConfiguration.java index 99b0268..a4cfba2 100644 --- a/src/main/java/de/edirom/meigarage/meico/ConverterConfiguration.java +++ b/src/main/java/de/edirom/meigarage/meico/ConverterConfiguration.java @@ -30,6 +30,7 @@ public class ConverterConfiguration { CONVERSIONS.add(getConversionActionArgument(Conversion.MEI30TOMPM)); CONVERSIONS.add(getConversionActionArgument(Conversion.MEI30TOMIDI)); CONVERSIONS.add(getConversionActionArgument(Conversion.MIDIMEICOTOMP3)); + CONVERSIONS.add(getConversionActionArgument(Conversion.MEI40TOMP3)); } private static ConversionActionArguments getConversionActionArgument(Conversion format) { diff --git a/src/test/java/de/edirom/meigarage/meico/MeicoConverterTest.java b/src/test/java/de/edirom/meigarage/meico/MeicoConverterTest.java index e9c112e..04c7583 100644 --- a/src/test/java/de/edirom/meigarage/meico/MeicoConverterTest.java +++ b/src/test/java/de/edirom/meigarage/meico/MeicoConverterTest.java @@ -29,14 +29,23 @@ public void convert() throws IOException, ConverterException { InputStream is = new FileInputStream("src/test/resources/test-input.mei.zip"); OutputStream os = new FileOutputStream("src/test/resources/test-output.mpm.zip"); DataType inputType = new DataType("mei40", "text/xml"); + //DataType inputType = new DataType("midi", "audio/x-midi"); DataType outputType = new DataType("mpm", "text/xml"); + //DataType outputType = new DataType("mp3", "audio/mp3"); 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.mp3.zip")); assertNotNull(new File("src/test/resources/test-output.mpm.zip")); InputStream isout = new FileInputStream("src/test/resources/test-output.mpm.zip"); EGEConfigurationManager.getInstance().getStandardIOResolver().decompressStream(isout, new File("src/test/resources/test-output.mpm")); - assertNotEquals("", new String(Files.readAllBytes(Paths.get("src/test/resources/test-output.mpm/test2-input.mpm")), "UTF-8")); + //assertNotEquals("", new String(Files.readAllBytes(Paths.get("src/test/resources/test-output.mpm/test2-input.mpm")), "UTF-8")); + //assertArrayEquals("Binary files differ", + // Files.readAllBytes(Paths.get("src/test/resources/expected-output.mp3")), + // Files.readAllBytes(Paths.get("src/test/resources/test-output.mp3/test2-input_MEI export performance.mp3"))); + assertEquals("The files differ!", + new String(Files.readAllBytes(Paths.get("src/test/resources/test-output.mpm/test2-input.mpm"))).replaceAll("uri=\"[\\s\\S]*?\"",""), + new String(Files.readAllBytes(Paths.get("src/test/resources/expected-output.mpm"))).replaceAll("uri=\"[\\s\\S]*?\"","")); is.close(); os.close(); isout.close(); diff --git a/src/test/resources/expected-output.mpm b/src/test/resources/expected-output.mpm new file mode 100644 index 0000000..cda8a2d --- /dev/null +++ b/src/test/resources/expected-output.mpm @@ -0,0 +1,26 @@ + + + + meico + This MPM has been generated from 'test2-input.mei' using the meico MEI converter. + + + + + + + +
+ + + +
+ + +