I'm a bit confused.
How can I get TestNG to report an error for a test?
// ...
@DataProvider(name = "foo")
public Object[][] provideData () {
throw new SomeRuntimeException("Some error occurred. The test configuration "
+ "is somehow incorrect.");
}
This will just lead to test skipping. The exception doesn't even get logged. Moving this to a constructor will just get the exception logged but that's not enough...
I want a big fat error message.
At the moment, using a dedicated (self) test method does the job which at leasts shows some test failure...
Anyway, it would be nice to know how testNG's definition of an error looks like.
Thank you for any hints!
try/catch
? – WhirlybirdDataProvider
is really counterintuitive. I've just wasted a couple of hours on this issue: I couldn't understand why my tests weren't running. However, your question and Roman's answer put me on the right track: it turns out an exception was being thrown from within myDataProvider
. Thanks to you both! – Trichina