JT Harness FAQ

Common questions about the JT harness project are answered here.

About the JT Harness Project

 

How to Run the JT Harness

Reporting Test Results

 

 
  • Can I generate a report in a custom format? For example, can I generate a report as an XML file for a given schema?

    A: The test suite architect (not testers) can provide plug-in code to add to the available report types. The custom report API provides access to the entire set of results, including all test output and the current environment (configuration). All this can be used to generate or execute whatever the architect needs. GUI panels can also be provided so that the tester can configure the options for that report type in the Create Report dialog box. Access to the custom report generation functionality is also available from the command line.

    See com.sun.javatest.exec.ContextManager and com.sun.javatest.report.CustomReport in the API documentation. Please ask questions in the JT harness forum if you need more information.

  • How can I use the known failures list (KFL)?**

    A: This feature is useful if you generate reports and repetitively do identical test runs. It enables you to more easily locate tests that change from one known state to another. For example, the KFL reporting feature can help you see if a test has been failing for the past month but suddenly passes today.

  • How are test cases supported inside the KFL report?**

    A: The harness has not previously supported test cases in past releases. Starting in release 4.4, test cases are supported in the KFL report. In the 4.4 release, test cases are only identified in one format — in an output section named "out1" inside the test result. Each test case is identified by a string matching the following general form:

    (sometext): (Status string)

    Where (sometext) is the test case name, specified without any internal whitespace, followed by a colon. This is followed by a string that begins with a status string from the com.sun.javatest.Status object (Failed, Passed, Error, Not Run). The following is an example of the output:

    MyTest0001: Passed. Security test 10001.

  • What is the format of the known failures list (KFL)?**

    A: The general format is:

    testname[testcases,...] [bugid,bugid]

    Please see the JavaTest User Guide for more information. The file format is currently the same as the exclude list. In future versions of the harness a revised format may be introduced. If this happens, you can identify it by a version string on a comment line at the top of the file.

Using the JT Harness to Create a Test Suite

 

  • What do I have to do to run my test suite using JT harness?

    A: Because the JT harness can run any type of test, you should not have to modify the tests themselves. However, you must take some steps so that the JT harness can find the tests and set up the appropriate execution environment. Using the JT harness plug-in architecture, you can customize the harness so that it can find the tests and execute them properly. You can also modify the test suite so that it runs with the default harness components. This functionality is discussed in detail in the JavaTest Architect's Guide that you can download from java.sun.com.

  • What factors affect initial startup performance and test suite loading time?

    A: Factors include the following:

    • Size of the test suite.
    • Whether the test suite is run in the JT harness GUI, or using batch mode. The GUI has higher overhead and is slower.
    • Use of the binary test finder. The binary test finder uses an optimized test description format that significantly improves the startup performance of large test suites.
    • Amount of physical memory available on the machine (if it is in limited supply).
    • Location of the test suite being loaded. If the test suite is unpacked to a local file system, performance is probably better than if it is accessed over a network.
  • What factors affect how fast the test suite runs?

    A: Factors include the following:

    • Test framework overhead.
    • Proper scheduling of tasks. The JT harness (and your test framework if you use one) can be configured for optimal performance in your test environment.
    • Concurrent test execution. This functionality can be provided by either by the harness or the test framework.
    • The speed of the communication channel between the JT harness host and the test platform affects performance.
    • In some cases, the performance of the file system on which the work directory is stored can affect throughput.
  • What is an agent?

    A: It is a small application that communicates with the JT harness to get and execute tests and send back results. It is used in situations where the JT harness is not run directly on the test platform.

  • Do I have to write my own agent?

    A: Situations could arise to make this necessary, but it is unlikely. This situation might arise if your test platform uses a communication protocol such as UDP, which is only guaranteed to be available on the CDC platform. Another example is if the platform requires a specific application model like the PBP Xlet. Custom agents are available for those and other situations from the ME Framework.

  • I have an existing test suite (for example, JUnit tests). What is required to run these tests in JT harness?

    A: The first step is to read the JavaTest Harness 4.2 Architect's Guide to get a general understanding of the harness architecture and terminology. If you are running JUnit tests, the guide covers the procedure for running those types of tests with little or no modification.

    If you are running tests of a different format, you must generally create your own test finder and test runner classes. The harness uses these classes to find and run your tests. Both classes are subclassed from existing library classes. They can be passed to the harness by specifying them in your testsuite.jtt file. For more information consult the JavaTest Hareness 4.2 Architect's Guide and ask questions on the JT harness forum.

Using JT Harness with JUnit Tests

 

  • What additional work is needed/planned for JT harness JUnit support?

    A: There are some ways that the use of classpath and diagnostics can be made easier to use. JUnit also provides an additional API for capturing test output that could be integrated with similar support in JT harness. In the future, we hope to add more information to the JavaTest Architect's Guide section that covers JUnit integration.

  • Can any JUnit test suite be integrated into the harness?

    A: JUnit test suites are relatively free-form, which can be an advantage, but does make it difficult to make a generalized method for integrating those tests into a harness. It depends on the test's style of execution and the configuration/parameter requirements of the test suite. The amount of work to integrate the test can be minimal, or may require an understanding of the JT harness APIs and may require you to write some framework code.

  • Where should I start my conversion/creation of a JUnit test suite within the JT harness?

    A: If you have not used the JT harness before, you should first run the tutorial — Chapter 2 in the JavaTest Architect's Guide. You will find a link to the JavaTest Architect's Guide can find on the JT Harness Documentation page. The tutorial will familiarize you with how the harness behaves with a working test suite so you will know what the goal is when creating your JUnit suite. The JavaTest User's Guide will also help you understand how the harness works.

    After you familiarize yourself with the harness, read the JUnit integration section of the JavaTest Architect's Guide (Chapter 12). To fully understand that section, you should also read at least the introduction to Chapter 6 (Configuration Interview) and 9 (Test Finder), parts of Chapter 4 (Creating a Test Suite) all of Chapters 3 and 8. This should give you enough background to start playing with files.