File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JBoss/WildFly and the fly likes How do I mock the JBoss 7 JTA transaction manager in JUnit? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » JBoss/WildFly
Bookmark "How do I mock the JBoss 7 JTA transaction manager in JUnit?" Watch "How do I mock the JBoss 7 JTA transaction manager in JUnit?" New topic
Author

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

Dave Alvarado
Ranch Hand

Joined: Jul 02, 2008
Posts: 436
Hi,

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, -
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: How do I mock the JBoss 7 JTA transaction manager in JUnit?