简体   繁体   中英

How do I add tests to an existing JUnit in Eclipse?

I added some methods in a class which was already under a JUnit coverage.
Now I want to extend the existing JUnit with some tests to validate the new methods.

I want to know if there is a way to do this via GUI, without installing any other plugin like this answer advices.

Thank you in advance.

Well, without the plugin, you always have the manual method.

Just add the test methods to your JUnit and annotate them with @Test . This will allow JUnit to recognize the method as a test and execute it. In these newly added methods, you should invoke the newly added methods of your class and check their behavior.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM