You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@stratos.apache.org by Malintha Adikari <ma...@gmail.com> on 2014/03/21 11:03:34 UTC

Stratos Backend REST API test approach

Hi,

I am in the process of writing test case/cases to test stratos  REST API. I
can see some different approaches  to communicate with Stratos backend in a
test.

1. Pragmatically run Stratos CLI and execute CLI commands inside java ( We
can test Stratos CLI as send request through it)
2. Use HTTP client (curl client) to send requests
3. Re-use Stratos CLI client code to send requests.

What is your opinion about above approaches ? What is the best way to send
requests to the backend in test classes

Regards,
Malintha Adikari

Re: Stratos Backend REST API test approach

Posted by Malintha Adikari <ma...@gmail.com>.
Hi,


On Fri, Mar 21, 2014 at 5:49 PM, Isuru Perera <is...@wso2.com> wrote:

> Hi,
>
> What I meant was that we can focus on CLI after we test the Stratos
> components via the REST API :)
>

Yes Isuru.

>
> Thanks!
>
>
> On Fri, Mar 21, 2014 at 5:34 PM, Isuru Perera <is...@wso2.com> wrote:
>
>> Hi,
>>
>> Once you are done with REST API testing, we should also focus on CLI.
>> Then we can also make sure CLI works fine.
>>
>> Thanks!
>>
>>
>> On Fri, Mar 21, 2014 at 4:31 PM, Malintha Adikari <ma...@wso2.com>wrote:
>>
>>> Hi Nirmal,
>>>
>>> Yes, There are reasonable points go for REST API client. I will start
>>> working on tests using the existing client.
>>>
>>> Thank you for the prompt response.
>>>
>>> Regards,
>>> Malintha  Adikari
>>>
>>>
>>> On Fri, Mar 21, 2014 at 4:08 PM, Nirmal Fernando <nirmal070125@gmail.com
>>> > wrote:
>>>
>>>> Hi Malintha,
>>>>
>>>> IMO we should test Stratos via the REST API, not via the CLI. Cause;
>>>>
>>>> * CLI is again a client used for REST API and not all the operations
>>>> are executed via CLI
>>>> * CLI truncate/format responses.
>>>>
>>>> I recommend you to reuse the existing REST API clients used in Stratos.
>>>>
>>>> Thanks for bringing this up.
>>>>
>>>>
>>>> On Fri, Mar 21, 2014 at 3:33 PM, Malintha Adikari <
>>>> malintha.adikari@gmail.com> wrote:
>>>>
>>>>> Hi,
>>>>>
>>>>> I am in the process of writing test case/cases to test stratos  REST
>>>>> API. I can see some different approaches  to communicate with Stratos
>>>>> backend in a test.
>>>>>
>>>>> 1. Pragmatically run Stratos CLI and execute CLI commands inside java
>>>>> ( We can test Stratos CLI as send request through it)
>>>>> 2. Use HTTP client (curl client) to send requests
>>>>> 3. Re-use Stratos CLI client code to send requests.
>>>>>
>>>>> What is your opinion about above approaches ? What is the best way to
>>>>> send requests to the backend in test classes
>>>>>
>>>>> Regards,
>>>>> Malintha Adikari
>>>>>
>>>>
>>>>
>>>>
>>>> --
>>>> Best Regards,
>>>> Nirmal
>>>>
>>>> Nirmal Fernando.
>>>> PPMC Member & Committer of Apache Stratos,
>>>> Senior Software Engineer, WSO2 Inc.
>>>>
>>>> Blog: http://nirmalfdo.blogspot.com/
>>>>
>>>
>>>
>>>
>>> --
>>> *Malintha Adikari*
>>>  Software Engineer
>>> WSO2 Inc.; http://wso2.com
>>> lean.enterprise.middleware
>>>
>>> Mobile: +94 71 2312958
>>> Blog:    http://malinthas.blogspot.com
>>> Page:   http://about.me/malintha
>>>
>>
>>
>>
>> --
>> Isuru Perera
>> Senior Software Engineer | WSO2, Inc. | http://wso2.com/
>> Lean . Enterprise . Middleware
>>
>> about.me/chrishantha
>>
>
>
>
> --
> Isuru Perera
> Senior Software Engineer | WSO2, Inc. | http://wso2.com/
> Lean . Enterprise . Middleware
>
> about.me/chrishantha
>

Re: Stratos Backend REST API test approach

Posted by Isuru Perera <is...@wso2.com>.
Hi,

