X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=test%2Fjalview%2Fgui%2FFeatureSettingsTest.java;h=6d8a47e0799c1b0eece262127425608e59a81f43;hb=418006c3714eb8da78234660698231597eb90fb1;hp=bf905fb701a403a24bf489609100a9d38bfbd47c;hpb=10be3b2413aa245f773a3afd0642812fcc73b3ff;p=jalview.git
diff --git a/test/jalview/gui/FeatureSettingsTest.java b/test/jalview/gui/FeatureSettingsTest.java
index bf905fb..6d8a47e 100644
--- a/test/jalview/gui/FeatureSettingsTest.java
+++ b/test/jalview/gui/FeatureSettingsTest.java
@@ -61,8 +61,8 @@ public class FeatureSettingsTest
fr.setColour("type2", byLabel);
// type3: by score above threshold
- FeatureColourI byScore = new FeatureColour(Color.BLACK, Color.BLUE, 1,
- 10);
+ FeatureColourI byScore = new FeatureColour(null, Color.BLACK,
+ Color.BLUE, null, 1, 10);
byScore.setAboveThreshold(true);
byScore.setThreshold(2f);
fr.setColour("type3", byScore);
@@ -74,8 +74,8 @@ public class FeatureSettingsTest
fr.setColour("type4", byAF);
// type5: by attribute CSQ:PolyPhen below threshold
- FeatureColourI byPolyPhen = new FeatureColour(Color.BLACK, Color.BLUE,
- 1, 10);
+ FeatureColourI byPolyPhen = new FeatureColour(null, Color.BLACK,
+ Color.BLUE, null, 1, 10);
byPolyPhen.setBelowThreshold(true);
byPolyPhen.setThreshold(3f);
byPolyPhen.setAttributeName("CSQ", "PolyPhen");
@@ -197,33 +197,41 @@ public class FeatureSettingsTest
@Test(groups = "Functional")
public void testGetColorTooltip() throws IOException
{
- assertNull(FeatureSettings.getColorTooltip(null,false));
+ assertNull(FeatureSettings.getColorTooltip(null, false));
/*
* simple colour
*/
FeatureColourI fc = new FeatureColour(Color.black);
String simpleTooltip = "Click to edit, right-click for menu";
- assertEquals(FeatureSettings.getColorTooltip(fc,false), simpleTooltip);
+ assertEquals(FeatureSettings.getColorTooltip(fc, true), simpleTooltip);
+ assertNull(FeatureSettings.getColorTooltip(fc, false));
/*
* graduated colour tooltip includes description of colour
*/
fc.setColourByLabel(true);
- assertEquals(FeatureSettings.getColorTooltip(fc,false),
+ assertEquals(FeatureSettings.getColorTooltip(fc, false),
+ "By Label");
+ assertEquals(FeatureSettings.getColorTooltip(fc, true),
"By Label
" + simpleTooltip + "");
/*
* graduated colour with threshold is html-encoded
*/
- fc = new FeatureColour(Color.red, Color.blue, 2f, 10f);
+ fc = new FeatureColour(null, Color.red, Color.blue, null, 2f, 10f);
fc.setBelowThreshold(true);
fc.setThreshold(4f);
- assertEquals(FeatureSettings.getColorTooltip(fc,false),
+ assertEquals(FeatureSettings.getColorTooltip(fc, false),
+ "By Score (< 4.0)");
+ assertEquals(FeatureSettings.getColorTooltip(fc, true),
"By Score (< 4.0)
" + simpleTooltip
+ "");
+
fc.setAboveThreshold(true);
- assertEquals(FeatureSettings.getColorTooltip(fc,false),
+ assertEquals(FeatureSettings.getColorTooltip(fc, false),
+ "By Score (> 4.0)");
+ assertEquals(FeatureSettings.getColorTooltip(fc, true),
"By Score (> 4.0)
" + simpleTooltip
+ "");
}