This week's book giveaway is in the Cloud/Virtualizaton forum.
We're giving away four copies of Mesos in Action and have Roger Ignazio on-line!
See this thread for details.
Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How do I mock the JBoss 7 JTA transaction manager in JUnit?

Dave Alvarado
Ranch Hand
Posts: 436
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

I'm building a WAR using Spring 3.1.1.RELEASE, Hibernate 4.1.0.Final, JPA 2.0, and deploying to JBoss 7.1.1.Final. I'm noticing some errors that occur in my JBoss environment that don't occur in my unit tests and I want to eliminate a couple of factors. Is there a way to mock the JBoss transaction manager when running Spring JUnit tests? I use this application context when I deploy my application:

but in my JUnit environment, I use a different context:

I would like my tests to mirror as closely as possible what will happen when I deploy. Thanks, -
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic