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 <[email protected]> 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 > <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 [email protected] http://wso2.org/cgi-bin/mailman/listinfo/dev
