
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.
To run a single test case:
- Open the Java perspective
- In the Package Navigator, expand the test package
- Right-click on a test case (for example, CustomerTest.java) and select Run As→JUnit Test
- 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:
- The database is not started.
- The user name or password is wrong.
- The database is not generated.
- The mapping is wrong.
To run the test suite:
- Open the Java perspective
- In the Package Navigator, expand the test package
- Right-click on the AllTests.java test suite and select Run As→JUnit Test from the contextual menu
- Select the JUnit view to verify the result
Copyright (C) 2006. Sybase Inc. All rights reserved.
|
|