Search in sources :

Example 1 with ErroneousScore

use of musicxmltestsuite.tests.utils.ErroneousScore 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;
}
Also used : InterfaceInstance(com.xenoage.utils.jse.reflection.InterfaceInstance) ErroneousScore(musicxmltestsuite.tests.utils.ErroneousScore) Base(musicxmltestsuite.tests.base.Base) Reflections(org.reflections.Reflections)

Aggregations

InterfaceInstance (com.xenoage.utils.jse.reflection.InterfaceInstance)1 Base (musicxmltestsuite.tests.base.Base)1 ErroneousScore (musicxmltestsuite.tests.utils.ErroneousScore)1 Reflections (org.reflections.Reflections)1