eclipse for Java unit test project

First, the right project name -> buildpath-> configure buildpath-> add library-> junit-> select version (4 for example) -> apply-> ok

Second, add @Test before the function to be tested again -> right-click the project name -> run as -> junit test

Guess you like

Origin www.cnblogs.com/blogs-jch/p/11307764.html