Results 1 to 3 of 3

Thread: Hibernate Tests succeed in Eclipse but fail with Maven

  1. #1
    Join Date
    Jun 2007
    Posts
    1

    Default 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. #2
    Join Date
    Mar 2005
    Posts
    135

    Default

    Quote 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?

  3. #3
    Join Date
    Sep 2006
    Location
    UK
    Posts
    8,424

    Default

    I would guess it might be useful to see the unit tests that cause the problem.
    Last edited by karldmoore; Aug 29th, 2007 at 12:10 PM.
    Barracuda Networks SSL VPN Lead Developer
    http://pramatr.wordpress.com
    http://twitter.com/karldmoore
    http://www.linkedin.com/in/karldmoore
    Any postings are my own opinion, and should not be attributed to my employer or clients.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •