use of musicxmltestsuite.tests.base.Base in project Zong by Xenoage.
the class LayoutTest method getScoreFrameLayoutOrException.
default ScoreFrameLayout getScoreFrameLayoutOrException() throws Exception {
Base base = (Base) this;
String filepath = Base.dirPath + base.getFileName();
ScoreDoc doc = new MusicXmlScoreDocFileInput().read(jsePlatformUtils().openFile(filepath), filepath);
ScoreLayout layout = new ScoreLayouter(doc, targetA4()).createScoreLayout();
return layout.getScoreFrameLayout(0);
}
use of musicxmltestsuite.tests.base.Base in project Zong by Xenoage.
the class VisualHtmlReport method collectTests.
/**
* Gets all {@link Base} tests, except those who contain invalid scores (see {@link ErroneousScore}),
* sorted by name.
*/
private void collectTests() throws Exception {
List<Base> tests = alist();
Reflections reflections = new Reflections("musicxmltestsuite.tests.base");
for (Class<? extends Base> testClass : reflections.getSubTypesOf(Base.class)) {
// ignore erroneous scores
if (false == testClass.isAnnotationPresent(ErroneousScore.class)) {
// easyMock library fails; it does not recognize the default methods; so we
// use our own solution to instantiate the interface
tests.add((Base) new InterfaceInstance(testClass).defineClass().newInstance());
}
}
tests.sort(comparing(Base::getFileName));
this.tests = tests;
}
use of musicxmltestsuite.tests.base.Base in project Zong by Xenoage.
the class VisualHtmlReport method start.
private void start() throws Throwable {
collectTests();
prepareDirectories();
for (Base test : tests) {
System.out.println("Processing " + test.getFileName() + " ...");
File scoreFile = io().findNormalFile(Base.dirPath + test.getFileName());
try {
renderScore(scoreFile);
copyLilypondImage(scoreFile);
} catch (Exception ex) {
throw new Exception("Error with " + scoreFile.getName(), ex);
}
}
writeToHtmlFile();
}
use of musicxmltestsuite.tests.base.Base in project Zong by Xenoage.
the class MusicXmlInTest method getScoreOrException.
default Score getScoreOrException() throws Exception {
Base base = (Base) this;
String filepath = Base.dirPath + base.getFileName();
return new MusicXmlScoreFileInput().read(jsePlatformUtils().openFile(filepath), filepath);
}
Aggregations