In Eclipse, how do I run a JUnit test case multiple times

后端 未结 4 1517
深忆病人
深忆病人 2020-12-31 19:44

I have a unit test that fails sometimes and debugging it is a pain because I don\'t know why it sometimes fails.

Is there a way inside Eclipse that I can run a JUnit

4条回答
  •  情话喂你
    2020-12-31 19:46

    There is a test decorator for this. See Junit API at http://junit.org/apidocs/junit/extensions/RepeatedTest.html

    for example

    @Test  
    @Repeat(10)  
    public void FailRandomlyNeedToKnowWhy() {  
        ....
    }
    

提交回复
热议问题