法1.使用eclipse中自带的junit
在项目上点右键 new->JUnit Test Case
法2.自行下载junit 及 hamcrest(在法1的基础上添加)
将junit的jar包 以及 hamcrest的两个jar包添加至项目中
(在项目上右键 Build Path->Add External Archives...)
在项目上点右键 new->JUnit Test Case
将junit的jar包 以及 hamcrest的两个jar包添加至项目中
(在项目上右键 Build Path->Add External Archives...)