### Question:
JdbcTemplateSqlExecutor implements SqlExecutor { public void execute( final String[] sql, final ExecutorCallback callback ) throws DataAccessException { Exception exceptionDuringExecute = null; DatabaseMeta dbMeta = connectionModel.getDatabaseMeta( ); String url = null; try { url = dbMeta.getURL( ); } catch ( KettleDatabaseException e ) { throw new DataAccessException( "DatabaseMeta problem", e ) { private static final long serialVersionUID = -3457360074729938909L; }; } SingleConnectionDataSource ds = new SingleConnectionDataSource( url, dbMeta.getUsername( ), dbMeta .getPassword( ), false ); ds.setDriverClassName( dbMeta.getDriverClass( ) ); final JdbcTemplate jt = new JdbcTemplate( ds ); DataSourceTransactionManager tsMan = new DataSourceTransactionManager( ds ); TransactionTemplate txTemplate = new TransactionTemplate( tsMan ); txTemplate.setPropagationBehavior( DefaultTransactionDefinition.PROPAGATION_REQUIRES_NEW ); final String[ ] noCommentSql = removeCommentsAndSemicolons( connectionModel.getSchema( ), sql ); try { txTemplate.execute( new TransactionCallbackWithoutResult( ) { public void doInTransactionWithoutResult( TransactionStatus status ) { jt.batchUpdate( noCommentSql ); } } ); } catch ( DataAccessException e ) { if ( logger.isErrorEnabled( ) ) { logger.error( "data access exception", e ); } exceptionDuringExecute = e; } callback.executionComplete( exceptionDuringExecute ); }  void setConnectionModel( ConnectionModel connectionModel ); String[] removeCommentsAndSemicolons( Schema schema, String[] sql ); String removeCommentsAndSemicolons( Schema schema, String sql ); void execute( final String[] sql, final ExecutorCallback callback );  }### Answer:
@Test public void testExecute() throws Exception { final DatabaseMeta dbMeta = context.mock(DatabaseMeta.class); context.checking(new Expectations() { { one(dbMeta).getName(); will(returnValue("")); one(dbMeta).getXML(); will(returnValue(null)); allowing(dbMeta).getURL(); will(returnValue("jdbc:hsqldb:mem:test")); one(dbMeta).getUsername(); will(returnValue("sa")); one(dbMeta).getPassword(); will(returnValue("")); one(dbMeta).getDriverClass(); will(returnValue("org.hsqldb.jdbcDriver")); } }); SchemaStub schemaStub = new SchemaStub(); schemaStub.setDialect(new DialectStub()); connectionModel.setSchema(schemaStub); exec.setConnectionModel(connectionModel); getConnectionModel().setDatabaseMeta(dbMeta); executionCompleteCalled = false; exec.execute(new String[]{"", ""}, new ExecutorCallback() { public void executionComplete(Exception e) { if (logger.isDebugEnabled()) { logger.debug("execution complete"); } executionCompleteCalled = true; } }); assertTrue("Execution complete not called.", executionCompleteCalled); }