From: Michal K. <mic...@gm...> - 2008-09-29 13:13:47
|
After writing a part of JUnitProperty I realized it wouldn't be so straightforward as it seemed to be. For example, JUnit has @Test(expected=...) annotation which shouldn't produce an error when expected exception occurs. Therefore the JUnitProperty should understand some of JUnit internals which is not very clean solution. I am thinking of inspecting JVM Path object (and maybe other information provided by Reporter) in JUnit's native peer but the path is always empty, why? MK Peter C. Mehlitz wrote: > this is the problem I was thinking of - if you run JUnit under JPF, > the JUnit exception firewall is a perfectly fine exception handler > from JPF's perspective, so NoUnhandledExceptionProperty is never > violated. You can't say JUnit is part of the SuT, but a little less > than the rest. Both vm.halt_on_throw and overriding > JVM.handleException() are hacks in this case. The only clean solution > I see is to create a new PropertyListener, say JUnitProperty, which > monitors exceptionThrown, and turns the ones underneath JUnit into > property violations > > -- Peter |