Software Project Management_JUnit && Maven

Task1:

Develop the project “HelloWorld”

-A .java program: Just print out “Hello” + your name;

-A test case using Junit to verify whether the program works well.

Steps to realize:

A .java program: Just print out “Hello” + your name;

Using Eclipse to creat a new java project:

Run it:

A test case using Junit to verify whether the program works well.

File->Build path->Add Library->JUnit;

File->new->class "junit" and then run it, shown as follow:

Task2:

Install Maven and Build the “HelloWorld” Project

-Create the directories as “Convention Over Configuration.

-Use “compile, test, package” to build the project.

1.Download Maven from http://maven.apache.org/ and then configure environment variables.

控制面板>系统>高级系统设置>环境变量

 2.Check Maven is installed or not "mvn -v"

3.Using Eclipse "File>New>Other>Maven>Maven Project"

In AppTest.java:

 

Then,run it and we got:

 

Yahooo!Finished!

We can also use cmd to creat package. But it is "mafan"/complex . So I used Eclipse to creat maven directly.

posted @ 2015-04-27 22:42  张悠悠  阅读(223)  评论(0编辑  收藏  举报