Configure datasource to work with JBoss style lookups?

2008-09-29 Thread Mangan
Hi! I recentally started using OpenEJB for doing unit testing with JUnit. I've got it to work for everything I've tried so far but now I've run into some problems: When trying to unit test a method, that in a lower layer uses a database connection, I get an error.

Rollback transactions in unit testing

2008-09-29 Thread Glauber Ferreira
Hi all. I need to rollback transactions in order to revert all data modified (deleted, updated, created) by my tests. How can I do that in the test code listed in this link: http://openejb.apache.org/3.0/unit-testing-transactions.html Thanks in advance. -- Glauber Vinícius Ventura de Melo

Re: Rollback transactions in unit testing

2008-09-29 Thread Andreas Karalus
We are also using openejb for junit testing. In our tests we are using UserTransaction to control the test data. Maybe this approach might also work for you. Below is the basic code, the startup and shutdown of the container, as well as starting/stopping transaction could also be moved to a

Re: Configure datasource to work with JBoss style lookups?

2008-09-29 Thread Andreas Karalus
Hi, it looks like for me like you are having some jndi and classpath problems, take a look if you still have some jboss specific jndi.properties. java.naming.factory.url.pkgs org.jboss.naming:org.jnp.interfaces anyway I found a simple way to bind a datasource in jboss specific style(we are