+ // save with no numbers in the backup file names
+ @Test(groups = { "Functional" })
+ public void backupsEnabledSingleFileBackupTest() throws Exception
+ {
+ // Enable BackupFiles and set noMax so all backupfiles get kept
+ String mysuffix = "~";
+ BackupFilesPresetEntry bfpe = new BackupFilesPresetEntry(mysuffix, 1,
+ false, true, 1, false);
+ setBackupFilesOptions(true, false, true,
+ "test/jalview/io/testProps_singlefilebackup.jvprops", bfpe);
+
+ // init the newFile and backups (i.e. make sure newFile exists on its own
+ // and has no backups)
+ initNewFileForTesting();
+ HashMap<Integer, String> correctindexmap = new HashMap<>();
+ correctindexmap.put(0, "backupfilestestTemp.fa~");
+
+ save();
+ Assert.assertTrue(checkBackupFiles(correctindexmap, newFile, "~", 1));
+
+ // and a second time -- see JAL-3628
+ save();
+ Assert.assertTrue(checkBackupFiles(correctindexmap, newFile, "~", 1));
+
+ cleanupTmpFiles(newFile, "~", 1);
+ }
+