From 5e183aa333880dfe2bab2a383950042d722dc217 Mon Sep 17 00:00:00 2001 From: Ben Soares Date: Wed, 9 Jan 2019 18:29:05 +0000 Subject: [PATCH] JAL-3141 removed redundant method to tests --- src/jalview/io/BackupFiles.java | 9 --------- test/jalview/io/BackupFilesTest.java | 19 ++++++++++++++----- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/jalview/io/BackupFiles.java b/src/jalview/io/BackupFiles.java index 9209d72..3fc57fc 100644 --- a/src/jalview/io/BackupFiles.java +++ b/src/jalview/io/BackupFiles.java @@ -527,15 +527,6 @@ public class BackupFiles return bfTreeMap; } - public static File[] getBackupFiles(String fileName, String suffix, - int digits) - { - TreeMap bfTreeMap = getBackupFilesAsTreeMap(fileName, - suffix, digits); - File[] backupFiles = new File[bfTreeMap.size()]; - bfTreeMap.values().toArray(backupFiles); - return backupFiles; - } } diff --git a/test/jalview/io/BackupFilesTest.java b/test/jalview/io/BackupFilesTest.java index a78936e..ebdf26a 100644 --- a/test/jalview/io/BackupFilesTest.java +++ b/test/jalview/io/BackupFilesTest.java @@ -272,7 +272,7 @@ public class BackupFilesTest { newfile.delete(); } - File[] tmpFiles = BackupFiles.lsBackupFiles(newFile, suffix, digits); + File[] tmpFiles = getBackupFiles(newFile, suffix, digits); for (int i = 0; i < tmpFiles.length; i++) { if (actuallyDeleteTmpFiles) @@ -286,15 +286,24 @@ public class BackupFilesTest } } + private static File[] getBackupFiles(String f, String s, int i) + { + TreeMap bfTreeMap = BackupFiles.getBackupFilesAsTreeMap(f, + s, i); + File[] backupFiles = new File[bfTreeMap.size()]; + bfTreeMap.values().toArray(backupFiles); + return backupFiles; + } + private static File[] getBackupFiles() { - return BackupFiles.lsBackupFiles(newFile, suffix, digits); + return getBackupFiles(newFile, suffix, digits); } private static boolean checkBackupFiles(HashMap indexmap) throws IOException { - TreeMap map = BackupFiles.lsBackupFilesAsTreeMap(newFile, + TreeMap map = BackupFiles.getBackupFilesAsTreeMap(newFile, suffix, digits); Enumeration indexesenum = Collections .enumeration(indexmap.keySet()); @@ -332,7 +341,7 @@ public class BackupFilesTest private static boolean checkBackupFiles(int[] indexes) throws IOException { - TreeMap map = BackupFiles.lsBackupFilesAsTreeMap(newFile, + TreeMap map = BackupFiles.getBackupFilesAsTreeMap(newFile, suffix, digits); for (int m = 0; m < indexes.length; m++) { @@ -372,7 +381,7 @@ public class BackupFilesTest private static String[] getBackupFilesAsStrings() { - File[] files = BackupFiles.lsBackupFiles(newFile, suffix, digits); + File[] files = getBackupFiles(newFile, suffix, digits); String[] filenames = new String[files.length]; for (int i = 0; i < files.length; i++) { -- 1.7.10.2