JAL-3141 Reworked a lot of BackupFiles to allow the Customise Checkbox
[jalview.git] / test / jalview / io / BackupFilesTest.java
index 723279d..6b5fef6 100644 (file)
@@ -107,7 +107,7 @@ public class BackupFilesTest
     }
 
     // check 10 backup files
-    HashMap correctindexmap = new HashMap();
+    HashMap<Integer, String> correctindexmap = new HashMap<>();
     correctindexmap.put(1, "backupfilestestTemp.fa_BACKUPTEST-00000001");
     correctindexmap.put(2, "backupfilestestTemp.fa_BACKUPTEST-00000002");
     correctindexmap.put(3, "backupfilestestTemp.fa_BACKUPTEST-00000003");
@@ -118,7 +118,7 @@ public class BackupFilesTest
     correctindexmap.put(8, "backupfilestestTemp.fa_BACKUPTEST-00000008");
     correctindexmap.put(9, "backupfilestestTemp.fa_BACKUPTEST-00000009");
     correctindexmap.put(10, "backupfilestestTemp.fa_BACKUPTEST-00000010");
-    HashMap wrongindexmap = new HashMap();
+    HashMap<Integer, String> wrongindexmap = new HashMap<>();
     wrongindexmap.put(1, "backupfilestestTemp.fa_BACKUPTEST-1");
     wrongindexmap.put(2, "backupfilestestTemp.fa_BACKUPTEST-00000002");
     wrongindexmap.put(3, "backupfilestestTemp.fa_BACKUPTEST-00000003");
@@ -158,7 +158,7 @@ public class BackupFilesTest
 
     // check there are "rollMax" backup files and they are all saved correctly
     // check 10 backup files
-    HashMap correctindexmap = new HashMap();
+    HashMap<Integer, String> correctindexmap = new HashMap<>();
     correctindexmap.put(9, "backupfilestestTemp.fa_BACKUPTEST-00000009");
     correctindexmap.put(10, "backupfilestestTemp.fa_BACKUPTEST-00000010");
     int[] indexes2 = { 10 };
@@ -189,7 +189,7 @@ public class BackupFilesTest
 
     // check there are "rollMax" backup files and they are all saved correctly
     // check 10 backup files
-    HashMap correctindexmap = new HashMap();
+    HashMap<Integer, String> correctindexmap = new HashMap<>();
     correctindexmap.put(1, "backupfilestestTemp.fa_BACKUPTEST-00000001");
     correctindexmap.put(2, "backupfilestestTemp.fa_BACKUPTEST-00000002");
     int[] indexes2 = { 1 };
@@ -209,6 +209,14 @@ public class BackupFilesTest
   {
     Cache.loadProperties("test/jalview/io/testProps.jvprops");
 
+    BackupFilesPresetEntry bfpe = new BackupFilesPresetEntry(suffix, digits,
+            reverse, noMax, rollMax, false);
+
+    Cache.applicationProperties.setProperty(BackupFiles.ENABLED,
+            Boolean.toString(enabled));
+    Cache.applicationProperties.setProperty(
+            BackupFilesPresetEntry.SAVEDCONFIG, bfpe.toString());
+    /*
     Cache.applicationProperties.setProperty(BackupFiles.ENABLED,
             Boolean.toString(enabled));
     Cache.applicationProperties.setProperty(BackupFiles.SUFFIX, suffix);
@@ -222,6 +230,7 @@ public class BackupFilesTest
             Integer.toString(rollMax));
     Cache.applicationProperties.setProperty(BackupFiles.CONFIRM_DELETE_OLD,
             "false");
+            */
   }
 
   private void save()