I'm trying to use openejb for unit testing with dbunit, but having some
issues making it 'easy/clean' --

private Context ctx;
private String datasourceName = "jdbc/MyDS";

                public void setUp() throws Exception {
                Properties props = new Properties();
                props.setProperty(Context.INITIAL_CONTEXT_FACTORY,
                "org.apache.openejb.client.LocalInitialContextFactory");
                props.put(datasourceName, "new://Resource?type=DataSource");
                props.put(datasourceName + ".JtaManaged", "false"); 
                props.put(datasourceName + ".JdbcDriver", "org.h2.Driver");
                props.put(datasourceName + ".JdbcUrl","jdbc:h2:mem:testdb");
                ctx = new InitialContext(props);

    IDatabaseConnection connection = new
DatabaseDataSourceConnection((InitialContext) ctx, datasourceName);

                }

Unfortunately, when it tries to get the datasource connection for dbunit it
throws NameNotFound exceptions.

Is there an elegant way to resolve this?

openejb 3.1.1, dbunit 2.4.6

Thanks!
-D
-- 
View this message in context: 
http://old.nabble.com/dbunit-usage-tp26713592p26713592.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Reply via email to