Chapter 9 Generating Persistent Objects for Java and JSF Pages


Running unit tests in Eclipse

Eclipse integrates JUnit. The JUnit Jar files and JUnit user-interface are provided.

Steps To run a single test case:

  1. Open the Java perspective
  2. In the Package Navigator, expand the test package
  3. Right-click on a test case (for example, CustomerTest.java) and select Run As→JUnit Test
  4. Select the JUnit view to verify the result:


    If there are 0 errors, then the test has succeeded. If there are errors, you need to check the Console view to locate the sources of them. The problem could be:


Steps To run the test suite:

  1. Open the Java perspective
  2. In the Package Navigator, expand the test package
  3. Right-click on the AllTests.java test suite and select Run As→JUnit Test from the contextual menu
  4. Select the JUnit view to verify the result

 


Copyright (C) 2006. Sybase Inc. All rights reserved.