From: gmungoc Date: Fri, 12 Jul 2019 13:38:34 +0000 (+0100) Subject: Merge branch 'develop' into features/JAL-3010ontologyFeatureSettings X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=refs%2Fheads%2Ffeatures%2FJAL-3010ontologyFeatureSettings;p=jalview.git Merge branch 'develop' into features/JAL-3010ontologyFeatureSettings Conflicts: test/jalview/gui/AlignFrameTest.java --- 6a05eb3f55d97e685f0c723822384633d5636778 diff --cc test/jalview/gui/AlignFrameTest.java index 60a94c4,3e82547..3fe56b7 --- a/test/jalview/gui/AlignFrameTest.java +++ b/test/jalview/gui/AlignFrameTest.java @@@ -144,92 -189,14 +190,45 @@@ public class AlignFrameTes .getHiddenColumns().iterator(); assertEquals(alignFrame.getViewport().getAlignment().getHiddenColumns() .getNumberOfRegions(), 2); - next = regions.next(); - assertEquals(next[0], 1); - assertEquals(next[1], 3); - next = regions.next(); - assertEquals(next[0], 6); - assertEquals(next[1], 8); + assertEquals(regions.next(), new int[] { 4, 6 }); + assertEquals(regions.next(), new int[] { 10, 12 }); + assertFalse(regions.hasNext()); + + /* + * hiding a contact feature should only hide start and end positions, + * not the intermediate columns + */ + String DISULFIDE = "Disulfide Bond"; + seq1.addSequenceFeature( + new SequenceFeature(DISULFIDE, "", 1, 5, 0f, null)); + alignFrame.getViewport().showAllHiddenColumns(); + assertTrue(alignFrame.hideFeatureColumns(true, DISULFIDE)); + regions = alignFrame.getViewport().getAlignment().getHiddenColumns() + .iterator(); + assertEquals(alignFrame.getViewport().getAlignment().getHiddenColumns() + .getNumberOfRegions(), 2); + assertEquals(regions.next(), new int[] { 0, 0 }); + assertEquals(regions.next(), new int[] { 7, 7 }); + assertFalse(regions.hasNext()); + + /* + * hide multiple feature types: + * TURN columns hides 4-6, 10-12 + * DISULFIDE columns hides 0, 7 + * combined is { 0-0, 4-7, 10-12 } + */ + alignFrame.getViewport().showAllHiddenColumns(); + assertTrue(alignFrame.hideFeatureColumns(true, TURN, DISULFIDE)); + regions = alignFrame.getViewport().getAlignment().getHiddenColumns() + .iterator(); + assertEquals(alignFrame.getViewport().getAlignment().getHiddenColumns() + .getNumberOfRegions(), 3); + assertEquals(regions.next(), new int[] { 0, 0 }); + assertEquals(regions.next(), new int[] { 4, 7 }); + assertEquals(regions.next(), new int[] { 10, 12 }); + assertFalse(regions.hasNext()); } - @BeforeClass(alwaysRun = true) - public static void setUpBeforeClass() throws Exception - { - /* - * use read-only test properties file - */ - Jalview.main( - new String[] - { "-nonews", "-props", "test/jalview/io/testProps.jvprops" }); - } - - @AfterMethod(alwaysRun = true) - public void tearDown() - { - Desktop.instance.closeAll_actionPerformed(null); - } - - /** - * configure (read-only) properties for test to ensure Consensus is computed - * for colour Above PID testing - */ - @BeforeMethod(alwaysRun = true) - public void setUp() - { - Cache.loadProperties("test/jalview/io/testProps.jvprops"); - Cache.applicationProperties.setProperty("SHOW_IDENTITY", - Boolean.TRUE.toString()); - af = new FileLoader().LoadFileWaitTillLoaded("examples/uniref50.fa", - DataSourceType.FILE); - - /* - * wait for Consensus thread to complete - */ - synchronized (this) - { - while (af.getViewport().getConsensusSeq() == null) - { - try - { - wait(50); - } catch (InterruptedException e) - { - } - } - } - } - /** * Test that changing background (alignment) colour scheme *