X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=test%2Fjalview%2Fgui%2FAlignFrameTest.java;h=454ff610f3c62db8c5c53f00a8fb92d23cae0466;hb=27c2e79ddd7e9913b385325798f2ed8a8b084dca;hp=bdda48d95c6c6ca6a3483b1e5ab6168a66d1d12f;hpb=4d64932654de3f6ffe07db11d18f2d21f558c6e6;p=jalview.git diff --git a/test/jalview/gui/AlignFrameTest.java b/test/jalview/gui/AlignFrameTest.java index bdda48d..454ff61 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; @@ -118,7 +119,8 @@ public class AlignFrameTest * seq1 feature in columns 1-5 is hidden * seq2 feature in columns 6-10 is shown */ - FeatureColourI fc = new FeatureColour(Color.red, Color.blue, 0f, 10f); + FeatureColourI fc = new FeatureColour(null, Color.red, Color.blue, null, + 0f, 10f); fc.setAboveThreshold(true); fc.setThreshold(5f); alignFrame.getFeatureRenderer().setColour("Metal", fc); @@ -599,4 +601,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"); + } }