Web Servces Testing/SoapUI/Groovy program

dor140

E. Web Servces Testing/SoapUI/Groovy

 

def reqF = "C:/SOAPUI/req"

def resF = "C:/SOAPUI/res"

def reqD = new File(reqF)

def resD = new File (resF);

 

def oracleF = {f1, f2 ->

         assert FC.cmpF(f1, f2)== true;

         log.info("PASS");

         return true;

}

 

 

class FC{

  def static cmpF(f1, f2) {

     def ignoreGUIDs = "-I \"[0-9a-f]\\{32\\}\""

     def ignoreDates = "-I \"[0-9]*\\/[0-9]*\\/[0-9]\\{4\\}\""

     def diffCmd = "diff -bq --strip-trailing-cr $ignoreGUIDs $ignoreDates ${f1} $f2" //GNU diff

     def results = diffCmd.execute()

     results.waitFor()

     assert results.exitValue() == 0

     results.destroy()

     return true;

   }

}

 

files  = reqD.listFiles();

files2 = resD.listFiles()

 

for (currentFile in files && currentFile2 in files2) 

  if(currentFile.exists() && currentile2.exists())

    assert oracleF(currentFile,currentFile2) == true;

 

1. Q: What is the code above doing?

   A:

 

2. Q: Place comments in the code explaining its function.

   A:

 

3. Q: What functional test case would you design to test oracleF?

   A:

    • 11 years ago
    • 10
    Answer(0)
    Bids(1)