From: Stefan F. <ste...@we...> - 2011-11-25 10:54:21
|
> Which brings me on the subject that JUnit testing does not always seem to > report "Load interrupted" cases. > Yesterday night, the tests were OK, but this morning they showed failures. > It's probably my ineptitude with JUnit, but it seems that interrupted loads > sometimes can pass undetected. > I tried to fix that by adding a report line at that point (GameFileIO line > 227), but I haven't yet seen any impact of that change on the JUnit testing > result. Erik: Most likely you should not blame JUnit but my implementation/usage of JUnit instead. JUnit in general reports uncatched exceptions (category "errors") and those cases that are defined failures of the test case (category "failures"). For the test games we define failed games as those for which the stored report differs from the current game report. As long as there is no difference between those the test case passed. Currently load interruptions are catched exceptions of the GameLoad class, thus a load interruption alone does not raise an error. If the first run which defines the stored report had the same load interruption, the test reports are identical, thus no failure is correctly reported by JUnit. So you should check first if you test case runs correctly first and only then add it to the suite of test games. Otherwise it is garbage in, garbage out. And if you think about it, for some cases it might make sense: Suppose you want to check that in some cases the load interruption should be raised. Then you are able to add those games too and this behavior is testable too. This is a general principle of testing: Not only should you test if in correct setups the correct behavior occurs, but also that illegal setups get handled gracefully. So in short: For me it seems the correct behavior. The only help that could be possible is to raise a warning, if a report should be stored after a load interruption. Stefan > > I have also added an action count to the LoadInterrupted message, to > facilitate debugging such problems. > > Erik. > > > --------------------------------------------------------------------------- > --- All the data continuously generated in your IT infrastructure > contains a definitive record of customers, application performance, > security threats, fraudulent activity, and more. Splunk takes this > data and makes sense of it. IT sense. And common sense. > http://p.sf.net/sfu/splunk-novd2d > _______________________________________________ > Rails-devel mailing list > Rai...@li... > https://lists.sourceforge.net/lists/listinfo/rails-devel |