K
Koos Pol
Hi,
Â
Background: I have an application which basically is (although very
complicated) a batch script. It will run unattend from cron. The nature of
intermittant problems is unimportant. The batch script fails or it leads to
a successful result. So it either works, or it doesn't. Due to the many
possible failure points I created a general ErrorHandler class which dumps
to log4j and then quits via System.exit(-1).
Â
Now I find that my JUnit tests (3.8.2) no longer work. As already read on
many forums, JUnit doesn't take care much for System.exit(). That's a real
bummer because now I have to implement a mucho cluttering and complicated
try/catch mechanism throughout the whole application which I don't need nor
care for.
Â
1. Does anyone know of a way to make JUnit not barf on the System.exit(-1)?
2. Is there a way to gracefully abort besides System.exit(), (which is far
from gracefully)?
Â
Thanks for any help.
Koos
Â
Background: I have an application which basically is (although very
complicated) a batch script. It will run unattend from cron. The nature of
intermittant problems is unimportant. The batch script fails or it leads to
a successful result. So it either works, or it doesn't. Due to the many
possible failure points I created a general ErrorHandler class which dumps
to log4j and then quits via System.exit(-1).
Â
Now I find that my JUnit tests (3.8.2) no longer work. As already read on
many forums, JUnit doesn't take care much for System.exit(). That's a real
bummer because now I have to implement a mucho cluttering and complicated
try/catch mechanism throughout the whole application which I don't need nor
care for.
Â
1. Does anyone know of a way to make JUnit not barf on the System.exit(-1)?
2. Is there a way to gracefully abort besides System.exit(), (which is far
from gracefully)?
Â
Thanks for any help.
Koos