Hi all,
Currently, I’m working on the $subject which is an improvement of the project stated in following mail thread. The main idea of this unit testing framework is to execute test cases inside the synapse engine along with product-ei. The workflow of the unit testing framework is described in the following mail thread. Apart to that unit testing agent (inside the synapse engine in product-ei) now starts parallelly to the product-ei by the following command. *sh integrator.sh -unitTest <port>* When the agent starts, unit testing client can send artifact data and test case data to the unit test agent via TCP transport. As describes in following thread client reads artifact data using an XML file called descriptor which contains details of the artifact, test cases and mock services. Config modifier component inside the unit test client checks the mock services and replaces those mock services with actual services in synapse endpoints. And it creates relevant mock services and starts those. Unit test agent supports to deploy sequence, proxy and API artifacts inside the synapse engine and mediate test cases through deployments. Finally, unit test agent asserts the actual and expected payloads and property values to verify that test cases are correct or wrong. Here I have attached re-designed high-level architecture diagram of the project with this. I will use this thread to update further improvements of this $subject. Best Regards, ---------- Forwarded message --------- From: Hirushi Ekanayake <hiru...@wso2.com> Date: Fri, Jan 4, 2019 at 10:54 AM Subject: Re: [Architecture] [Intern Project] Unit Testing Framework for Synapse Configuration - High-level Architecture To: <architecture@wso2.org> Hi all, This is to disclose some of the changes that has been made to the initial architecture, which was described in the previous email. As described in the previous email, a XML descriptor file is parsed to the testing framework and a Java model for a test case is built according to the configurations defined in the descriptor file. Mock services creator is used to generate mock endpoints according to the definitions of mock services described in the descriptor file. Config modifier replaces the actual mock endpoints by these mock endpoints. Then these configurations are parsed to the unit testing framework agent which resides in the synapse engine, through TCP transport. Unit testing framework agent deploys the synapse artifacts referred in the descriptor to the synapse engine, build the message context and mediate the message context through deployed the synapse artifact. Mock endpoints are also get called when required. The envelope and the property values of the output message is asserted with the expected values defined in the descriptor file, at the end of the mediation process. Finally the assertion result is sent back to the client through the TCP transport. The re-designed high- level architecture diagram of the project is attached herewith. On Mon, Oct 29, 2018 at 9:08 PM Hirushi Ekanayake <hiru...@wso2.com> wrote: > Hi all, > > Apache Synapse is the core mediation engine of WSO2 ESB. Synapse > configuration language is used in WSO2 ESB to build integration scenarios. > > One of the major limitations we have in WSO2 ESB is, it doesn't provide a > built-in way to execute a unit test against a given synapse configuration > artifact (ex. A sequence). > > My project is about delivering a framework for executing unit tests for > Synapse artifacts. The process of the testing framework can be briefly > described as follows. > > A XML descriptor file which describe a test case is parsed to the testing > framework and a Java model for a test case is built according to the > configurations defined in the descriptor file. > > The test descriptor file consists of, > > - > > Inputs (payload, properties, etc.) > - > > Definitions of mock services > - > > Pointers to synapse artifacts > - > > Assertions > > > The input payload is taken from the descriptor file and message context is > populated with that. Synapse engine is started in background by the > framework and the synapse artifacts referred in the descriptor are deployed > to the engine. Then the generated message context is sent to this deployed > artifacts and it is mediated through the sequences and mock endpoints are > also get called when required. Finally the envelope and the property values > of the output message is asserted with the expected values defined in the > descriptor file. > > The high- level architecture diagram of the project is attached herewith. > > Regards, > Hirushi Ekanayake > Software Engineering Intern | WSO2 > > Email : hiru...@wso2.com > Mobile : +94767880119 > Web : http://wso2.com > > <http://wso2.com/signature> > -- Hirushi Ekanayake Software Engineering Intern | WSO2 Email : hiru...@wso2.com Mobile : +94767880119 Web : http://wso2.com <http://wso2.com/signature> _______________________________________________ Architecture mailing list Architecture@wso2.org https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture -- *Sajitha Liyanage | *Software Engineer | WSO2 Email : sajit...@wso2.com Mobile : +94 716849672 Web : http://wso2.com
_______________________________________________ Architecture mailing list Architecture@wso2.org https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture