### Question:
RunningJobs { public Job runJobFromFileSystem( String filename ) { try { System.out.println( "***************************************************************************************" ); System.out.println( "Attempting to run job " + filename + " from file system" ); System.out.println( "***************************************************************************************\n" ); JobMeta jobMeta = new JobMeta( filename, null ); System.out.println( "Attempting to read and set named parameters" ); String[] declaredParameters = jobMeta.listParameters(); for ( int i = 0; i < declaredParameters.length; i++ ) { String parameterName = declaredParameters[i]; String description = jobMeta.getParameterDescription( parameterName ); String defaultValue = jobMeta.getParameterDefault( parameterName ); String parameterValue = RandomStringUtils.randomAlphanumeric( 10 ); String output = String.format( "Setting parameter %s to \"%s\" [description: \"%s\", default: \"%s\"]", parameterName, parameterValue, description, defaultValue ); System.out.println( output ); jobMeta.setParameterValue( parameterName, parameterValue ); } Job job = new Job( null, jobMeta ); job.setLogLevel( LogLevel.MINIMAL ); System.out.println( "\nStarting job" ); job.start(); job.waitUntilFinished(); Result result = job.getResult(); String outcome = String.format( "\nJob %s executed with result: %s and %d errors\n", filename, result.getResult(), result.getNrErrors() ); System.out.println( outcome ); return job; } catch ( Exception e ) { e.printStackTrace(); return null; } }  static void main( String[] args ); Job runJobFromFileSystem( String filename ); Job runJobFromRepository( String repositoryName, String directory, String jobName, String username, String password ); static RunningJobs instance; }### Answer:
@Test public void testRunningTransformations() throws KettleException { RunningJobs instance = new RunningJobs(); Job j = instance.runJobFromFileSystem( "etl/parameterized_job.kjb" ); for ( int i = 0; i < 20; i++ ) { if ( j.getStatus().equals( "Finished" ) ) { break; } try { Thread.sleep( 100 ); } catch ( InterruptedException e ) { } } assertEquals( "Finished", j.getStatus() ); assertEquals( 0, j.getResult().getNrErrors() ); assertTrue( j.getResult().getResult() ); }