What I meant was that we can focus on CLI after we test the Stratos
components via the REST API :)

Thanks!


On Fri, Mar 21, 2014 at 5:34 PM, Isuru Perera <is...@wso2.com> wrote:

> Hi,
>
> Once you are done with REST API testing, we should also focus on CLI. Then
> we can also make sure CLI works fine.
>
> Thanks!
>
>
> On Fri, Mar 21, 2014 at 4:31 PM, Malintha Adikari <ma...@wso2.com>wrote:
>
>> Hi Nirmal,
>>
>> Yes, There are reasonable points go for REST API client. I will start
>> working on tests using the existing client.
>>
>> Thank you for the prompt response.
>>
>> Regards,
>> Malintha  Adikari
>>
>>
>> On Fri, Mar 21, 2014 at 4:08 PM, Nirmal Fernando <ni...@gmail.com>wrote:
>>
>>> Hi Malintha,
>>>
>>> IMO we should test Stratos via the REST API, not via the CLI. Cause;
>>>
>>> * CLI is again a client used for REST API and not all the operations are
>>> executed via CLI
>>> * CLI truncate/format responses.
>>>
>>> I recommend you to reuse the existing REST API clients used in Stratos.
>>>
>>> Thanks for bringing this up.
>>>
>>>
>>> On Fri, Mar 21, 2014 at 3:33 PM, Malintha Adikari <
>>> malintha.adikari@gmail.com> wrote:
>>>
>>>> Hi,
>>>>
>>>> I am in the process of writing test case/cases to test stratos  REST
>>>> API. I can see some different approaches  to communicate with Stratos
>>>> backend in a test.
>>>>
>>>> 1. Pragmatically run Stratos CLI and execute CLI commands inside java (
>>>> We can test Stratos CLI as send request through it)
>>>> 2. Use HTTP client (curl client) to send requests
>>>> 3. Re-use Stratos CLI client code to send requests.
>>>>
>>>> What is your opinion about above approaches ? What is the best way to
>>>> send requests to the backend in test classes
>>>>
>>>> Regards,
>>>> Malintha Adikari
>>>>
>>>
>>>
>>>
>>> --
>>> Best Regards,
>>> Nirmal
>>>
>>> Nirmal Fernando.
>>> PPMC Member & Committer of Apache Stratos,
>>> Senior Software Engineer, WSO2 Inc.
>>>
>>> Blog: http://nirmalfdo.blogspot.com/
>>>
>>
>>
>>
>> --
>> *Malintha Adikari*
>>  Software Engineer
>> WSO2 Inc.; http://wso2.com
>> lean.enterprise.middleware
>>
>> Mobile: +94 71 2312958
>> Blog:    http://malinthas.blogspot.com
>> Page:   http://about.me/malintha
>>
>
>
>
> --
> Isuru Perera
> Senior Software Engineer | WSO2, Inc. | http://wso2.com/
> Lean . Enterprise . Middleware
>
> about.me/chrishantha
>



-- 
Isuru Perera
Senior Software Engineer | WSO2, Inc. | http://wso2.com/
Lean . Enterprise . Middleware

about.me/chrishantha

Re: Stratos Backend REST API test approach

Posted by Isuru Perera <is...@wso2.com>.
Hi,

Once you are done with REST API testing, we should also focus on CLI. Then
we can also make sure CLI works fine.

Thanks!


On Fri, Mar 21, 2014 at 4:31 PM, Malintha Adikari <ma...@wso2.com> wrote:

