[Dev] [Integration Tests] What is the advantage of Exception being thrown in test methods instead of the specific subclass of it?

2015-09-07 Thread Manuri Amaya Perera
Hi,

I got to know it is recommended to throw Exception in test methods instead
of the specific sub class of it. But generally in methods the good practice
is to throw the exception of the specific sub class.

I'd like to know $subject.

Thank you.

-- 

*Manuri Amaya Perera*

*Software Engineer*

*WSO2 Inc.*

*Blog: http://manuriamayaperera.blogspot.com
*
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] [Integration Tests] What is the advantage of Exception being thrown in test methods instead of the specific subclass of it?

2015-09-07 Thread Nuwan Wimalasekara
Hi Manuri,

Even if we throws the sub classes in test methods , no one will handle
those exception explicitly. It is handled by TestNg and TestsNg marked them
error when exception is thrown from a test method and we can see the actual
exception class in test reports. Throwing super class also make sure that
the test method will not be broken even exception classes is changed in the
method which are used in test methods.

Please refer the mail thread "Best Practice in Throwing Exceptions in test
methods signature"@dev

Thanks,
Nuwanw

On Tue, Sep 8, 2015 at 11:05 AM, Manuri Amaya Perera 
wrote:

> Hi,
>
> I got to know it is recommended to throw Exception in test methods instead
> of the specific sub class of it. But generally in methods the good practice
> is to throw the exception of the specific sub class.
>
> I'd like to know $subject.
>
> Thank you.
>
> --
>
> *Manuri Amaya Perera*
>
> *Software Engineer*
>
> *WSO2 Inc.*
>
> *Blog: http://manuriamayaperera.blogspot.com
> *
>



-- 
Nuwan Wimalasekara
Senior Software Engineer - Test Automation
WSO2, Inc.: http://wso2.com
lean. enterprise. middleware

phone: +94 71 668 4620
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] [Integration Tests] What is the advantage of Exception being thrown in test methods instead of the specific subclass of it?

2015-09-07 Thread Rajeenthini Satkunam
Hi Manuri,

In my point of view The Exception is the super class of all subclass of
exceptions inherited. In case you know strongly which type of exception
could be thrown while execution it is better to use the exact instance of
sub class of exception rather than catching generic exception while the
execution


On Tue, Sep 8, 2015 at 11:24 AM, Nuwan Wimalasekara  wrote:

> Hi Manuri,
>
> Even if we throws the sub classes in test methods , no one will handle
> those exception explicitly. It is handled by TestNg and TestsNg marked them
> error when exception is thrown from a test method and we can see the actual
> exception class in test reports. Throwing super class also make sure that
> the test method will not be broken even exception classes is changed in the
> method which are used in test methods.
>
> Please refer the mail thread "Best Practice in Throwing Exceptions in test
> methods signature"@dev
>
> Thanks,
> Nuwanw
>
> On Tue, Sep 8, 2015 at 11:05 AM, Manuri Amaya Perera 
> wrote:
>
>> Hi,
>>
>> I got to know it is recommended to throw Exception in test methods
>> instead of the specific sub class of it. But generally in methods the good
>> practice is to throw the exception of the specific sub class.
>>
>> I'd like to know $subject.
>>
>> Thank you.
>>
>> --
>>
>> *Manuri Amaya Perera*
>>
>> *Software Engineer*
>>
>> *WSO2 Inc.*
>>
>> *Blog: http://manuriamayaperera.blogspot.com
>> *
>>
>
>
>
> --
> Nuwan Wimalasekara
> Senior Software Engineer - Test Automation
> WSO2, Inc.: http://wso2.com
> lean. enterprise. middleware
>
> phone: +94 71 668 4620
>
>
>
>
> ___
> Dev mailing list
> Dev@wso2.org
> http://wso2.org/cgi-bin/mailman/listinfo/dev
>
>


-- 

*Thank You.*

*Rajeenthini Satkunam*

*Associate Software Engineer | WSO2*


*E:rajeenth...@wso2.com *

*M :+94770832823   *
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] [Integration Tests] What is the advantage of Exception being thrown in test methods instead of the specific subclass of it?

2015-09-08 Thread Irham Iqbal
Hi Rajeenthini,

We don't catch any exception inside test methods we just throw the
Exception from it. Even though if you catch the exception and throw the
specific exception testng is the one going to handle this. If you see the
testng report you can see the stack trace of the exception where it occur.

Thanks,
Iqbal

On Tue, Sep 8, 2015 at 11:31 AM, Rajeenthini Satkunam 
wrote:

> Hi Manuri,
>
> In my point of view The Exception is the super class of all subclass of
> exceptions inherited. In case you know strongly which type of exception
> could be thrown while execution it is better to use the exact instance of
> sub class of exception rather than catching generic exception while the
> execution
>
>
> On Tue, Sep 8, 2015 at 11:24 AM, Nuwan Wimalasekara 
> wrote:
>
>> Hi Manuri,
>>
>> Even if we throws the sub classes in test methods , no one will handle
>> those exception explicitly. It is handled by TestNg and TestsNg marked them
>> error when exception is thrown from a test method and we can see the actual
>> exception class in test reports. Throwing super class also make sure that
>> the test method will not be broken even exception classes is changed in the
>> method which are used in test methods.
>>
>> Please refer the mail thread "Best Practice in Throwing Exceptions in
>> test methods signature"@dev
>>
>> Thanks,
>> Nuwanw
>>
>> On Tue, Sep 8, 2015 at 11:05 AM, Manuri Amaya Perera 
>> wrote:
>>
>>> Hi,
>>>
>>> I got to know it is recommended to throw Exception in test methods
>>> instead of the specific sub class of it. But generally in methods the good
>>> practice is to throw the exception of the specific sub class.
>>>
>>> I'd like to know $subject.
>>>
>>> Thank you.
>>>
>>> --
>>>
>>> *Manuri Amaya Perera*
>>>
>>> *Software Engineer*
>>>
>>> *WSO2 Inc.*
>>>
>>> *Blog: http://manuriamayaperera.blogspot.com
>>> *
>>>
>>
>>
>>
>> --
>> Nuwan Wimalasekara
>> Senior Software Engineer - Test Automation
>> WSO2, Inc.: http://wso2.com
>> lean. enterprise. middleware
>>
>> phone: +94 71 668 4620
>>
>>
>>
>>
>> ___
>> Dev mailing list
>> Dev@wso2.org
>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>
>>
>
>
> --
>
> *Thank You.*
>
> *Rajeenthini Satkunam*
>
> *Associate Software Engineer | WSO2*
>
>
> *E:rajeenth...@wso2.com *
>
> *M :+94770832823 <%2B94770832823>   *
>
>
> ___
> Dev mailing list
> Dev@wso2.org
> http://wso2.org/cgi-bin/mailman/listinfo/dev
>
>


