Junit Test @ test red name problem, junit Test @ test

Source: Internet
Author: User

Junit Test @ test red name problem, junit Test @ test

Prepare for testing. For example, all are named Red.

Ctrl + 1 or move the cursor over @ Test

Place the cursor on @ Test, and click Install.

For example

 

Test is not an annotation type. It was found at the beginning that re-establishing a project would solve the problem (no reason was found). Then, I wrote the type of the Test class into the name of Test, which is speechless.

Next

Code:

Package com. itheima. junit; import org. junit. after; import org. junit. before; import org. junit. test; public class DemoPerson {Person p; @ Before public void before () {p = new Person (); System. out. println ("qian .. ") ;}@ Test public void testSay () {p. say () ;}@ Test public void testRun () {p. run () ;}@ After public void after () {System. out. println ("after... ");}}

Result

 

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.