StatsDatabaseCheck implements IPentahoSystemListener { protected boolean executeJob( JobMeta jobMeta, String jobFileFullPath ) { if ( jobMeta != null ) { Job job = new Job( null, jobMeta ); Result result = new Result(); try { job.execute( 0, result ); job.waitUntilFinished(); } catch ( KettleException ke ) { Logger.error( "Error executing " + jobFileFullPath, ke.getMessage() ); return false; } } return true; }  boolean startup( final IPentahoSession session ); void shutdown(); String getJobFileName(); void setJobFileName( String jobFileName );  }
@Test public void testExecuteJob() throws Exception { JobMeta jobMeta = mock( JobMeta.class ); String filePath = TestResourceLocation.TEST_RESOURCES + "/FileOutputResourceTest/system/HelloWorld.kjb"; when( jobMeta.getFilename() ).thenReturn( filePath ); boolean executeJob = statsDatabaseCheck.executeJob( jobMeta, filePath ); assertFalse( executeJob ); }