Java JUNIT4 Testing Capabilities

Source: Internet
Author: User

As a novice in Java, some things need to be written down for easy viewing later.

To make yourself a good habit, create a new test folder: Test
On the project, right-click →new→folder. Create a new test folder.

Next, create a new file for testing (I use Eclipse for Java EE) under the package of the file you need to test:

Click on other to find the Java→junit→junit Test case, click Next

Then click Finish directly after the name of the file to add test

After that, pull this file into the test folder (the Test folder has a Red Cross because I have already generated the tests file in my project):

Then open Userservicetest.java file, under

 Public void Test () {        //fail ("not yet implemented");    }

The ability to test is written in.

Java JUNIT4 Testing Capabilities

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.