protected TransMeta processLinkedTrans( TransMeta transMeta ) {
    for ( StepMeta stepMeta : transMeta.getSteps() ) {
      if ( stepMeta.getStepID().equalsIgnoreCase( "TransExecutor" ) ) {
        TransExecutorMeta tem = (TransExecutorMeta) stepMeta.getStepMetaInterface();
        ObjectLocationSpecificationMethod specMethod = tem.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 ) {
          tem.setSpecificationMethod( ObjectLocationSpecificationMethod.REPOSITORY_BY_NAME );
          String filename = tem.getFileName();
          String jobname = filename.substring( filename.lastIndexOf( "/" ) + 1, filename.lastIndexOf( '.' ) );
          String directory = filename.substring( 0, filename.lastIndexOf( "/" ) );
          tem.setTransName( jobname );
          tem.setDirectoryPath( directory );
        }
      }
    }
    return transMeta;
  }
@Test
  public void testProcessLinkedTransWithNoFilename() {
    TransExecutorMeta transExecutorMeta = spy( new TransExecutorMeta() );
    transExecutorMeta.setFileName( null );
    transExecutorMeta.setDirectoryPath( "/path/to" );
    transExecutorMeta.setTransName( "Transformation2" );
    transExecutorMeta.setSpecificationMethod( ObjectLocationSpecificationMethod.REPOSITORY_BY_NAME );
    StepMeta transExecutorStep = mock( StepMeta.class );
    when( transExecutorStep.getStepID() ).thenReturn( "TransExecutor" );
    when( transExecutorStep.getStepMetaInterface() ).thenReturn( transExecutorMeta );

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

    TransMeta result = transFileListener.processLinkedTrans( parent );

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