Hi Hasitha, Normally for our soap and rest connectors, we will call the operations through ESB and verify the operation working fine or not. In that case, we will call API using Java code in the integration test and compare the both results in the test. In your case, if you are getting any results back from connector operation you can compare the results in the test. For example, if you add any messages in message-context after successful send operation you can compare whether the successful message exists or not in the message-context.
You can refer integration test for EJB[1] or JMS[1]. [1] https://github.com/wso2-extensions/esb-connector-ejb2.0/blob/master/src/test/java/org/wso2/carbon/connector/integration/test/ejb2/Ejb2ConnectorIntegrationTest.java [2] https://github.com/wso2-extensions/esb-connector-jms/blob/master/src/test/java/org/wso2/carbon/connector/integration/test/jms/JMSIntegrationTest.java On Wed, Aug 2, 2017 at 6:51 AM, Hasitha Jayasundara < [email protected]> wrote: > Hi Rajjaz, > > In your blog [1] it says"connector integration test do is it will sent > the request through the ESB and send request to API directly and compare > both results". > > 1.What is meant by "sent request to API directly and compare both results > "? > > What IBM MQ connector does is get the payload from MessageContext and > place it on the MQ message queue.So I have a proxy configuration as follows. > > <?xml version="1.0" encoding="UTF-8"?> > <proxy xmlns="http://ws.apache.org/ns/synapse" > name="ibmmqtest" > startOnLoad="true" > statistics="disable" > trace="disable" > transports="http,https"> > <target> > <inSequence> > <ibmmq.init> > <username>mqm</username> > <password>upgs5423</password> > <port>1414</port> > <host>127.0.0.1</host> > <qmanager>qmanager</qmanager> > <queue>myqueue</queue> > <reconnectTimeout>10000</reconnectTimeout> > <messageType>MQMT_DATAGRAM</messageType> > <islistenerEnabled>true</islistenerEnabled> > <channel>PASSWORD.SVRCONN</channel> > <messageID>MessageID@IBMMQ1234</messageID> > <correlationID>CorrelationID@IBMMQ1234</correlationID> > <transportType>1</transportType> > <timeOut>360000</timeOut> > <replyTimeout>5</replyTimeout> > <sslEnable>false</sslEnable> > </ibmmq.init> > <ibmmq.queue/> > </inSequence> > </target> > <description/> > </proxy> > > The operation can be explained as follows. > > When i send a request to this proxy with a payload , using the > <ibmmq.init> parameters it creates a connection with the queue manger(in > IBM websphere MQ) "<qmanager>qmanager</qmanager>". > > After I invoke the "<ibmmq.queue/>" it places the message in the IBM MQ > queue specified at " <queue>myqueue</queue>" > > So according to my knowledge what I need to in the integration test is to, > write a sample json/xml (SampleRequest.json) and test it with > the sampleProxy.xml. > > Is this correct? or could you please guide me on writing integration test > for above scenario? > > [1].http://rajjazhm.blogspot.com/2015/11/WSO2-ESB- > Connector-Integration-Tes.html > > -- > *D.M.Hasitha Nadishan Jayasundara* > *Department of Electronic and Telecommunication Engineering* > University of Moratuwa > *mobile:* *+94711959266 <+94%2071%20195%209266>* > *blogspot*: learnjavawithisla.blogspot.com/ *email:* hasithajayasundar > [email protected] > <https://www.facebook.com/hasitha.nadishan.3> > <https://twitter.com/HNadishan> > <https://lk.linkedin.com/in/hasithajayasundara> > -- Thank you Best Regards *Rajjaz HM* Software Engineer Platform Extension Team WSO2 Inc. <http://wso2.com/> lean | enterprise | middleware Mobile | +94752833834|+94777226874 Email | [email protected] LinkedIn <https://lk.linkedin.com/in/hmohammedrajjaz> | Blogger <http://rajjazhm.blogspot.com/> | WSO2 Profile <http://wso2.com/about/team/mohammer-rajjaz/> [image: https://wso2.com/signature] <https://wso2.com/signature>
_______________________________________________ Dev mailing list [email protected] http://wso2.org/cgi-bin/mailman/listinfo/dev
