use of com.xenoage.utils.jse.reflection.InterfaceInstance 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;
}
Aggregations