From 047d1eb5f5227f82234867378d4882a6785f633d Mon Sep 17 00:00:00 2001 From: Jim Procter Date: Mon, 29 Jun 2020 17:19:19 +0100 Subject: [PATCH] JAL-3493 failing test - creates a highlight and column selection and then called the deselect all alignfjame action and checks if highlight and selection are still present. --- test/jalview/gui/SeqCanvasTest.java | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/test/jalview/gui/SeqCanvasTest.java b/test/jalview/gui/SeqCanvasTest.java index 73aeb79..213a1c9 100644 --- a/test/jalview/gui/SeqCanvasTest.java +++ b/test/jalview/gui/SeqCanvasTest.java @@ -21,8 +21,14 @@ package jalview.gui; import static org.testng.Assert.assertEquals; +import static org.testng.Assert.assertFalse; +import static org.testng.Assert.assertNotNull; +import static org.testng.Assert.assertNull; +import static org.testng.Assert.assertTrue; import jalview.datamodel.AlignmentI; +import jalview.datamodel.SearchResults; +import jalview.datamodel.SearchResultsI; import jalview.io.DataSourceType; import jalview.io.FileLoader; @@ -338,4 +344,27 @@ public class SeqCanvasTest "wrappedRepeatHeightPx"); assertEquals(repeatingHeight, charHeight * (2 + al.getHeight())); } + + @Test(groups = "Functional") + public void testClear_HighlightAndSelection() + { + AlignFrame af = new FileLoader().LoadFileWaitTillLoaded( + "examples/uniref50.fa", DataSourceType.FILE); + AlignViewport av = af.getViewport(); + SearchResultsI highlight = new SearchResults(); + highlight.addResult( + av.getAlignment().getSequenceAt(1).getDatasetSequence(), 50, + 80); + af.alignPanel.highlightSearchResults(highlight); + af.avc.markHighlightedColumns(false, false, false); + assertNotNull(av.getSearchResults(), + "No highlight was created on alignment"); + assertFalse(av.getColumnSelection().isEmpty(), + "No selection was created from highlight"); + af.deselectAllSequenceMenuItem_actionPerformed(null); + assertTrue(av.getColumnSelection().isEmpty(), + "No Selection should be present after deselecting all."); + assertNull(av.getSearchResults(), + "No higlighted search results should be present after deselecting all."); + } } -- 1.7.10.2