Hi Janani,

The actual backend call happens at line [1]. So if you can mock that
backend call, then you should be fine.

The ProgramCallDocument is basically an PCML file(XML structure)
representing the inputs and outputs of a program in the AS400. Its only an
object. It does not make any backend calls.

See "Sample 1" [2] for an actually PCML document.

[1] -
https://github.com/jananithangavel/esb-connector-pcml/blob/master/src/main/java/org/wso2/carbon/connector/pcml/AS400CallProgram.java#L110
[2] -
https://docs.wso2.com/display/ESBCONNECTORS/Working+with+Call+Operation+in+AS400

Regards,
Hemika

Hemika Kodikara
WSO2 Inc.
lean . enterprise . middleware
http://wso2.com

Mobile : +94777688882

On Wed, Oct 11, 2017 at 11:42 AM, Janani Thangavel <[email protected]> wrote:

> Adding Hemika.
>
> Janani Thangavel
> Associate Software Engineer
> WSO2 Inc : http://wso2.org
> <http://www.google.com/url?q=http%3A%2F%2Fwso2.org&sa=D&sntz=1&usg=AFQjCNE_eTDfyl2ibPcq0hcXvRDNVuQmMg>
> Mobile       : +94771856427 <+94%2077%20185%206427>
>
> On Wed, Oct 11, 2017 at 11:40 AM, Janani Thangavel <[email protected]>
> wrote:
>
>> Hi All,
>>
>> Currently I'm working on the unit testing [1] for AS400 pcml connector. 
>> Inside
>> the pcml connector we are creating a instance for ProgramCallDocument
>> [2]. It calls actual back end Server. So, I'm trying to mock
>> that ProgramCallDocument as follow [3]. Even if I mock, It calls the actual
>> back end service and get the error as [4]. Am I doing anything wrong?
>> Please help me on this.
>>
>>
>> [1]https://github.com/wso2-extensions/esb-connector-pcml/pull/9
>> [2]https://github.com/jananithangavel/esb-connector-pcml/
>> blob/master/src/main/java/org/wso2/carbon/connector/pcml/AS4
>> 00CallProgram.java#L91
>> [3]https://github.com/jananithangavel/esb-connector-pcml/
>> blob/2f3f9585225750c6f009a039ef716a520ca2bdf3/src/test/java/
>> org/wso2/carbon/connector/pcml/test/unit/AS400CallProgra
>> mUnitTest.java#L79
>> [4]org.apache.synapse.SynapseException: Unable to connect to AS400
>> server: A parse error occurred.
>>
>> Thanks.
>>
>> Regards,
>> Janani Thangavel
>> Associate Software Engineer
>> WSO2 Inc : http://wso2.org
>> <http://www.google.com/url?q=http%3A%2F%2Fwso2.org&sa=D&sntz=1&usg=AFQjCNE_eTDfyl2ibPcq0hcXvRDNVuQmMg>
>> Mobile       : +94771856427 <+94%2077%20185%206427>
>>
>
>
_______________________________________________
Dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to