Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

OutOfMemoryError during unit test Data class

 
Ronald Wouters
Ranch Hand
Posts: 190
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Ronald Wouters
Ranch Hand
Posts: 190
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ...
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic