java/src/org/apache/qetest/trax/TestMultiTypeThreads.java [350:532]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        println("</resultsfile>");

        if (pWriter != null)
            pWriter.flush();
    }

    /**
     * Read in properties file and set instance variables.  
     *
     * @param fName name of .properties file to read
     * @return false if error occoured
     */
    protected boolean initPropFile(String fName)
    {

        Properties p = new Properties();

        try
        {

            // Load named file into our properties block
            FileInputStream fIS = new FileInputStream(fName);

            p.load(fIS);

            // Parse out any values that match our internal convenience variables
            outputDir = p.getProperty("outputDir", outputDir);

            // Validate the outputDir and use it to reset the logFileName
            File oDir = new File(outputDir);

            if (!oDir.exists())
            {
                if (!oDir.mkdirs())
                {

                    // Error, we can't create the outputDir, default to current dir
                    println("<message desc=\"outputDir(" + outputDir
                            + ") does not exist, defaulting to .\"/>");

                    outputDir = ".";
                }
            }

            // Verify inputDir as well
            inputDir = p.getProperty("inputDir", inputDir);

            File tDir = new File(inputDir);

            if (!tDir.exists())
            {
                if (!tDir.mkdirs())
                {

                    // Error, we can't create the inputDir, abort
                    println("<message desc=\"inputDir(" + inputDir
                            + ") does not exist, terminating test\"/>");

                    return false;
                }
            }

            // Add on separators
            inputDir += File.separator;
            outputDir += File.separator;

            // Each defaults to variable initializers            
            logFileName = p.getProperty("logFile", logFileName);
            setOneFilenameRoot = p.getProperty("setOneFile",
                                               setOneFilenameRoot);
            setTwoFilenameRoot = p.getProperty("setTwoFile",
                                               setTwoFilenameRoot);
            setThreeFilenameRoot = p.getProperty("setThreeFile",
                                                 setThreeFilenameRoot);
            paramName = p.getProperty("paramName", paramName);
            paramVal = p.getProperty("paramVal", paramVal);
            liaison = p.getProperty("liaison", liaison);

            String numb;

            numb = p.getProperty("numRunners");

            if (numb != null)
            {
                try
                {
                    numRunners = Integer.parseInt(numb);
                }
                catch (NumberFormatException numEx)
                {

                    // no-op, leave set as default
                    println("<message desc=\"numRunners threw: "
                            + numEx.toString() + "\"/>");
                }
            }

            numb = p.getProperty("numRunnerCalls");

            if (numb != null)
            {
                try
                {
                    numRunnerCalls = Integer.parseInt(numb);
                }
                catch (NumberFormatException numEx)
                {

                    // no-op, leave set as default
                    println("<message desc=\"numRunnerCalls threw: "
                            + numEx.toString() + "\"/>");
                }
            }
        }
        catch (Exception e)
        {
            println("<arbitrary=\"initPropFile: " + fName + " threw: "
                    + e.toString() + "\">");

            if (pWriter != null)
            {
                e.printStackTrace(pWriter);
            }

            e.printStackTrace();
            println("</arbitrary>");

            return false;
        }

        return true;
    }

    /**
     * Bottleneck output; goes to System.out and main's pWriter.  
     *
     * NEEDSDOC @param s
     */
    protected void println(String s)
    {

        System.out.println(s);

        if (pWriter != null)
            pWriter.println(s);
    }

    /** A simple log output file for the main thread; each runner also has it's own. */
    protected PrintWriter pWriter = null;

    /**
     * Worker method to setup a simple log output file.  
     *
     * NEEDSDOC @param n
     */
    protected void createLogFile(String n)
    {

        try
        {
            pWriter = new PrintWriter(new FileWriter(n, true));
        }
        catch (Exception e)
        {
            System.err.println("<message desc=\"createLogFile threw: "
                               + e.toString() + "\"/>");
            e.printStackTrace();
        }
    }

    /**
     * Startup the test from the command line.  
     *
     * NEEDSDOC @param args
     */
    public static void main(String[] args)
    {

        if (args.length < 1)
        {
            System.err.println("ERROR! Must have at least one argument\n" + usage());

            return;  // Don't System.exit, it's not polite
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



java/src/org/apache/qetest/trax/TestThreads.java [312:494]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        println("</resultsfile>");

        if (pWriter != null)
            pWriter.flush();
    }

    /**
     * Read in properties file and set instance variables.  
     *
     * @param fName name of .properties file to read
     * @return false if error occoured
     */
    protected boolean initPropFile(String fName)
    {

        Properties p = new Properties();

        try
        {

            // Load named file into our properties block
            FileInputStream fIS = new FileInputStream(fName);

            p.load(fIS);

            // Parse out any values that match our internal convenience variables
            outputDir = p.getProperty("outputDir", outputDir);

            // Validate the outputDir and use it to reset the logFileName
            File oDir = new File(outputDir);

            if (!oDir.exists())
            {
                if (!oDir.mkdirs())
                {

                    // Error, we can't create the outputDir, default to current dir
                    println("<message desc=\"outputDir(" + outputDir
                            + ") does not exist, defaulting to .\"/>");

                    outputDir = ".";
                }
            }

            // Verify inputDir as well
            inputDir = p.getProperty("inputDir", inputDir);

            File tDir = new File(inputDir);

            if (!tDir.exists())
            {
                if (!tDir.mkdirs())
                {

                    // Error, we can't create the inputDir, abort
                    println("<message desc=\"inputDir(" + inputDir
                            + ") does not exist, terminating test\"/>");

                    return false;
                }
            }

            // Add on separators
            inputDir += File.separator;
            outputDir += File.separator;

            // Each defaults to variable initializers            
            logFileName = p.getProperty("logFile", logFileName);
            setOneFilenameRoot = p.getProperty("setOneFile",
                                               setOneFilenameRoot);
            setTwoFilenameRoot = p.getProperty("setTwoFile",
                                               setTwoFilenameRoot);
            setThreeFilenameRoot = p.getProperty("setThreeFile",
                                                 setThreeFilenameRoot);
            paramName = p.getProperty("paramName", paramName);
            paramVal = p.getProperty("paramVal", paramVal);
            liaison = p.getProperty("liaison", liaison);

            String numb;

            numb = p.getProperty("numRunners");

            if (numb != null)
            {
                try
                {
                    numRunners = Integer.parseInt(numb);
                }
                catch (NumberFormatException numEx)
                {

                    // no-op, leave set as default
                    println("<message desc=\"numRunners threw: "
                            + numEx.toString() + "\"/>");
                }
            }

            numb = p.getProperty("numRunnerCalls");

            if (numb != null)
            {
                try
                {
                    numRunnerCalls = Integer.parseInt(numb);
                }
                catch (NumberFormatException numEx)
                {

                    // no-op, leave set as default
                    println("<message desc=\"numRunnerCalls threw: "
                            + numEx.toString() + "\"/>");
                }
            }
        }
        catch (Exception e)
        {
            println("<arbitrary=\"initPropFile: " + fName + " threw: "
                    + e.toString() + "\">");

            if (pWriter != null)
            {
                e.printStackTrace(pWriter);
            }

            e.printStackTrace();
            println("</arbitrary>");

            return false;
        }

        return true;
    }

    /**
     * Bottleneck output; goes to System.out and main's pWriter.  
     *
     * NEEDSDOC @param s
     */
    protected void println(String s)
    {

        System.out.println(s);

        if (pWriter != null)
            pWriter.println(s);
    }

    /** A simple log output file for the main thread; each runner also has it's own. */
    protected PrintWriter pWriter = null;

    /**
     * Worker method to setup a simple log output file.  
     *
     * NEEDSDOC @param n
     */
    protected void createLogFile(String n)
    {

        try
        {
            pWriter = new PrintWriter(new FileWriter(n, true));
        }
        catch (Exception e)
        {
            System.err.println("<message desc=\"createLogFile threw: "
                               + e.toString() + "\"/>");
            e.printStackTrace();
        }
    }

    /**
     * Startup the test from the command line.  
     *
     * NEEDSDOC @param args
     */
    public static void main(String[] args)
    {

        if (args.length < 1)
        {
            System.err.println("ERROR! Must have at least one argument\n" + usage());

            return;  // Don't System.exit, it's not polite
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



