tag:blogger.com,1999:blog-4110180.post7682469176846618855..comments2023-06-20T05:31:24.545-07:00Comments on Tapestry Central: A tip for TestNG: Keep the Constructor SimpleAnonymoushttp://www.blogger.com/profile/04486596490758986709noreply@blogger.comBlogger1125tag:blogger.com,1999:blog-4110180.post-87753677064939053492009-02-02T07:46:00.000-08:002009-02-02T07:46:00.000-08:00In general, I find it extremely dangerous, putting...In general, I find it extremely dangerous, putting setup logic in constructors. The semantics of it all are very fraught. I tend to use my constructors only to assign to final variables, and do any set up in a separately managed lifecycle, or on-demand later in the life of the component (though I prefer the former so I can validate everything before marshalling the component)<BR/><BR/>One way or another, I think that keeping the Constructor simple is a good piece of advice, period, not just for TestNG or Unit Testing in general.Anonymoushttps://www.blogger.com/profile/11149956661907218421noreply@blogger.com