Wednesday, September 21, 2011

Android Instrumentation, catch assertation error

Hello Everybody,

For a long time I have no single guess that it is possible to catch the error from the assertTrue(false) very simply.

Yep, it is possible. Saneesh Joseph has opened my eyes!

Sample snippet:

try {
assertTrue("Catch me if you can!", false);
} catch(Error er) {
Log.i(er.toString());
}

Thanks, Saneesh Joseph!

Happy testing, folk! (:

Best regards,
Yahor

0 comments:

Post a Comment