### Question:
GeneratingJobs { public JobMeta generateJob() { try { System.out.println( "Generating a job definition" ); JobMeta jobMeta = new JobMeta(); jobMeta.setName( "Generated Demo Job" ); System.out.println( "- Adding Start Entry" ); JobEntrySpecial start = new JobEntrySpecial(); start.setName( "START" ); start.setStart( true ); JobEntryCopy startEntry = new JobEntryCopy( start ); startEntry.setDrawn( true ); startEntry.setLocation( 100, 100 ); jobMeta.addJobEntry( startEntry ); System.out.println( "- Adding Write To Log Entry" ); JobEntryWriteToLog writeToLog = new JobEntryWriteToLog(); writeToLog.setName( "Output PDI Stats" ); writeToLog.setLogLevel( LogLevel.MINIMAL ); writeToLog.setLogSubject( "Logging PDI Build Information:" ); writeToLog.setLogMessage( "Version: ${Internal.Kettle.Version}\n" + "Build Date: ${Internal.Kettle.Build.Date}" ); JobEntryCopy writeToLogEntry = new JobEntryCopy( writeToLog ); writeToLogEntry.setDrawn( true ); writeToLogEntry.setLocation( 200, 100 ); jobMeta.addJobEntry( writeToLogEntry ); jobMeta.addJobHop( new JobHopMeta( startEntry, writeToLogEntry ) ); System.out.println( "- Adding Success Entry" ); JobEntrySuccess success = new JobEntrySuccess(); success.setName( "Success" ); JobEntryCopy successEntry = new JobEntryCopy( success ); successEntry.setDrawn( true ); successEntry.setLocation( 400, 100 ); jobMeta.addJobEntry( successEntry ); JobHopMeta greenHop = new JobHopMeta( writeToLogEntry, successEntry ); greenHop.setEvaluation( true ); jobMeta.addJobHop( greenHop ); System.out.println( "- Adding Abort Entry" ); JobEntryAbort abort = new JobEntryAbort(); abort.setName( "Abort Job" ); JobEntryCopy abortEntry = new JobEntryCopy( abort ); abortEntry.setDrawn( true ); abortEntry.setLocation( 400, 300 ); jobMeta.addJobEntry( abortEntry ); JobHopMeta redHop = new JobHopMeta( writeToLogEntry, abortEntry ); redHop.setEvaluation( false ); jobMeta.addJobHop( redHop ); return jobMeta; } catch ( Exception e ) { e.printStackTrace(); return null; } }  static void main( String[] args ); JobMeta generateJob(); static GeneratingJobs instance; }### Answer:
@Test public void testGeneratedJob() throws KettleException{ GeneratingJobs instance = new GeneratingJobs(); JobMeta jobMeta = instance.generateJob(); assertEquals(jobMeta.getName(), "Generated Demo Job"); assertEquals(jobMeta.getJobCopies().size(), 4); }