webMethods 10.2 | Unit Test Framework | Test Suite Internals | Test Suite Internals
 
Test Suite Internals
In Software AG Designer, test suite editor provides a user interface to graphically and quickly develop test cases for Integration Server services. The test suite and the test cases are saved in an XML file. The Software AG Designer editor allows editing the XML source directly, provided that the user is aware of the format and the associated schema.
It is not recommended to edit the XML file as it is error-prone. It provides the option to automate the creation of test cases automatically by using code to generate the XML file directly. One such use case is the scenario where service inputs and outputs have been captured in an environment and test cases have to be generated to use these files for regression testing.
A sample XML test suite file in its simplified form can be as shown in the figure below:
<?xml version="1.0" encoding="UTF-8"?>
<webMethodsTestSuite description=
"Sample tests for the WmServiceMockSamples implementation" name="Sample Tests">
<webMethodsTestCase description=
"Duplicate Check Success with IData results" name="Duplicate Check Success With Results">
<mock folder="wmServiceMockSamples.data.services" name="getPotentialDuplicates">
<pipeline filename="resources/test/data/mockDupCheckOutputResults.xml"/>
</mock>
<service folder="wmServiceMockSamples.services" name="getDuplicateLoans">
<input>
<file filename="resources/test/data/dupCheckInput.xml"/>
</input>
<expected>
<file filename="resources/test/data/dupCheckSuccessWithResults.xml"/>
</expected>
</service>
</webMethodsTestCase>
<webMethodsTestCase description=
"Duplicate Check Failure handled by the catch block" name="Duplicate Check Catch Block">
<mock folder="wmServiceMockSamples.data.services" name="getPotentialDuplicates">
<exception class="java.lang.IllegalArgumentException" message="Bad argument"/>
</mock>
<service folder="wmServiceMockSamples.services" name="getDuplicateLoans">
<input>
<file filename="resources/test/data/dupCheckInput.xml"/>
</input>
<expected>
<exception class="java.lang.IllegalArgumentException" message="Bad argument"/>
</expected>
</service>
</webMethodsTestCase>
</webMethodsTestSuite>

Copyright © 2017-2018 | Software AG, Darmstadt, Germany and/or Software AG USA, Inc., Reston, VA, USA, and/or its subsidiaries and/or its affiliates and/or their licensors.
Innovation Release