// Set up the mock JNDI initial context
TestJNDIContext.initialize();
Context initCtx = new InitialContext();
initCtx.bind( "java:comp/env", new TestJNDIContext() );
Context ctx = (Context) initCtx.lookup( "java:comp/env" );
DataSource ds = new TestJDBCDataSource( new File( "build.properties" ) );
ctx.bind( JDBCUserDatabase.DEFAULT_DB_JNDI_NAME, ds );
// Get the JDBC connection and init tables
try
{
Connection conn = ds.getConnection();
Statement stmt = conn.createStatement();
String sql;
sql = "DELETE FROM " + JDBCUserDatabase.DEFAULT_DB_TABLE + ";";
stmt.executeUpdate( sql );