From 494422ff62c58d14f36fc99dd1d5d1e0e949ed46 Mon Sep 17 00:00:00 2001 From: Jim Procter Date: Wed, 18 Jul 2018 17:20:36 +0100 Subject: [PATCH] JAL-3048 test for successful save with refactored saveAlignment method --- test/jalview/io/AnnotatedPDBFileInputTest.java | 3 ++- test/jalview/io/Jalview2xmlTests.java | 12 ++++++++---- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/test/jalview/io/AnnotatedPDBFileInputTest.java b/test/jalview/io/AnnotatedPDBFileInputTest.java index c0038a1..9cd7061 100644 --- a/test/jalview/io/AnnotatedPDBFileInputTest.java +++ b/test/jalview/io/AnnotatedPDBFileInputTest.java @@ -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, diff --git a/test/jalview/io/Jalview2xmlTests.java b/test/jalview/io/Jalview2xmlTests.java index 53bb0e7..f932295 100644 --- a/test/jalview/io/Jalview2xmlTests.java +++ b/test/jalview/io/Jalview2xmlTests.java @@ -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."); /* -- 1.7.10.2