o(╥﹏╥)oSad

WeChat cannot downloadJunit4, but just click on the upper right corner and select open in browser or Safari!
Junit4

Junit4

  • Size: 1.2M
  • Language: Simplified Chinese
  • category: JAVA program
  • System: winall

JUnit is a unit testing framework in the Java language. It has a wide range of functions in programming languages ​​such as Java, C++, and C. Using JUnit can greatly increase your programming efficiency. If you have friends who need Junit, download it and use it immediately.

Junit4

Basic introduction

JUnit is a unit testing framework for the Java language. It was founded by Kent Beck and Erich Gamma and gradually became the most successful of the xUnit family derived from Kent Beck's sUnit. JUnit has its own JUnit extension ecosystem. Most Java development environments have integrated JUnit as a unit testing tool. JUnit is a regression testing framework written by Erich Gamma and Kent Beck. Junit testing is programmer testing, the so-called white-box testing, because programmers know how (How) the software being tested completes its functions and what (What) functions it completes. Junit is a set of frameworks. If you inherit the TestCase class, you can use Junit for automatic testing.

Content screenshot

Junit4

Import method

  Introduce the method of configuring practical JUnit4 in Eclipse (the same is true for MyEclipse).

1. Right-click on your project and select Properties at the bottom, select Java Build Path in the navigation bar on the left side of the pop-up window, and select Libraries on the upper tab;

Junit4

2. Then click Add Library... on the right, select JUnit in the pop-up window and click Next>;

Junit4

3. JUnit 4 is selected by default, and then Finish;

Junit4

In this way, the JUnit 4 test toolkit is added.

Test method

First, right-click on the class file we want to test->New->Junit Test Case, and a dialog box for creating a new JUnit test case will pop up. You can select the JUnit version, path name and a series of information here, or you can use By default, we select the setUp() and tearDown() functions to perform initialization and garbage collection based on the default configuration;

Junit4

Then click Next> to select the functions that need to be tested in the class. We select the four functions plus, minus, times, and divide that we wrote before;

Junit4

Click Finish, and a test class named TestCalculate will automatically be created, which contains empty test cases for the corresponding functions. Now you only need to fill in the code of the test content you want to perform.

Junit4

After that, we right-click Run As->JUnit Test on the test class to run the test and the results pop up on the left.

Junit4

Version: Official version | Update time: 2024-11-01

Similar recommendations

Latest updates

Junit4 review

  • 1st floor Huajun netizen 2019-09-27 21:28:23
    Junit4 is very useful, thank you! !
  • 2nd floor Huajun netizen 2021-07-20 10:20:20
    Junit4 hopes to do better and better, come on!
  • 3rd floor Huajun netizen 2021-12-15 08:26:09
    Junit4 is convenient, practical and powerful. The software is very easy to use!

Recommended products

Everyonealso likeThese:

+

This application has not passed real-name authentication and you can download it through the mobile assistant.

CancelOK