protected TransMeta processLinkedJobs( TransMeta transMeta ) {
    for ( StepMeta stepMeta : transMeta.getSteps() ) {
      if ( stepMeta.getStepID().equalsIgnoreCase( "JobExecutor" ) ) {
        JobExecutorMeta jem = (JobExecutorMeta) stepMeta.getStepMetaInterface();
        ObjectLocationSpecificationMethod specMethod = jem.getSpecificationMethod();
        // If the reference is by filename, change it to Repository By Name. Otherwise it's fine so leave it alone
        if ( specMethod == ObjectLocationSpecificationMethod.FILENAME ) {
          jem.setSpecificationMethod( ObjectLocationSpecificationMethod.REPOSITORY_BY_NAME );
          String filename = jem.getFileName();
          String jobname = filename.substring( filename.lastIndexOf( "/" ) + 1, filename.lastIndexOf( '.' ) );
          String directory = filename.substring( 0, filename.lastIndexOf( "/" ) );
          jem.setJobName( jobname );
          jem.setDirectoryPath( directory );
        }
      }
    }
    return transMeta;
  }
@Test
  public void testProcessLinkedJobsWithNoFilename() {
    JobExecutorMeta jobExecutorMeta = spy( new JobExecutorMeta() );
    jobExecutorMeta.setFileName( null );
    jobExecutorMeta.setDirectoryPath( "/path/to" );
    jobExecutorMeta.setJobName( "Job1" );
    jobExecutorMeta.setSpecificationMethod( ObjectLocationSpecificationMethod.REPOSITORY_BY_NAME );
    StepMeta transExecutorStep = mock( StepMeta.class );
    when( transExecutorStep.getStepID() ).thenReturn( "JobExecutor" );
    when( transExecutorStep.getStepMetaInterface() ).thenReturn( jobExecutorMeta );

    TransMeta parent = mock( TransMeta.class );
    when( parent.getSteps() ).thenReturn( Arrays.asList( transExecutorStep ) );

    TransMeta result = transFileListener.processLinkedJobs( parent );

    boolean found = false;
    for ( StepMeta stepMeta : result.getSteps() ) {
      if ( stepMeta.getStepID().equalsIgnoreCase( "JobExecutor" ) ) {
        found = true;
        JobExecutorMeta resultExecMeta = (JobExecutorMeta) stepMeta.getStepMetaInterface();
        assertEquals( ObjectLocationSpecificationMethod.REPOSITORY_BY_NAME, resultExecMeta.getSpecificationMethod() );
        assertEquals( resultExecMeta.getDirectoryPath(), "/path/to" );
        assertEquals( resultExecMeta.getJobName(), "Job1" );
      }
    }
    assertTrue( found );
  }