From e63ac3b8efdb9be3a6a94ea36a3642d7a0d615bf Mon Sep 17 00:00:00 2001 From: kiramt Date: Mon, 8 May 2017 09:06:22 +0100 Subject: [PATCH] JAL-2512 And corresponding test --- test/jalview/gui/SequenceRendererTest.java | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/test/jalview/gui/SequenceRendererTest.java b/test/jalview/gui/SequenceRendererTest.java index 29a9a52..c80b830 100644 --- a/test/jalview/gui/SequenceRendererTest.java +++ b/test/jalview/gui/SequenceRendererTest.java @@ -58,6 +58,24 @@ public class SequenceRendererTest assertEquals(Color.magenta, sr.getResidueBoxColour(seq, 5)); // G assertEquals(Color.orange, sr.getResidueBoxColour(seq, 12)); // F } + + @Test(groups = { "Functional" }) + public void testGetResidueBoxColour_none() + { + SequenceI seq = new Sequence("name", "MA--TVLGSPRAPAFF"); + AlignmentI al = new Alignment(new SequenceI[] { seq }); + final AlignViewport av = new AlignViewport(al); + SequenceRenderer sr = new SequenceRenderer(av); + + assertEquals(Color.white, sr.getResidueBoxColour(seq, 0)); + assertEquals(Color.white, sr.getResidueBoxColour(seq, 2)); + + // set for overview + sr.forOverview = true; + assertEquals(Color.lightGray, sr.getResidueBoxColour(seq, 0)); + assertEquals(Color.white, sr.getResidueBoxColour(seq, 2)); + } + // TODO more tests for getResidueBoxColour covering groups, feature rendering, // gaps, overview... -- 1.7.10.2