From: kiramt Date: Tue, 26 Sep 2017 11:10:52 +0000 (+0100) Subject: JAL-2740 additional unit testing X-Git-Tag: Release_2_10_3b1~5^2~4^2 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=refs%2Fheads%2Fbug%2FJAL-2740;p=jalview.git JAL-2740 additional unit testing --- diff --git a/test/jalview/gui/AnnotationColumnChooserTest.java b/test/jalview/gui/AnnotationColumnChooserTest.java index a9b973e..06478d5 100644 --- a/test/jalview/gui/AnnotationColumnChooserTest.java +++ b/test/jalview/gui/AnnotationColumnChooserTest.java @@ -20,6 +20,7 @@ */ package jalview.gui; +import static org.testng.Assert.assertFalse; import static org.testng.AssertJUnit.assertEquals; import jalview.analysis.AnnotationSorter.SequenceAnnotationOrder; @@ -152,5 +153,24 @@ public class AnnotationColumnChooserTest regions = currentHidden.getHiddenColumnsCopy(); assertEquals(regions.get(0)[0], 10); assertEquals(regions.get(0)[1], 20); + + // check works with empty hidden columns as old columns + oldhidden = new HiddenColumns(); + acc.setOldHiddenColumns(oldhidden); + acc.reset(); + currentHidden = af.getViewport().getAlignment().getHiddenColumns(); + assertFalse(currentHidden.hasHiddenColumns()); + + // check works with empty hidden columns as new columns + oldhidden.hideColumns(10, 20); + acc.setOldHiddenColumns(oldhidden); + currentHidden = af.getViewport().getAlignment().getHiddenColumns(); + assertFalse(currentHidden.hasHiddenColumns()); + + acc.reset(); + currentHidden = af.getViewport().getAlignment().getHiddenColumns(); + regions = currentHidden.getHiddenColumnsCopy(); + assertEquals(regions.get(0)[0], 10); + assertEquals(regions.get(0)[1], 20); } }