JUnit in action Reading Notes 1

Source: Internet
Author: User
In 1997, Erich Gamma (Gang of Four) and Kent Beck (XP) created JUnit for Java.
If ProgramIf a function of is not automatically tested, the function basically does not exist.

The current JUnit version 3.8.1. Uncompress junit.zip to C:/junit3.8.1
Run test ruuner on the text interface
Java-CP JUnit. jar;. JUnit. textui. tetrunner JUnit. samples. alltests
Run test ruuner of the graphic interface
Java-CP JUnit. jar;. JUnit. swingui. tetrunner JUnit. samples. alltests
Keep the bar green to keep the code clean.


Public class testxxx extends JUnit. Framework. testcase
{
...
Assertequals (string message, object expected, object actual );
}
Class that inherits the testcase base class. You can use assertequals to perform automatic tests through JUnit.

Test Case
Test Suite
Test the runner basetestrunner

Testresult
Testlistener

Scaffold fixture
Setup ()-> testxxx ()-> teardown ()

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.