Latest videos

Categories > JUnit tutorial > JUnit test suite in Eclipse tutorial

JUnit test suite in Eclipse tutorial

Annotation:

You can run each JUnit test using Run As -> JUnit test. But what if you have more JUnit tests and you want to run them easier?

If you want to run all JUnit tests in some package, just right click on that package and select Run As -> JUnit test. You can also select multiple packages.

If you want more fine control over JUnit test execution, create a JUnit test suite.

Right click and select New -> Other -> New JUnit Test Suite, choose name of the suite, select which test classes will be included in this test suite and select finish. This will create a class with annotation @SuiteClasses. Inside are defined JUnit test cases which will be included in this test suite. You can even call here another test suite. Now you can easily run this whole suite using Run As -> JUnit test.

comments powered by Disqus

Recommended materials

Share / Subscribe

Search

Free online web Java example projects

Want to develop whole web applications which use database, security and more? See my github account, where are lot's of example projects:

github

Copyright

Created by , professional Java and Oracle DB trainer. All Rights Reserved.

Other projects

This web site is monitored by FOSS Site monitoring application

My GitHub account