JAL-3703 patch Windows save file test for 2.11.1 codebase patch/r2_11_1_branch_JAL-3703_closing_files
authorJim Procter <j.procter@dundee.ac.uk>
Mon, 17 Jan 2022 12:50:38 +0000 (12:50 +0000)
committerJim Procter <j.procter@dundee.ac.uk>
Mon, 17 Jan 2022 12:50:38 +0000 (12:50 +0000)
test/jalview/io/WindowsFileLoadAndSaveTest.java

index 2dd27b4..b644848 100644 (file)
@@ -30,6 +30,7 @@ import org.testng.annotations.AfterClass;
 import org.testng.annotations.BeforeClass;
 import org.testng.annotations.Test;
 
+import jalview.bin.Cache;
 import jalview.datamodel.AlignmentI;
 import jalview.gui.AlignFrame;
 import jalview.gui.JvOptionPane;
@@ -68,18 +69,17 @@ public class WindowsFileLoadAndSaveTest
   @Test(groups = { "Functional" })
   public void loadAndSaveAlignment() throws IOException
   {
+    Cache.initLogger();
     File file = new File(fileName);
     File testFile = new File(testFileName);
     Files.copy(file.toPath(), testFile.toPath(),
             StandardCopyOption.REPLACE_EXISTING);
     FormatAdapter fa = new FormatAdapter();
-    AlignmentI a = fa.readFile(testFile, DataSourceType.FILE,
+    AlignmentI a = fa.readFile(fileName, DataSourceType.FILE,
             FileFormat.Fasta);
 
     AlignFrame af = new AlignFrame(a, 500, 500);
-    af.saveAlignment(testFileName, FileFormat.Fasta);
-
-    Assert.assertTrue(af.isSaveAlignmentSuccessful());
+    Assert.assertTrue(af.saveAlignment(testFileName, FileFormat.Fasta));
   }
 
   @AfterClass(alwaysRun = true)