Hallo Benedikt > > No it isn't. As far as I know, your test will pass, when the first > NullPointerException is thrown (this also applies to @Rule > ExpectedException). If you have a method that takes two arguments that are > not nullable and you write: > > @Test(expected = NullPointerException.class) > public void testMyMethod(){ > // this will throw NPE > myObject.myMethod(null, someParam) > // test passes, because NPE was thrown, execution ends here > > // this will never be executed > myObject.myMethod(someParam, null) > }
mixing different behaviors inside test methods is IMHO not good, keep it simple and straightforward (but not stupid) as Christian suggested ;) -Simo http://people.apache.org/~simonetripodi/ http://simonetripodi.livejournal.com/ http://twitter.com/simonetripodi http://www.99soft.org/ --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org For additional commands, e-mail: dev-h...@commons.apache.org