First, Introduction
JUnit is a unit test framework for the Java language. Founded by Kent Beck and Erich Gamma, it became the most successful of the Xunit family of Sunit from Kent Beck. JUnit has its own JUnit expansion biosphere. Most Java development environments have integrated JUnit as a unit test tool.
Second, the Environment configuration
1. Create a new Java project in Eclipse, named Softwaretesting,src, under the new package named Cn.tju.scs, which we have written to test the class triangle, which implements the judgment of whether the triangle is formed. The new source folder named Test, under which the new package name is also Cn.tju.scs, is placed under our test class triangletest. Add the downloaded two packages JUNIT4 and hamcrest to the project. As shown in the following:
2. Click Add in the menu Help->install New software and the following dialog box appears.
3, wait for the installation finished restart Eclipse, found the toolbar appears new button:
That means the installation was successful.
4, click to run, the results are as follows:
Software testing JUnit Configuration and use