java/src/org/apache/qetest/xsl/BugzillaTestletDriver.java [219:334]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
            reporter.testCaseClose();
        }  // of while...
    }
    
    
    /**
     * Transform a vector of individual test names into a Vector 
     * of filled-in datalets to be tested - Bugzilla-specific.  
     *
     * This does special processing since we may either have .java 
     * files that should be compiled, or we may have plain .xsl/.xml 
     * file pairs that we should simpy execute through a default 
     * StylesheetTestlet as-is.
     * This basically just calculates local path\filenames across 
     * the three presumably-parallel directory trees of testLocation 
     * (inputDir), outLocation (outputDir) and goldLocation 
     * (forced to be same as inputDir).  It then stuffs each of 
     * these values plus some generic info like our testProps 
     * into each datalet it creates.
     * 
     * @param files Vector of local path\filenames to be tested
     * @param testLocation File denoting directory where all 
     * .xml/.xsl tests are found
     * @param outLocation File denoting directory where all 
     * output files should be put
     * @param goldLocation File denoting directory where all 
     * gold files are found - IGNORED; forces testLocation instead
     * @return Vector of StylesheetDatalets that are fully filled in,
     * i.e. outputName, goldName, etc are filled in respectively 
     * to inputName
     */
    public Vector buildDatalets(Vector files, File testLocation, 
                                File outLocation, File goldLocation)
    {
        // Validate arguments
        if ((null == files) || (files.size() < 1))
        {
            // Bad arguments, report it as an error
            // Note: normally, this should never happen, since 
            //  this class normally validates these arguments 
            //  before calling us
            reporter.logWarningMsg("buildDatalets null or empty file vector");
            return null;
        }
        Vector v = new Vector(files.size());
        int xslCtr = 0;
        int javaCtr = 0;

        // For every file in the vector, construct the matching 
        //  out, gold, and xml/xsl files; plus see if we have 
        //  a .java file as well
        for (Enumeration elements = files.elements();
                elements.hasMoreElements(); /* no increment portion */ )
        {
            String file = null;
            try
            {
                file = (String)elements.nextElement();
            }
            catch (ClassCastException cce)
            {
                // Just skip this entry
                reporter.logWarningMsg("Bad file element found, skipping: " + cce.toString());
                continue;
            }

            Datalet d = null;
            // If it's a .java file: just set java.source.name/java.class.name
            if (file.endsWith(JAVA_EXTENSION))
            {
                // Use TraxDatalets if we have .java
                d = new TraxDatalet();
                ((TraxDatalet)d).options = new Properties(testProps);
                ((TraxDatalet)d).options.put("java.source.dir", testLocation);
                ((TraxDatalet)d).options.put(JAVA_SOURCE_NAME, file);
                ((TraxDatalet)d).options.put("fileCheckerImpl", fileChecker);
                // That's it - when we execute tests later on, if 
                //  there's a JAVA_SOURCE_NAME we simply use that to 
                //  find the testlet to execute
                javaCtr++;
            }
            // If it's a .xsl file, just set the filenames as usual
            else if (file.endsWith(XSL_EXTENSION))
            {
                // Use plain StylesheetDatalets if we just have .xsl
                d = new StylesheetDatalet();
                ((StylesheetDatalet)d).inputName = testLocation.getPath() + File.separator + file;

                String fileNameRoot = file.substring(0, file.indexOf(XSL_EXTENSION));
                // Check for existence of xml - if not there, then set to some default
                //@todo this would be a perfect use of TraxDatalet.setXMLString()
                String xmlFileName = testLocation.getPath() + File.separator + fileNameRoot + XML_EXTENSION;
                if ((new File(xmlFileName)).exists())
                {
                    ((StylesheetDatalet)d).xmlName = xmlFileName;
                }
                else
                {
                    ((StylesheetDatalet)d).xmlName = testLocation.getPath() + File.separator + DEFAULT_XML_FILE;
                }
                ((StylesheetDatalet)d).outputName = outLocation.getPath() + File.separator + fileNameRoot + OUT_EXTENSION;
                ((StylesheetDatalet)d).goldName = testLocation.getPath() + File.separator + fileNameRoot + OUT_EXTENSION;
                ((StylesheetDatalet)d).flavor = flavor;
                ((StylesheetDatalet)d).options = new Properties(testProps);
                ((StylesheetDatalet)d).options.put("fileCheckerImpl", fileChecker);
                // These tests will be run by a plain StylesheetTestlet
                xslCtr++;
            }
            else
            {
                // Hmmm - I'm not sure what we should do here
                reporter.logWarningMsg("Unexpected test file found, skipping: " + file);
                continue;
            }
            d.setDescription(file);
            v.addElement(d);
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



java/src/org/apache/qetest/xsl/JiraTestletDriver.java [218:333]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
            reporter.testCaseClose();
        }  // of while...
    }
    
    
    /**
     * Transform a vector of individual test names into a Vector 
     * of filled-in datalets to be tested - Jira-specific.  
     *
     * This does special processing since we may either have .java 
     * files that should be compiled, or we may have plain .xsl/.xml 
     * file pairs that we should simpy execute through a default 
     * StylesheetTestlet as-is.
     * This basically just calculates local path\filenames across 
     * the three presumably-parallel directory trees of testLocation 
     * (inputDir), outLocation (outputDir) and goldLocation 
     * (forced to be same as inputDir).  It then stuffs each of 
     * these values plus some generic info like our testProps 
     * into each datalet it creates.
     * 
     * @param files Vector of local path\filenames to be tested
     * @param testLocation File denoting directory where all 
     * .xml/.xsl tests are found
     * @param outLocation File denoting directory where all 
     * output files should be put
     * @param goldLocation File denoting directory where all 
     * gold files are found - IGNORED; forces testLocation instead
     * @return Vector of StylesheetDatalets that are fully filled in,
     * i.e. outputName, goldName, etc are filled in respectively 
     * to inputName
     */
    public Vector buildDatalets(Vector files, File testLocation, 
                                File outLocation, File goldLocation)
    {
        // Validate arguments
        if ((null == files) || (files.size() < 1))
        {
            // Bad arguments, report it as an error
            // Note: normally, this should never happen, since 
            //  this class normally validates these arguments 
            //  before calling us
            reporter.logWarningMsg("buildDatalets null or empty file vector");
            return null;
        }
        Vector v = new Vector(files.size());
        int xslCtr = 0;
        int javaCtr = 0;

        // For every file in the vector, construct the matching 
        //  out, gold, and xml/xsl files; plus see if we have 
        //  a .java file as well
        for (Enumeration elements = files.elements();
                elements.hasMoreElements(); /* no increment portion */ )
        {
            String file = null;
            try
            {
                file = (String)elements.nextElement();
            }
            catch (ClassCastException cce)
            {
                // Just skip this entry
                reporter.logWarningMsg("Bad file element found, skipping: " + cce.toString());
                continue;
            }

            Datalet d = null;
            // If it's a .java file: just set java.source.name/java.class.name
            if (file.endsWith(JAVA_EXTENSION))
            {
                // Use TraxDatalets if we have .java
                d = new TraxDatalet();
                ((TraxDatalet)d).options = new Properties(testProps);
                ((TraxDatalet)d).options.put("java.source.dir", testLocation);
                ((TraxDatalet)d).options.put(JAVA_SOURCE_NAME, file);
                ((TraxDatalet)d).options.put("fileCheckerImpl", fileChecker);
                // That's it - when we execute tests later on, if 
                //  there's a JAVA_SOURCE_NAME we simply use that to 
                //  find the testlet to execute
                javaCtr++;
            }
            // If it's a .xsl file, just set the filenames as usual
            else if (file.endsWith(XSL_EXTENSION))
            {
                // Use plain StylesheetDatalets if we just have .xsl
                d = new StylesheetDatalet();
                ((StylesheetDatalet)d).inputName = testLocation.getPath() + File.separator + file;

                String fileNameRoot = file.substring(0, file.indexOf(XSL_EXTENSION));
                // Check for existence of xml - if not there, then set to some default
                //@todo this would be a perfect use of TraxDatalet.setXMLString()
                String xmlFileName = testLocation.getPath() + File.separator + fileNameRoot + XML_EXTENSION;
                if ((new File(xmlFileName)).exists())
                {
                    ((StylesheetDatalet)d).xmlName = xmlFileName;
                }
                else
                {
                    ((StylesheetDatalet)d).xmlName = testLocation.getPath() + File.separator + DEFAULT_XML_FILE;
                }
                ((StylesheetDatalet)d).outputName = outLocation.getPath() + File.separator + fileNameRoot + OUT_EXTENSION;
                ((StylesheetDatalet)d).goldName = testLocation.getPath() + File.separator + fileNameRoot + OUT_EXTENSION;
                ((StylesheetDatalet)d).flavor = flavor;
                ((StylesheetDatalet)d).options = new Properties(testProps);
                ((StylesheetDatalet)d).options.put("fileCheckerImpl", fileChecker);
                // These tests will be run by a plain StylesheetTestlet
                xslCtr++;
            }
            else
            {
                // Hmmm - I'm not sure what we should do here
                reporter.logWarningMsg("Unexpected test file found, skipping: " + file);
                continue;
            }
            d.setDescription(file);
            v.addElement(d);
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



