Performing a percentage of JUnit tests

Is there an easy way to tell JUnit that you only need a certain percentage or number of tests? I'm mostly looking for something at the method level, but the class is good too.

I understand that this is non-standard for unit tests, but I mainly work on machine learning, where I do not expect every test to pass.

+3
source share
2 answers

I would recommend writing a custom @Rule. You can start by implementing ErrorCollector and change it so as not to report errors in a certain percentage.

+6
source

, int, , @After ( ).

+1

All Articles