dcsimg
How Do I Make A Test fail, when a Exception is thrown
2 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Bjoern_Schmidt
Posted On:   Thursday, August 22, 2002 07:15 AM

Hi everyone!



We have many many Tests in our Projekt, and we've just figured out, that even if an exception is thrown while executing a test, the test is marked as passed.



The Question is:

How Do I make a Test Fail when an exception is thrown without try and catch the exception and make the Test Fail in the catch block????




Thank you very much for your help!!!


Björn

Re: How Do I Make A Test fail, when a Exception is thrown

Posted By:   Anonymous  
Posted On:   Thursday, August 22, 2002 11:33 PM

That is not what should happen. Normally an Exception thrown in a TestCase should mark that TestCase as Error.

Are you sure the Exception is not catched before it reaches the TestCase (by some error handler or something)? Or is the Exception thrown in another Thread?

What happens when you try the following?


public void testException() {
throw new RuntimeException();
}

Re: How Do I Make A Test fail, when a Exception is thrown

Posted By:   Jeanne_Boyarsky  
Posted On:   Thursday, August 22, 2002 05:57 PM

What's wrong with using a try/catch block?
About | Sitemap | Contact