Announcement Announcement Module
Collapse
No announcement yet.
Hibernate Tests succeed in Eclipse but fail with Maven Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Hibernate Tests succeed in Eclipse but fail with Maven

    Hi,

    I've got some Spring/Hibernate Unit Tests which I have implemented by extending the AbstractTransactionalDataSourceSpringContextTests Class. Two of them run fine when I execute the Tests in eclipse, but they fail everytime i run them with maven/surefire.

    There are no error stacktraces, i get the following in the logs:

    Code:
    DEBUG [ 2007-06-21 17:57:48,062 ] at.detoxcare.core.util.StatisticsHelper.getHoursPM: 168  Getting KursTeilnahme Objects for Kurs Lernzentrum between Mon Jan 01 00:00:00 CET 2007 and Mon Dec 31 23:59:59 CET 2007
    DEBUG [ 2007-06-21 17:57:48,078 ] org.hibernate.jdbc.AbstractBatcher.log: 401  update Kurs set bereich=?, beschreibung=?, kursleiter=?, name=? where id=?
    DEBUG [ 2007-06-21 17:57:48,078 ] org.hibernate.jdbc.AbstractBatcher.log: 401  update Kurs set bereich=?, beschreibung=?, kursleiter=?, name=? where id=?
    INFO  [ 2007-06-21 17:57:48,078 ] org.springframework.test.AbstractTransactional springContextTests.endTransaction: 290  Rolled back transaction after test execution
    Seems that it tries to update something in the DB when it's supposed to read...

    Has anyone experienced something like that or has a clue how to fix it?

  • #2
    Originally posted by fewagewasd View Post
    Hi,

    I've got some Spring/Hibernate Unit Tests which I have implemented by extending the AbstractTransactionalDataSourceSpringContextTests Class. Two of them run fine when I execute the Tests in eclipse, but they fail everytime i run them with maven/surefire.

    There are no error stacktraces, i get the following in the logs:

    Code:
    DEBUG [ 2007-06-21 17:57:48,062 ] at.detoxcare.core.util.StatisticsHelper.getHoursPM: 168  Getting KursTeilnahme Objects for Kurs Lernzentrum between Mon Jan 01 00:00:00 CET 2007 and Mon Dec 31 23:59:59 CET 2007
    DEBUG [ 2007-06-21 17:57:48,078 ] org.hibernate.jdbc.AbstractBatcher.log: 401  update Kurs set bereich=?, beschreibung=?, kursleiter=?, name=? where id=?
    DEBUG [ 2007-06-21 17:57:48,078 ] org.hibernate.jdbc.AbstractBatcher.log: 401  update Kurs set bereich=?, beschreibung=?, kursleiter=?, name=? where id=?
    INFO  [ 2007-06-21 17:57:48,078 ] org.springframework.test.AbstractTransactional springContextTests.endTransaction: 290  Rolled back transaction after test execution
    Seems that it tries to update something in the DB when it's supposed to read...

    Has anyone experienced something like that or has a clue how to fix it?
    Are you making changes to the retrieved objects from the database?

    Comment


    • #3
      I would guess it might be useful to see the unit tests that cause the problem.
      Last edited by karldmoore; Aug 29th, 2007, 12:10 PM.

      Comment

      Working...
      X