Junit与Eclemma的初步安装与使用
一、junit和hamcrest安装及引入
首先进入网址http://junit.org/junit4/下载junit及hamcrest 。其次打开Eclipse新建一个名为lab1的项目,然后右键点击build path 引进junit就行了。如图:

之后是安装eclemma:
首先点击eclipse中的help 选定help中的 Marketplace

之后在find 中搜索 eclemma 再进行安装就行。
之后编写程序

之后生成junit

junit内容

之后再运行junit

运行eclemma

完成测试!
浙公网安备 33010602011771号