> Hi Nirmal,
>
> Yes, There are reasonable points go for REST API client. I will start
> working on tests using the existing client.
>
> Thank you for the prompt response.
>
> Regards,
> Malintha  Adikari
>
>
> On Fri, Mar 21, 2014 at 4:08 PM, Nirmal Fernando <ni...@gmail.com>wrote:
>
>> Hi Malintha,
>>
>> IMO we should test Stratos via the REST API, not via the CLI. Cause;
>>
>> * CLI is again a client used for REST API and not all the operations are
>> executed via CLI
>> * CLI truncate/format responses.
>>
>> I recommend you to reuse the existing REST API clients used in Stratos.
>>
>> Thanks for bringing this up.
>>
>>
>> On Fri, Mar 21, 2014 at 3:33 PM, Malintha Adikari <
>> malintha.adikari@gmail.com> wrote:
>>
>>> Hi,
>>>
>>> I am in the process of writing test case/cases to test stratos  REST
>>> API. I can see some different approaches  to communicate with Stratos
>>> backend in a test.
>>>
>>> 1. Pragmatically run Stratos CLI and execute CLI commands inside java (
>>> We can test Stratos CLI as send request through it)
>>> 2. Use HTTP client (curl client) to send requests
>>> 3. Re-use Stratos CLI client code to send requests.
>>>
>>> What is your opinion about above approaches ? What is the best way to
>>> send requests to the backend in test classes
>>>
>>> Regards,
>>> Malintha Adikari
>>>
>>
>>
>>
>> --
>> Best Regards,
>> Nirmal
>>
>> Nirmal Fernando.
>> PPMC Member & Committer of Apache Stratos,
>> Senior Software Engineer, WSO2 Inc.
>>
>> Blog: http://nirmalfdo.blogspot.com/
>>
>
>
>
> --
> *Malintha Adikari*
>  Software Engineer
> WSO2 Inc.; http://wso2.com
> lean.enterprise.middleware
>
> Mobile: +94 71 2312958
> Blog:    http://malinthas.blogspot.com
> Page:   http://about.me/malintha
>



-- 
Isuru Perera
Senior Software Engineer | WSO2, Inc. | http://wso2.com/
Lean . Enterprise . Middleware

about.me/chrishantha

Re: Stratos Backend REST API test approach

Posted by Malintha Adikari <ma...@wso2.com>.
Hi Nirmal,

Yes, There are reasonable points go for REST API client. I will start
working on tests using the existing client.

Thank you for the prompt response.

Regards,
Malintha  Adikari


On Fri, Mar 21, 2014 at 4:08 PM, Nirmal Fernando <ni...@gmail.com>wrote:

> Hi Malintha,
>
> IMO we should test Stratos via the REST API, not via the CLI. Cause;
>
> * CLI is again a client used for REST API and not all the operations are
> executed via CLI
> * CLI truncate/format responses.
>
> I recommend you to reuse the existing REST API clients used in Stratos.
>
> Thanks for bringing this up.
>
>
> On Fri, Mar 21, 2014 at 3:33 PM, Malintha Adikari <
> malintha.adikari@gmail.com> wrote:
>
>> Hi,
>>
>> I am in the process of writing test case/cases to test stratos  REST API.
>> I can see some different approaches  to communicate with Stratos backend in
>> a test.
>>
>> 1. Pragmatically run Stratos CLI and execute CLI commands inside java (
>> We can test Stratos CLI as send request through it)
>> 2. Use HTTP client (curl client) to send requests
>> 3. Re-use Stratos CLI client code to send requests.
>>
>> What is your opinion about above approaches ? What is the best way to
>> send requests to the backend in test classes
>>
>> Regards,
>> Malintha Adikari
>>
>
>
>
> --
> Best Regards,
> Nirmal
>
> Nirmal Fernando.
> PPMC Member & Committer of Apache Stratos,
> Senior Software Engineer, WSO2 Inc.
>
> Blog: http://nirmalfdo.blogspot.com/
>



-- 
*Malintha Adikari*
 Software Engineer
WSO2 Inc.; http://wso2.com
lean.enterprise.middleware

Mobile: +94 71 2312958
Blog:    http://malinthas.blogspot.com
Page:   http://about.me/malintha

Re: Stratos Backend REST API test approach

Posted by Nirmal Fernando <ni...@gmail.com>.
Hi Malintha,

IMO we should test Stratos via the REST API, not via the CLI. Cause;

* CLI is again a client used for REST API and not all the operations are
executed via CLI
* CLI truncate/format responses.

I recommend you to reuse the existing REST API clients used in Stratos.

Thanks for bringing this up.


On Fri, Mar 21, 2014 at 3:33 PM, Malintha Adikari <
malintha.adikari@gmail.com> wrote:

> Hi,
>
> I am in the process of writing test case/cases to test stratos  REST API.
> I can see some different approaches  to communicate with Stratos backend in
> a test.
>
> 1. Pragmatically run Stratos CLI and execute CLI commands inside java ( We
> can test Stratos CLI as send request through it)
> 2. Use HTTP client (curl client) to send requests
> 3. Re-use Stratos CLI client code to send requests.
>
> What is your opinion about above approaches ? What is the best way to send
> requests to the backend in test classes
>
> Regards,
> Malintha Adikari
>



-- 
Best Regards,
Nirmal

Nirmal Fernando.
PPMC Member & Committer of Apache Stratos,
Senior Software Engineer, WSO2 Inc.

Blog: http://nirmalfdo.blogspot.com/