pauldick    01/09/26 06:16:36

  Modified:    c/Tests/Params Params.cpp
  Log:
  Major overhaul to use lastest harness api's
  
  Revision  Changes    Path
  1.9       +52 -70    xml-xalan/c/Tests/Params/Params.cpp
  
  Index: Params.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/Tests/Params/Params.cpp,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- Params.cpp        2001/09/14 21:05:04     1.8
  +++ Params.cpp        2001/09/26 13:16:36     1.9
  @@ -88,7 +88,7 @@
   
   // GLOBAL VARIABLES...
   FileUtility                          futil;
  -XalanDOMString                       baseDir, outputRoot, goldRoot, goldFile;  // 
These are set by the getParams routine.
  +XalanDOMString                       baseDir, outputRoot, goldRoot, theGoldFile;  
// These are set by the getParams routine.
   const XalanDOMString testDir("params");
   XalanDOMString                       fileName;
   
  @@ -253,83 +253,65 @@
                                {
                                        fileName = files[i];
                                        sprintf(testCase, "%s%d","TestCase",i+1);
  +                                     futil.data.testOrFile = testCase;
   
  -                                             // Output file name to result log and 
console.
  -                                             logFile.logTestCaseInit(fileName);
  -                                             //cout << fileName << endl;
  -
  -                                             // Set up the input/output files.
  -                                             const XalanDOMString  theXSLFile= 
baseDir + testDir + pathSep + fileName;
  -                                             const XalanDOMString  theXMLFile = 
futil.GenerateFileName(theXSLFile,"xml");
  -                                             const XalanDOMString  theOutput =  
outputRoot + testDir + pathSep + fileName; 
  -                                             const XalanDOMString  theOutputFile = 
futil.GenerateFileName(theOutput, "out");
  -                                             goldFile = goldRoot +testDir + pathSep 
+ fileName;
  -                                             goldFile = 
futil.GenerateFileName(goldFile, "out");
  -
  -                                             XSLTResultTarget                
theResultTarget(theOutputFile);
  -                                             const XSLTInputSource   
xslInputSource(c_wstr(theXSLFile));
  -                                             const XSLTInputSource   
xmlInputSource(c_wstr(theXMLFile));
  +
  +                                     // Set up the input/output files.
  +                                     const XalanDOMString  theXSLFile= baseDir + 
testDir + pathSep + fileName;
  +                                     const XalanDOMString  theXMLFile = 
futil.GenerateFileName(theXSLFile,"xml");
  +                                     const XalanDOMString  theOutput =  outputRoot 
+ testDir + pathSep + fileName; 
  +                                     const XalanDOMString  theOutputFile = 
futil.GenerateFileName(theOutput, "out");
  +                                     theGoldFile = goldRoot +testDir + pathSep + 
fileName;
  +                                     theGoldFile = 
futil.GenerateFileName(theGoldFile, "out");
  +
  +                                     XSLTResultTarget                
theResultTarget(theOutputFile);
  +                                     const XSLTInputSource   
xslInputSource(c_wstr(theXSLFile));
  +                                     const XSLTInputSource   
xmlInputSource(c_wstr(theXMLFile));
                                                
  -                                             // Set the desired parameters
  -                                             switch (getTestNumber(fileName))
  -                                             {       
  -                                                     case 2:
  -                                                             
transformEngine.setStylesheetParam("in1", "'A '");
  -
  -                                                             
transformEngine.setStylesheetParam("in2", "'B '");
  -
  -                                                             
transformEngine.setStylesheetParam(
  -                                                                     
XalanDOMString("in3"),
  -                                                                     
XalanDOMString("'C '"));
  -                                                             
transformEngine.setStylesheetParam(
  -                                                                     
XalanDOMString("in4"),
  -                                                                     
XalanDOMString("'D '"));
  -                                                             
transformEngine.setStylesheetParam(
  -                                                                     
XalanDOMString("in5"),
  -                                                                     
XalanDOMString("'E '"));
  -                                                             break;
  -
  -                                                     case 3:
  -                                                             
transformEngine.setStylesheetParam(
  -                                                                     
XalanDOMString("'xyz:in1'"),
  -                                                                     
XalanDOMString("'DATA'"));
  -                                                             break;
  -
  -                                                     default:
  -                                                             
transformEngine.setStylesheetParam(
  -                                                                     
XalanDOMString("input"),
  -                                                                     
XalanDOMString("'testing 1 2 3'"));
  -                                                             break;
  -                                             }
  -
  -                                             // Do a total end to end transform 
with no pre parsing of either xsl or xml files.
  -                                             int     theResult =
  -                                                     
transformEngine.transform(xmlInputSource, xslInputSource, theResultTarget);
  -
  -                                             if (!theResult)
  -                                             {
  -                                                     //const XSLTInputSource 
resultInputSource(c_wstr(theOutputFile));
  -                                                     //const XSLTInputSource 
goldInputSource(c_wstr(goldFile));
  -                                                     
if(futil.compareSerializedResults(theOutputFile, goldFile)) 
  -                                                     {
  -                                                             cout << "Passed: " << 
fileName << endl;
  -                                                             
logFile.logCheckPass(fileName);
  -                                                     }
  -                                                     else
  -                                                     {
  -                                                             
logFile.logCheckFail(fileName);
  -                                                     }
  -                                             }
  -                                             else
  -                                             {
  -                                                     cout  << "Failed: " << 
testCase << endl;
  -                                             }               
  +                                     // Set the desired parameters
  +                                     switch (getTestNumber(fileName))
  +                                     {       
  +                                             case 2:
  +                                                     
transformEngine.setStylesheetParam("in1", "'A '");
  +
  +                                                     
transformEngine.setStylesheetParam("in2", "'B '");
  +
  +                                                     
transformEngine.setStylesheetParam(
  +                                                             XalanDOMString("in3"),
  +                                                             XalanDOMString("'C 
'"));
  +                                                     
transformEngine.setStylesheetParam(
  +                                                             XalanDOMString("in4"),
  +                                                             XalanDOMString("'D 
'"));
  +                                                     
transformEngine.setStylesheetParam(
  +                                                             XalanDOMString("in5"),
  +                                                             XalanDOMString("'E 
'"));
  +                                                     break;
  +
  +                                             case 3:
  +                                                     
transformEngine.setStylesheetParam(
  +                                                             
XalanDOMString("'xyz:in1'"),
  +                                                             
XalanDOMString("'DATA'"));
  +                                                     break;
  +
  +                                             default:
  +                                                     
transformEngine.setStylesheetParam(
  +                                                             
XalanDOMString("input"),
  +                                                             
XalanDOMString("'testing 1 2 3'"));
  +                                                     break;
  +                                     }
  +
  +                                     // Do a total end to end transform with no pre 
parsing of either xsl or xml files.
  +                                     transformEngine.transform(xmlInputSource, 
xslInputSource, theResultTarget);
  +
  +                                     // Check and report the results.
  +                                     futil.checkResults(theOutputFile, theGoldFile, 
logFile);
                                }
                                
                        }
   
                        XalanTransformer::terminate();
   
  +                     futil.reportPassFail(logFile);
                        logFile.logTestFileClose("Param Testing: ", "Done");
                        logFile.close();
   
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to