How do I run JUnit tests from inside my java application?

前端 未结 6 2081
无人共我
无人共我 2020-11-28 05:14

Is it possible to run JUnit tests from inside my java application?

Are there test frameworks I can use (such as JUnit.jar?), or am I force to find the test files, in

6条回答
  •  情歌与酒
    2020-11-28 05:52

    As documented in the JUnit FAQ:

    public static void main(String args[]) {
      org.junit.runner.JUnitCore.main("junitfaq.SimpleTest");
    }
    

提交回复
热议问题