jeudi 28 avril 2016

Writing test cases for wso2 ESB templates or endpoints file

I have to write test cases (Integration testing) to test each service or endpoints which has been integrated within a single Requestpayloadsequence file. Can any one please help me how to do the same to test each endpoints/templates separately.

Below is the payloadsequence file where we are calling many templates, which in turn call endpoints.xml file

abcPayloadSeq_v1.0.0.xml

 <?xml version="1.0" encoding="UTF-8"?>
    <sequence xmlns="http://ift.tt/IrJ6pr" name="abc_v1.0.0" onError="abc_v1.0.0">
        <property name="abc" expression="//abc" scope="default" type="STRING"/>
        <property name="xyz" expression="//xyz" scope="default" type="STRING"/>
        <property name="object1" expression="json-eval($.object1)" scope="default" type="STRING"/>
        <property name="object2" expression="json-eval($.object2)" scope="default" type="STRING"/>
        <property name="object3" expression="json-eval($.object3)" scope="default" type="STRING"/>
        <call-template target="abcTemplate_v1.0.0"/>
        <property name="object5" expression="$body/*" scope="default" type="STRING"/>
        <property name="object6" expression="//object6" scope="default" type="STRING"/>
        <call-template target="Test1123Template_v1.0.0">
            <with-param name="abc123" value="{get-property('abc123')}"/>
            <with-param name="abc456" value="abc456"/>
            <with-param name="abc789" value="abc789"/>
         </call-template>
          <call-template target="Test2Template_v1.0.0">
             <with-param name="xyz123" value="AP106532"/>
            <with-param name="xyz456" value="{get-property('abc456')}"/>
        </call-template>
        <loopback/>
    </sequence>

Test1123Template_v1.0.0.xml file

    <sequence key="GenericCaptureRequest_v1.0.1"/>
    <call-template target="GenericCallBackEndTemplate_v1.0.0">
        <with-param name="backendServiceName" value="abcProducerService"/>
        <with-param name="endpointRef" value="abcEndpoint_v1.0.0.xml"/>
    </call-template>
   <sequence key="GenericCaptureResponse_v1.0.1"/>
</sequence>

Aucun commentaire:

Enregistrer un commentaire