Search in sources :

Example 1 with InconsistentScoreException

use of com.xenoage.zong.core.util.InconsistentScoreException in project Zong by Xenoage.

the class MusicXmlScoreFileInputTest method testSampleFiles.

/**
 * It's too hard to check the contents of a MusicXML file
 * automatically. We just try to load the score data and
 * check if they could be loaded without problems.
 *
 * We check all official MusicXML 1.1 and 2.0 sample files.
 */
@Test
@SuppressWarnings("unused")
public void testSampleFiles() {
    long startTime = System.currentTimeMillis();
    for (String file : getSampleFiles()) {
        try {
            Score score = new MusicXmlScoreFileInput().read(jsePlatformUtils().openFile(file), file);
            System.out.println("Loaded: " + file);
        } catch (InconsistentScoreException ex) {
            ex.printStackTrace();
            fail("Score inconsistent after loading: " + file);
        } catch (Exception ex) {
            ex.printStackTrace();
            fail("Failed to load file: " + file);
        }
    }
    long totalTime = System.currentTimeMillis() - startTime;
// TEST
// System.out.println(getClass() + ": " + totalTime);
}
Also used : Score(com.xenoage.zong.core.Score) InconsistentScoreException(com.xenoage.zong.core.util.InconsistentScoreException) InconsistentScoreException(com.xenoage.zong.core.util.InconsistentScoreException) FileNotFoundException(java.io.FileNotFoundException) Test(org.junit.Test)

Aggregations

Score (com.xenoage.zong.core.Score)1 InconsistentScoreException (com.xenoage.zong.core.util.InconsistentScoreException)1 FileNotFoundException (java.io.FileNotFoundException)1 Test (org.junit.Test)1