How to collect all classes implementing an interface at runtime?

纵饮孤独 提交于 2019-12-06 05:11:10

How can I collect all my test classes without having to ignore Errors that can occur with classes I'm not interested in?

You've kind of painted yourself into a corner here ...

What I'd do is one (or more) of the following:

  • fix the offending classes so that they do load

  • put the classes into different directories, create lists of names, or use pattern matching to discriminate between the classes that you do / don't want to add to testCollection

And log the Errors of course!! Maybe log them somewhere different, but if you do that leave a loud message in the main log that tells someone where to look for details.

What good is a class that does not load? Why not just fix them first? Wouldn't you have to fix them at some point?

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!