X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=test%2Fjalview%2Fgui%2FFeatureSettingsTest.java;h=f09c7c799081e8cd61f57ce8ffdbaf6b02226a58;hb=06ab16e2f61b0d30302e645be386ce02c26086b4;hp=5219bda5d9116cfc6b76129c2519d8a47e9a6e3d;hpb=ee7d621eea4811c90ce8bc470cc1e217cd2d806c;p=jalview.git
diff --git a/test/jalview/gui/FeatureSettingsTest.java b/test/jalview/gui/FeatureSettingsTest.java
index 5219bda..f09c7c7 100644
--- a/test/jalview/gui/FeatureSettingsTest.java
+++ b/test/jalview/gui/FeatureSettingsTest.java
@@ -4,6 +4,13 @@ import static org.testng.Assert.assertEquals;
import static org.testng.Assert.assertNull;
import static org.testng.Assert.assertTrue;
+import java.awt.Color;
+import java.io.File;
+import java.io.IOException;
+import java.util.HashMap;
+
+import org.testng.annotations.Test;
+
import jalview.api.FeatureColourI;
import jalview.datamodel.SequenceFeature;
import jalview.datamodel.SequenceI;
@@ -15,13 +22,7 @@ import jalview.io.FileLoader;
import jalview.schemes.FeatureColour;
import jalview.schemes.FeatureColourTest;
import jalview.util.matcher.Condition;
-
-import java.awt.Color;
-import java.io.File;
-import java.io.IOException;
-import java.util.HashMap;
-
-import org.testng.annotations.Test;
+import jalview.viewmodel.seqfeatures.FeatureRendererModel;
public class FeatureSettingsTest
{
@@ -50,7 +51,7 @@ public class FeatureSettingsTest
/*
* set colour schemes for features
*/
- FeatureRenderer fr = af.getFeatureRenderer();
+ FeatureRendererModel fr = af.getFeatureRenderer();
// type1: red
fr.setColour("type1", new FeatureColour(Color.red));
@@ -159,7 +160,7 @@ public class FeatureSettingsTest
assertEquals(fr.getFeatureFilter("type2").toStableString(),
"(Score LE 2.4) AND (Score GT 1.1)");
assertEquals(fr.getFeatureFilter("type3").toStableString(),
- "(AF Contains X) OR (CSQ:PolyPhen NE 0.0)");
+ "(AF Contains X) OR (CSQ:PolyPhen NE 0)");
}
/**
@@ -197,20 +198,23 @@ public class FeatureSettingsTest
@Test(groups = "Functional")
public void testGetColorTooltip() throws IOException
{
- assertNull(FeatureSettings.getColorTooltip(null));
+ 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), 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),
+ assertEquals(FeatureSettings.getColorTooltip(fc, false),
+ "By Label");
+ assertEquals(FeatureSettings.getColorTooltip(fc, true),
"By Label
" + simpleTooltip + "");
/*
@@ -219,11 +223,16 @@ public class FeatureSettingsTest
fc = new FeatureColour(null, Color.red, Color.blue, null, 2f, 10f);
fc.setBelowThreshold(true);
fc.setThreshold(4f);
- assertEquals(FeatureSettings.getColorTooltip(fc),
+ 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),
+ assertEquals(FeatureSettings.getColorTooltip(fc, false),
+ "By Score (> 4.0)");
+ assertEquals(FeatureSettings.getColorTooltip(fc, true),
"By Score (> 4.0)
" + simpleTooltip
+ "");
}