Test tool program

TestCatalogBean.java located in <install_root>\help\samples\APICatalog, is a test tool for JReport Catalog Bean. It is primarily designed and built for you to test all the methods of JReport Catalog Bean.

The test tool program has a user interface, and all the functions of the Catalog Bean can be invoked using the menu items. Depending on success or failure of each test, you will get either a return result or an exception message respectively.

To run the JReport Catalog Bean test tool program, you should:

  1. Compile the source code of TestCatalogBean.java. For example, JReport Designer is installed in C:\JReport\Designer, you can compile the it using the following command:
    C:\JReport\Designer\help\samples\APICatalog>javac
    -classpath C:\JReport\Designer\lib\report.jar;C:\JReport\Designer\lib\sac.jar;C:\JReport\Designer\lib\JREngine.jar;
    TestCatalogBean.java
  2. Run the test tool:
    C:\JReport\Designer\help\samples\APICatalog>java -Dreporthome="C:\JReport\Designer"
    -classpath "C:\JReport\Designer\lib\JREngine.jar;C:\JReport\Designer\lib\sac.jar;C:\JReport\Designer\lib\report.jar;
    C:\JReport\Designer\lib\log4j-1.2.8.jar;C:\JReport\Designer\lib\hsqldb.jar"
    TestCatalogBean

    After activating the program, a window will be displayed.

  3. Before starting other commands, you should first set the home path and the catalog name.

    Select File > Set Home Directory to set the home path and File > Set Catalog Name to set the catalog name.

  4. Then, you can create a new catalog with the specified catalog name, or load an existing catalog in the same way.
  5. The test tool also provides the source code of each method, and you can copy and paste it into your program from the text window.