1、右键项目名->buildpath->configure buildpath->add library->junit->选择版本(以4为例)->apply->okapp
2、再要测试的函数前添加@Test -> 右击项目名 -> run as -> junit test函数