[Software test _LAB1] installing JUnit and hamcrest and their use

Source: Internet
Author: User

I. Integration of JUnit and hamcrest in the IDE

After you create the project, import the JUnit and hamcrest jar packages

Hamcrest-all-1.3.jar

Junit-4.12.jar

Using the IDE for IntelliJ idea, right-click on the project, open the opening Module Settings, and add the above two jar packages in the Library tab to use in the program

Ii. Creating a triangle class for judging triangles

Third, create the corresponding test class

The directory structure is as follows

Iv. Running test Cases

Test Pass

V. View Code Coverage

The Code coverage test by clicking Run ' triangletest with coverage ' results in the following

[Software test _LAB1] installing JUnit and hamcrest and their use

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.