aspose file tools*
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes OutOfMemoryError during unit test Data class Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "OutOfMemoryError during unit test Data class" Watch "OutOfMemoryError during unit test Data class" New topic
Author

OutOfMemoryError during unit test Data class

Ronald Wouters
Ranch Hand

Joined: Apr 28, 2005
Posts: 190
Hi all,

in the update method of my data class I have something like this:



Here is the strange part:

If I run a JUnit test for my Data.update method, that causes the OutOfMemoryError. If, on the other hand, I simply put in a main method in my Data class and test the update method from there, everything works as it should. By that I mean throwing the exception does NOT cause an OutOfMemoryError.
Could this mean JUnit doesn't handle chained exceptions very well ?
There goes unit testing down the drain

My environment:
OS : Red Hat Enterprise Linux WS release 4 (Nahant Update 1), 2.6.9-11.EL
JDK : 1.5.0_04
JUnit: 3.8.1



Sun Certified Developer for the Java 2 Platform
Sun Certified Enterprise Architect for the Java Platform, Enterprise Edition 5
Ronald Wouters
Ranch Hand

Joined: Apr 28, 2005
Posts: 190
Already found the problem myself:

a nice infinite loop in my unit test itself (forgot to call getCause to get the next cause of the throwable)
feeling a little stupid here ...
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: OutOfMemoryError during unit test Data class