-- 
Irham Iqbal
Software Engineer - Test Automation
WSO2, Inc.: http://wso2.com
lean. enterprise. middleware
phone: +94 777888452
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] [Integration Tests] What is the advantage of Exception being thrown in test methods instead of the specific subclass of it?

2015-09-08 Thread Rajeenthini Satkunam
Hi iqbal,

I got your point.

On Tue, Sep 8, 2015 at 1:32 PM, Irham Iqbal  wrote:

> Hi Rajeenthini,
>
> We don't catch any exception inside test methods we just throw the
> Exception from it. Even though if you catch the exception and throw the
> specific exception testng is the one going to handle this. If you see the
> testng report you can see the stack trace of the exception where it occur.
>
> Thanks,
> Iqbal
>
> On Tue, Sep 8, 2015 at 11:31 AM, Rajeenthini Satkunam <
> rajeenth...@wso2.com> wrote:
>
>> Hi Manuri,
>>
>> In my point of view The Exception is the super class of all subclass of
>> exceptions inherited. In case you know strongly which type of exception
>> could be thrown while execution it is better to use the exact instance of
>> sub class of exception rather than catching generic exception while the
>> execution
>>
>>
>> On Tue, Sep 8, 2015 at 11:24 AM, Nuwan Wimalasekara 
>> wrote:
>>
>>> Hi Manuri,
>>>
>>> Even if we throws the sub classes in test methods , no one will handle
>>> those exception explicitly. It is handled by TestNg and TestsNg marked them
>>> error when exception is thrown from a test method and we can see the actual
>>> exception class in test reports. Throwing super class also make sure that
>>> the test method will not be broken even exception classes is changed in the
>>> method which are used in test methods.
>>>
>>> Please refer the mail thread "Best Practice in Throwing Exceptions in
>>> test methods signature"@dev
>>>
>>> Thanks,
>>> Nuwanw
>>>
>>> On Tue, Sep 8, 2015 at 11:05 AM, Manuri Amaya Perera 
>>> wrote:
>>>
 Hi,

 I got to know it is recommended to throw Exception in test methods
 instead of the specific sub class of it. But generally in methods the good
 practice is to throw the exception of the specific sub class.

 I'd like to know $subject.

 Thank you.

 --

 *Manuri Amaya Perera*

 *Software Engineer*

 *WSO2 Inc.*

 *Blog: http://manuriamayaperera.blogspot.com
 *

>>>
>>>
>>>
>>> --
>>> Nuwan Wimalasekara
>>> Senior Software Engineer - Test Automation
>>> WSO2, Inc.: http://wso2.com
>>> lean. enterprise. middleware
>>>
>>> phone: +94 71 668 4620
>>>
>>>
>>>
>>>
>>> ___
>>> Dev mailing list
>>> Dev@wso2.org
>>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>>
>>>
>>
>>
>> --
>>
>> *Thank You.*
>>
>> *Rajeenthini Satkunam*
>>
>> *Associate Software Engineer | WSO2*
>>
>>
>> *E:rajeenth...@wso2.com *
>>
>> *M :+94770832823 <%2B94770832823>   *
>>
>>
>> ___
>> Dev mailing list
>> Dev@wso2.org
>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>
>>
>
>
> --
> Irham Iqbal
> Software Engineer - Test Automation
> WSO2, Inc.: http://wso2.com
> lean. enterprise. middleware
> phone: +94 777888452
>



-- 

*Thank You.*

*Rajeenthini Satkunam*

*Associate Software Engineer | WSO2*


*E:rajeenth...@wso2.com *

*M :+94770832823   *
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] [Integration Tests] What is the advantage of Exception being thrown in test methods instead of the specific subclass of it?

2015-09-08 Thread Manuri Amaya Perera
Hi Nuwan,

I was thinking that even though these exceptions are not explicitly
handled, throwing the specific exception will make the code more
understandable for someone who reads these test cases. Anyway the reasons
you mentioned seem to be more important.

Thank you.

On Tue, Sep 8, 2015 at 11:05 AM, Manuri Amaya Perera 
wrote:

> Hi,
>
> I got to know it is recommended to throw Exception in test methods instead
> of the specific sub class of it. But generally in methods the good practice
> is to throw the exception of the specific sub class.
>
> I'd like to know $subject.
>
> Thank you.
>
> --
>
> *Manuri Amaya Perera*
>
> *Software Engineer*
>
> *WSO2 Inc.*
>
> *Blog: http://manuriamayaperera.blogspot.com
> *
>



-- 

*Manuri Amaya Perera*

*Software Engineer*

*WSO2 Inc.*

*Blog: http://manuriamayaperera.blogspot.com
*
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev