X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=test%2Fjalview%2Fproject%2FJalview2xmlTests.java;h=830a75913c76b08f8f43df0803dc8eebcccf55b1;hb=4681700bbb6ac7b2bc0755f18219e375de324d32;hp=d902fa295ad1165c4c282128a7aa4a6e3f3963ba;hpb=1cf39accd3b4acfe0f02ff8100c936c4dbaeee1e;p=jalview.git diff --git a/test/jalview/project/Jalview2xmlTests.java b/test/jalview/project/Jalview2xmlTests.java index d902fa2..830a759 100644 --- a/test/jalview/project/Jalview2xmlTests.java +++ b/test/jalview/project/Jalview2xmlTests.java @@ -115,7 +115,8 @@ public class Jalview2xmlTests extends Jalview2xmlBase 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; @@ -157,7 +158,8 @@ public class Jalview2xmlTests extends Jalview2xmlBase .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; @@ -203,7 +205,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; @@ -402,7 +405,7 @@ public class Jalview2xmlTests extends Jalview2xmlBase @Test(groups = { "Functional" }, enabled = true) public void testStoreAndRecoverExpandedviews() throws Exception { - Desktop.instance.closeAll_actionPerformed(null); + Desktop.getInstance().closeAll_actionPerformed(null); AlignFrame af = new FileLoader().LoadFileWaitTillLoaded( "examples/exampleFile_2_7.jar", DataSourceType.FILE); @@ -430,7 +433,7 @@ public class Jalview2xmlTests extends Jalview2xmlBase { Assert.fail("Didn't save the expanded view state", e); } - Desktop.instance.closeAll_actionPerformed(null); + Desktop.getInstance().closeAll_actionPerformed(null); if (Desktop.getAlignFrames() != null) { Assert.assertEquals(Desktop.getAlignFrames().length, 0); @@ -456,7 +459,7 @@ public class Jalview2xmlTests extends Jalview2xmlBase @Test(groups = { "Functional" }) public void testStoreAndRecoverReferenceSeqSettings() throws Exception { - Desktop.instance.closeAll_actionPerformed(null); + Desktop.getInstance().closeAll_actionPerformed(null); AlignFrame af = new FileLoader().LoadFileWaitTillLoaded( "examples/exampleFile_2_7.jar", DataSourceType.FILE); assertNotNull(af, "Didn't read in the example file correctly."); @@ -495,7 +498,7 @@ public class Jalview2xmlTests extends Jalview2xmlBase { Assert.fail("Didn't save the expanded view state", e); } - Desktop.instance.closeAll_actionPerformed(null); + Desktop.getInstance().closeAll_actionPerformed(null); if (Desktop.getAlignFrames() != null) { Assert.assertEquals(Desktop.getAlignFrames().length, 0); @@ -589,7 +592,7 @@ public class Jalview2xmlTests extends Jalview2xmlBase @Test(groups = { "Functional" }) public void testStoreAndRecoverGroupRepSeqs() throws Exception { - Desktop.instance.closeAll_actionPerformed(null); + Desktop.getInstance().closeAll_actionPerformed(null); AlignFrame af = new FileLoader().LoadFileWaitTillLoaded( "examples/uniref50.fa", DataSourceType.FILE); assertNotNull(af, "Didn't read in the example file correctly."); @@ -664,7 +667,7 @@ public class Jalview2xmlTests extends Jalview2xmlBase { Assert.fail("Didn't save the expanded view state", e); } - Desktop.instance.closeAll_actionPerformed(null); + Desktop.getInstance().closeAll_actionPerformed(null); if (Desktop.getAlignFrames() != null) { Assert.assertEquals(Desktop.getAlignFrames().length, 0); @@ -709,7 +712,7 @@ public class Jalview2xmlTests extends Jalview2xmlBase @Test(groups = { "Functional" }) public void testStoreAndRecoverPDBEntry() throws Exception { - Desktop.instance.closeAll_actionPerformed(null); + Desktop.getInstance().closeAll_actionPerformed(null); String exampleFile = "examples/3W5V.pdb"; AlignFrame af = new FileLoader().LoadFileWaitTillLoaded(exampleFile, DataSourceType.FILE); @@ -758,7 +761,7 @@ public class Jalview2xmlTests extends Jalview2xmlBase { Assert.fail("Didn't save the state", e); } - Desktop.instance.closeAll_actionPerformed(null); + Desktop.getInstance().closeAll_actionPerformed(null); if (Desktop.getAlignFrames() != null) { Assert.assertEquals(Desktop.getAlignFrames().length, 0); @@ -809,7 +812,7 @@ public class Jalview2xmlTests extends Jalview2xmlBase @Test(groups = { "Functional" }) public void testStoreAndRecoverColourThresholds() throws IOException { - Desktop.instance.closeAll_actionPerformed(null); + Desktop.getInstance().closeAll_actionPerformed(null); AlignFrame af = new FileLoader().LoadFileWaitTillLoaded( "examples/uniref50.fa", DataSourceType.FILE); @@ -869,7 +872,7 @@ public class Jalview2xmlTests extends Jalview2xmlBase ".jvp"); tfile.deleteOnExit(); new Jalview2XML(false).saveState(tfile); - Desktop.instance.closeAll_actionPerformed(null); + Desktop.getInstance().closeAll_actionPerformed(null); af = new FileLoader().LoadFileWaitTillLoaded(tfile.getAbsolutePath(), DataSourceType.FILE); Assert.assertNotNull(af, "Failed to reload project"); @@ -981,7 +984,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."); /* @@ -1077,7 +1081,7 @@ public class Jalview2xmlTests extends Jalview2xmlBase @Test(groups = { "Functional" }) public void testMergeDatasetsforManyViews() throws IOException { - Desktop.instance.closeAll_actionPerformed(null); + Desktop.getInstance().closeAll_actionPerformed(null); // complex project - one dataset, several views on several alignments AlignFrame af = new FileLoader(false).LoadFileWaitTillLoaded( @@ -1121,7 +1125,7 @@ public class Jalview2xmlTests extends Jalview2xmlBase @Test(groups = "Functional") public void testPcaViewAssociation() throws IOException { - Desktop.instance.closeAll_actionPerformed(null); + Desktop.getInstance().closeAll_actionPerformed(null); final String PCAVIEWNAME = "With PCA"; // create a new tempfile File tempfile = File.createTempFile("jvPCAviewAssoc", "jvp"); @@ -1155,10 +1159,10 @@ public class Jalview2xmlTests extends Jalview2xmlBase } // load again. - Desktop.instance.closeAll_actionPerformed(null); + Desktop.getInstance().closeAll_actionPerformed(null); AlignFrame af = new FileLoader().LoadFileWaitTillLoaded( tempfile.getCanonicalPath(), DataSourceType.FILE); - JInternalFrame[] frames = Desktop.instance.getAllFrames(); + JInternalFrame[] frames = Desktop.getInstance().getAllFrames(); // PCA and the tabbed alignment view should be the only two windows on the // desktop assertEquals(frames.length, 2,