From: Jim Procter Date: Fri, 14 Dec 2018 11:59:11 +0000 (+0000) Subject: JAL-3171 failing test checking preservation of dataset X-Git-Tag: Release_2_11_1_0~78^2~17 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=2f9239370a29feee067cf3b992fb4acd859bb728;p=jalview.git JAL-3171 failing test checking preservation of dataset --- diff --git a/test/jalview/gui/AlignFrameTest.java b/test/jalview/gui/AlignFrameTest.java index b0aaab9..60ca11f 100644 --- a/test/jalview/gui/AlignFrameTest.java +++ b/test/jalview/gui/AlignFrameTest.java @@ -20,6 +20,7 @@ */ package jalview.gui; +import static org.junit.Assert.assertNotEquals; import static org.testng.Assert.assertEquals; import static org.testng.Assert.assertFalse; import static org.testng.Assert.assertNotSame; @@ -599,4 +600,26 @@ public class AlignFrameTest sp.valueChanged(22); assertEquals(av2.getResidueShading().getConservationInc(), 22); } + + /** + * Verify that making a New View preserves the dataset reference for the + * alignment. Otherwise, see a 'duplicate jar entry' reference when trying to + * save alignments with multiple views, and codon mappings will not be shared + * across all panels in a split frame. + * + * @see Jalview2xmlTests#testStoreAndRecoverColourThresholds() + */ + @Test(groups = "Functional") + public void testNewView_dsRefPreserved() + { + AlignViewport av = af.getViewport(); + AlignmentI al = av.getAlignment(); + AlignmentI original_ds = al.getDataset(); + af.newView_actionPerformed(null); + assertNotEquals("New view didn't select the a new panel", av, + af.getViewport()); + org.testng.Assert.assertEquals(original_ds, + af.getViewport().getAlignment().getDataset(), + "Dataset was not preserved in new view"); + } }