@VisibleForTesting
  void setTransMetaFileNaming( RepositoryDirectoryInterface repdir, String directory,
                                       DatabaseMeta sourceDbInfo, DatabaseMeta targetDbInfo, String[] tables, int i,
                                       TransMeta transMeta ) {
    String transname =
      BaseMessages.getString( PKG, "Spoon.RipDB.Monitor.Transname1" )
        + sourceDbInfo + "].[" + tables[i]
        + BaseMessages.getString( PKG, "Spoon.RipDB.Monitor.Transname2" ) + targetDbInfo + "]";

    if ( repdir != null ) {
      transMeta.setRepositoryDirectory( repdir );
      transMeta.setName( transname );
    } else {
      transMeta.setFilename( Const.createFilename( directory, transname, "."
        + Const.STRING_TRANS_DEFAULT_EXT ) );
    }
  }
@Test
  public void setTransMetaFileNamingWithoutRepTest() {
    RepositoryDirectoryInterface repDirMock = null;
    String directory = "directory";
    DatabaseMeta sourceDataBaseMetaMock = mock( DatabaseMeta.class );
    DatabaseMeta targetDataBaseMetaMock = mock( DatabaseMeta.class );
    String[] tables = { "table1", "table2", "table3" };
    int index = 1;
    TransMeta transMeta = new TransMeta();
    doCallRealMethod().when( delegate ).setTransMetaFileNaming( repDirMock, directory, sourceDataBaseMetaMock, targetDataBaseMetaMock, tables, index, transMeta );
    delegate.setTransMetaFileNaming( repDirMock, directory, sourceDataBaseMetaMock, targetDataBaseMetaMock, tables, index, transMeta );
    String transname =
      "copy ["
        + sourceDataBaseMetaMock + "].[" + "table2"
        + "] to [" + targetDataBaseMetaMock + "]";
    assertEquals( new RepositoryDirectory().getName(), transMeta.getRepositoryDirectory().getName() );
    assertNull( transMeta.getName() );
    assertEquals( Const.createFilename( directory, transname, "."
      + Const.STRING_TRANS_DEFAULT_EXT ), transMeta.getFilename() );
  }