Chapter 9 Generating Persistent Objects for Java and JSF Pages


Running unit tests with Ant

To generate the Ant build.xml file, you need to select the Generate Ant build.xml file in the Java code generation window.

To use Ant, you need to:

Steps To run unit tests with Ant from PowerDesigner:

  1. Select Language→Generate Java Code
  2. Select the Options tab.
  3. Set the Generate Ant build.xml file option to true.
  4. Select the Tasks tab.
  5. Check the Hibernate: Run the generated unit tests task.
  6. Click OK.
  7. After you close the generation files list window, the JUnit task runs. You can see the result in output window.

Steps To run unit tests with Ant from the command line:

  1. Open a command line window.
  2. Go to the directory where you have generated the code.
  3. Run the JUnit test task: Ant junit
  4. Check the output result.

 


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