Hi Sanjeewa, Currently we are not using a mechanism to proceed testing with auto generated clients. As I understand by the requirement this might subject to change API definition posted by the application with changes in the product level.
But as per the requirement I think it would be ideal if we can follow an approach to add both unit tests and integration tests for the scenario. Currently we are using simple CXF application to monitor API and Sample applications used by integration tests to verify its state of deployment. In this case we just deploy the webapp and invoke it inside test methods. Which is bit similar to what you are doing here. In this we deploy out cxf application in APIM itself. So in your case also we do not need additional application container to move on. As I see we can follow same approach we are doing with service stubs. In build time we can generate client using WADL -> Java or swagger -> java approach and use it inside tests. This will illuminate effort in redoing all tests while API definition is changed. Thank you, Dharshana. On Mon, Oct 19, 2015 at 12:15 PM, Joseph Fonseka <jos...@wso2.com> wrote: > Hi Sanjeewa > > Saneth & I had an offline chat regarding this last week there are few > things we need to consider. > > 1. Generating integration test for the Jax-RS functionality ex . If crud > operations work, if it returns correct error messages. > - We can use swagger-codegen to do this. > API Definition has all the details of the API interface what missing are > > 2. How to get the existing integration test to utilize the new API. > - We already have a lot of integration tests which uses existing > store & publisher APIs to add/remove resources. As Saneth mention they have > written it in a layered architecture this replacing the existing API layer > with Jax-rs existing test should work. > > > 3. How to make it easy to write test in the future with Jax-Rs API. > > > > > On Mon, Oct 19, 2015 at 11:39 AM, Sanjeewa Malalgoda <sanje...@wso2.com> > wrote: > >> Hi Team, >> We are planning to implement complete REST API for all operations >> available in API Manager. >> This will be CXF based jax-rs application. >> This application based on swagger template and service skeleton >> automatically generate according to swagger to cxf implementation done by >> Jo. >> We would like to know what would be the best approach to implement test >> for this service. >> Do we have any mechanism to generate client and test service in unit test >> level ? I can see there are projects to generate java client based on >> swagger content. >> Or do we need to write integration test to run this application in server >> and perform tests? >> Since this implementation changes rapidly it would be ideal if we can >> have skeleton based testing approach without binding to real >> implementation(like auto generated client). >> >> Have we done something similar? >> What would be the best approach? >> >> Thanks, >> sanjeewa. >> >> -- >> >> *Sanjeewa Malalgoda* >> WSO2 Inc. >> Mobile : +94713068779 >> >> <http://sanjeewamalalgoda.blogspot.com/>blog >> :http://sanjeewamalalgoda.blogspot.com/ >> <http://sanjeewamalalgoda.blogspot.com/> >> >> >> >> _______________________________________________ >> Dev mailing list >> Dev@wso2.org >> http://wso2.org/cgi-bin/mailman/listinfo/dev >> >> > > > -- > > -- > *Joseph Fonseka* > WSO2 Inc.; http://wso2.com > lean.enterprise.middleware > > mobile: +94 772 512 430 > skype: jpfonseka > > * <http://lk.linkedin.com/in/rumeshbandara>* > > -- Dharshana Warusavitharana Senior Software Engineer , Test Automation WSO2 Inc. http://wso2.com email : dharsha...@wso2.com <dharsha...@wso2.com> Tel : +94 11 214 5345 Fax :+94 11 2145300 cell : +94770342233 blog : http://dharshanaw.blogspot.com lean . enterprise . middleware
_______________________________________________ Dev mailing list Dev@wso2.org http://wso2.org/cgi-bin/mailman/listinfo/dev