3 Replies Latest reply on May 17, 2013 12:48 PM by 999231

    Asserts in Test framework


      version -

      I have a simple BPEL(empty), which reads a file(FileAdapter) and using transformation activity (XSLT) I map the source schema to a target schema and finally I insert the record to a DB using DBAdapter. I'm trying to use soa test framework in which I gave the input/initiate message and after transformation I'm using 'asserts' to compare the input xml with the output file. Inside the transform activity I use sequence-nextval xslt function to generate unique ID for a particular field. Each time the BPEL runs it generates a unique ID. In this case, my asserts fail bcaz of this unique ID generated each time. In asserts, can I exclude certain field so that my test case execution would be successful.
      I'll explain the above process with a simple example.

      1. A file is a xml file which contains <ename>xyz</ename><deptId>900</deptId>
      2. BPEL reads the above file. My target DB has a table 'Employee' which has fields EmployeeId, EmployeeName and DeptID.
      3. In the transformation, I map ename --> EmployeeName , deptId --> DeptID. For EmployeeId, I use sequence=nextval xslt function to generate unique ID.
      4. The above step is one test case. In the asserts I keep the baseline file with the above output. for ex: the output of the xslt file for this test case will be <EmployeeId>100</EmployeeId><EmployeeName >xyz</EmployeeName> <DeptID>900</DeptID>. If create a test suite for this above scenario, the comparison xml failed and generate a report that <EmployeeId> mismatch with the actual output bcaz each time the sequence function generates unique ID. Now the challenge for me is, can I exclude <EmployeeId> field for comparison and compare other two fields? or is there any way I can successfully execute this test case? Any suggestion is much appreciated.