JAL-3048 test for successful save with refactored saveAlignment method
authorJim Procter <jprocter@issues.jalview.org>
Wed, 18 Jul 2018 16:20:36 +0000 (17:20 +0100)
committerJim Procter <jprocter@issues.jalview.org>
Wed, 18 Jul 2018 16:20:36 +0000 (17:20 +0100)
test/jalview/io/AnnotatedPDBFileInputTest.java
test/jalview/io/Jalview2xmlTests.java

index c0038a1..9cd7061 100644 (file)
@@ -221,8 +221,9 @@ public class AnnotatedPDBFileInputTest
     AlignFrame af = new jalview.io.FileLoader().LoadFileWaitTillLoaded(
             inFile, DataSourceType.FILE);
     assertTrue("Didn't read input file " + inFile, af != null);
+    af.saveAlignment(tfile, FileFormat.Jalview);
     assertTrue("Failed to store as a project.",
-            af.saveAlignment(tfile, FileFormat.Jalview));
+            af.isSaveAlignmentSuccessful());
     af.closeMenuItem_actionPerformed(true);
     af = null;
     af = new jalview.io.FileLoader().LoadFileWaitTillLoaded(tfile,
index 53bb0e7..f932295 100644 (file)
@@ -107,7 +107,8 @@ public class Jalview2xmlTests extends Jalview2xmlBase
     assertTrue(
             af.getViewport().getGlobalColourScheme() instanceof RNAHelicesColour,
             "Couldn't apply RNA helices colourscheme");
-    assertTrue(af.saveAlignment(tfile, FileFormat.Jalview),
+    af.saveAlignment(tfile, FileFormat.Jalview);
+    assertTrue(af.isSaveAlignmentSuccessful(),
             "Failed to store as a project.");
     af.closeMenuItem_actionPerformed(true);
     af = null;
@@ -143,7 +144,8 @@ public class Jalview2xmlTests extends Jalview2xmlBase
             .getAlignment(), af.getViewport().getGlobalColourScheme()
             .getSchemeName()), "Recognise T-Coffee score from string");
 
-    assertTrue(af.saveAlignment(tfile, FileFormat.Jalview),
+    af.saveAlignment(tfile, FileFormat.Jalview);
+    assertTrue(af.isSaveAlignmentSuccessful(),
             "Failed to store as a project.");
     af.closeMenuItem_actionPerformed(true);
     af = null;
@@ -188,7 +190,8 @@ public class Jalview2xmlTests extends Jalview2xmlBase
     sg.addSequence(af.getViewport().getAlignment().getSequenceAt(1), false);
     sg.addSequence(af.getViewport().getAlignment().getSequenceAt(2), true);
     af.alignPanel.alignmentChanged();
-    assertTrue(af.saveAlignment(tfile, FileFormat.Jalview),
+    af.saveAlignment(tfile, FileFormat.Jalview);
+    assertTrue(af.isSaveAlignmentSuccessful(),
             "Failed to store as a project.");
     af.closeMenuItem_actionPerformed(true);
     af = null;
@@ -963,7 +966,8 @@ public class Jalview2xmlTests extends Jalview2xmlBase
     File tfile = File.createTempFile("JalviewTest", ".jvp");
     tfile.deleteOnExit();
     String filePath = tfile.getAbsolutePath();
-    assertTrue(af.saveAlignment(filePath, FileFormat.Jalview),
+    af.saveAlignment(filePath, FileFormat.Jalview);
+    assertTrue(af.isSaveAlignmentSuccessful(),
             "Failed to store as a project.");
 
     /*