Saturday, December 31, 2011

Running JUnit Test Cases

1 .The goal when running JUnit test cases is a green bar in the JUnit view. The green bar shows that all of the test cases passed. A red bar shows that one or more of the test cases failed. 
Green bar for success and red bar for failure
2. There are three ways to run JUnit Test Cases or Test Suites.
  1. You can right click on the test case class or test suite class and select Run As > JUnit Test.
  2. You can select a test case or suite and click the arrow on the Run Class icon(shown at the end of the post) or select Run from the toolbar, and select Run As > JUnit Test.
  3. You can select a test case or suite and click the arrow on the Run Class icon(shown at the end of the post)  or select Run from the toolbar, and select Open Run Dialog... From here you will create a new JUnit test configuration, and name it. You can choose to run a single test case, a test suite, or run all test cases in a project or folder.
Icons used:
Run Class

No comments:

Post a Comment