[P-unit-devel] Nesting of Junit4 @BeforeClass and similar
Status: Beta
Brought to you by:
zhanghuangzhu
|
From: Chris W. <ch...@cj...> - 2008-05-21 15:04:06
|
Hi, I have just started using P-Unit for performance testing in a project and come across a couple of problems. One, which I reported on your bugs page, is that the extensions delivered on your website are not compiled with java 1.5, but 1.6 - as opposed to the main p-unit code. The second is that in Junit4 it is possible to nest @BeforeClass (etc) calls so super classes get their @BeforeClass methods called before the subclass. I have been using that feature in my JUnit tests and needed it in my P-Unit tests so I have implemented that and have a couple of questions. Firstly this obviously breaks being able to directly use the setup or @BeforeClass methods interchangably - its no-longer obvious what to do. I have currently implemented it to ignore the setup method altogether, but I guess the right solution is probably to ignore it if there are any contradictory annotations? Secondly I have altered the convention class to return Method[] for the four method classes - I think this is the right solution, but it makes the ByNameConvention a bit clunky, returning single element arrays and the like. Any thoughts on these? For more information of how JUnit 4 treats these cases see: http://www.devx.com/Java/Article/31983/0/page/3 I have, as I say, written this code. I just need to clean it up a bit and re-implement the setup bits and I can either mail it here for your opinions or check it in - either would be fine for me, just let me know. Cheers, Chris Wilson |