Class BinaryTestWriter


  • public class BinaryTestWriter
    extends java.lang.Object
    BinaryTestWriter creates the data file used by BinaryTestFinder. It uses a test finder to find all the tests in a test suite and writes them out in a compact compressed form. By default it uses the standard tag test finder, and writes the output in a file called testsuite.jtd in the root directory of the test suite.
    Options:
    -finder finderClass finderArgs ... -end
    the test finder to be used to locate the tests; the default is the standard tag test finder
    -strictFinder
    Do not ignore errors from the source finder, exit with error code instead
    -o output-file
    specify the name of the output file; the default is testsuite.jtd in the root directory of the test suite.
    testsuite
    (Required.) The test suite root file.
    initial-files
    (Optional)Any initial starting points within the test suite: the default is the test suite root
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      class  BinaryTestWriter.BadArgs
      This exception is used to report bad command line arguments.
      class  BinaryTestWriter.Fault
      This exception is used to report problems that occur while running.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static void main​(java.lang.String[] args)
      Standard program entry point.
      int run​(java.lang.String[] args)
      Main work method.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • BinaryTestWriter

        public BinaryTestWriter()
    • Method Detail

      • main

        public static void main​(java.lang.String[] args)
        Standard program entry point.
        Parameters:
        args - An array of strings, typically provided via the command line. The arguments should be of the form:
        [options] testsuite [tests]
        Options
        -finder finderClass finderArgs ... -end The name of a test finder class and any arguments it might take. The results of reading this test finder will be stored in the output file.
        -o output-file The output file in which to write the results.
      • run

        public int run​(java.lang.String[] args)
                throws BinaryTestWriter.BadArgs,
                       BinaryTestWriter.Fault,
                       java.io.IOException
        Main work method. Reads all the arguments on the command line, makes sure a valid testFinder is available, and then calls methods to create the tree of tests and then write the binary file.
        Parameters:
        args - An array of strings, typically provided via the command line
        Returns:
        The disposition of the run, i.e. zero for a problem-free execution, non-zero if there was some sort of problem.
        Throws:
        BinaryTestWriter.BadArgs - if a problem is found in the arguments provided
        BinaryTestWriter.Fault - if a fault is found while running
        java.io.IOException - if a problem is found while trying to read a file or write the output file
        See Also:
        main(java.lang.String[])