If you (like I), have googled all around trying to figure out this problem to no avail then perhaps my solution will work best for you. Everywhere I read said to simply increase the max memory size in your forked JUnit task however, even if that had worked it (which it didn’t) would seem more of a hack and a promotion of bad programming. If your mobile application kept having memory leaks would you simply add more memory to the device?

Finally I came to the conclusion that the tests weren’t the problem; it was the XML files that tests were producing. They were simply just too large for the junitreport task to handle. In my application, I was using JUnit to run many tests that for the most part relied on the database. This caused Hibernate to output tons of information to the system out which is then logged in the JUnit report XML. So, as you have already guessed, we have to prevent output from entering the XML or disable logging for hibernate.

Solution:

outputtoformatters=”false”

Share and Enjoy:
  • Digg
  • E-mail this story to a friend!
  • Reddit
  • del.icio.us
  • Facebook
  • Google
  • StumbleUpon
  • Technorati
  • LinkedIn
  • Slashdot