*/
package jalview.gui;
-import static org.testng.Assert.assertEquals;
-
import java.awt.Font;
import java.awt.FontMetrics;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
+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.bin.Cache;
import jalview.datamodel.AlignmentI;
+import jalview.datamodel.SearchResults;
+import jalview.datamodel.SearchResultsI;
+import jalview.io.DataSourceType;
import jalview.io.DataSourceType;
import jalview.io.FileLoader;
+
import junit.extensions.PA;
public class SeqCanvasTest
}
} while (af.getViewport().getCalcManager().isWorking());
}
+ @Test(groups = "Functional")
+ public void testClear_HighlightAndSelection()
+ {
+ 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.");
+ }
}