Thursday, 5 September 2013

Debugging JUnit Tests in a Hibernate driven Spring Application

Debugging JUnit Tests in a Hibernate driven Spring Application

Maybe this has been answered already, but i did not find any suggestions
out there... My Project is a Spring Utility Project, the database i use is
MySQL and for persistence i´m using Hibernate in combination with c3p0
connection pooling. i´m on spring 3.2 and hibernate 3.5. So here is what i
want to do: I want to debug a JUnit test, step over some persistence
functions (save, update, etc. ) and then check the entries manually in the
database via SQL. Because of the JUnit tests always running in a
transaction, i cannot check the entries in the database, because a
rollback happens every time a test finished / a commit never occurs.
Is there a way to fake transaction existence, or bypassing them during
JUnit tests?

No comments:

Post a Comment