git://source.jalview.org
/
jalview.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
JAL-3468 i18n and additional unit tests
[jalview.git]
/
test
/
jalview
/
gui
/
FeatureSettingsTest.java
diff --git
a/test/jalview/gui/FeatureSettingsTest.java
b/test/jalview/gui/FeatureSettingsTest.java
index
5219bda
..
fd4bd4b
100644
(file)
--- a/
test/jalview/gui/FeatureSettingsTest.java
+++ b/
test/jalview/gui/FeatureSettingsTest.java
@@
-15,6
+15,7
@@
import jalview.io.FileLoader;
import jalview.schemes.FeatureColour;
import jalview.schemes.FeatureColourTest;
import jalview.util.matcher.Condition;
import jalview.schemes.FeatureColour;
import jalview.schemes.FeatureColourTest;
import jalview.util.matcher.Condition;
+import jalview.viewmodel.seqfeatures.FeatureRendererModel;
import java.awt.Color;
import java.io.File;
import java.awt.Color;
import java.io.File;
@@
-50,7
+51,7
@@
public class FeatureSettingsTest
/*
* set colour schemes for features
*/
/*
* set colour schemes for features
*/
- FeatureRenderer fr = af.getFeatureRenderer();
+ FeatureRendererModel fr = af.getFeatureRenderer();
// type1: red
fr.setColour("type1", new FeatureColour(Color.red));
// type1: red
fr.setColour("type1", new FeatureColour(Color.red));
@@
-197,20
+198,23
@@
public class FeatureSettingsTest
@Test(groups = "Functional")
public void testGetColorTooltip() throws IOException
{
@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";
/*
* 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);
/*
* graduated colour tooltip includes description of colour
*/
fc.setColourByLabel(true);
- assertEquals(FeatureSettings.getColorTooltip(fc),
+ assertEquals(FeatureSettings.getColorTooltip(fc, false),
+ "<html>By Label</html>");
+ assertEquals(FeatureSettings.getColorTooltip(fc, true),
"<html>By Label<br>" + simpleTooltip + "</br></html>");
/*
"<html>By Label<br>" + simpleTooltip + "</br></html>");
/*
@@
-219,11
+223,16
@@
public class FeatureSettingsTest
fc = new FeatureColour(null, Color.red, Color.blue, null, 2f, 10f);
fc.setBelowThreshold(true);
fc.setThreshold(4f);
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),
+ "<html>By Score (< 4.0)</html>");
+ assertEquals(FeatureSettings.getColorTooltip(fc, true),
"<html>By Score (< 4.0)<br>" + simpleTooltip
+ "</br></html>");
"<html>By Score (< 4.0)<br>" + simpleTooltip
+ "</br></html>");
+
fc.setAboveThreshold(true);
fc.setAboveThreshold(true);
- assertEquals(FeatureSettings.getColorTooltip(fc),
+ assertEquals(FeatureSettings.getColorTooltip(fc, false),
+ "<html>By Score (> 4.0)</html>");
+ assertEquals(FeatureSettings.getColorTooltip(fc, true),
"<html>By Score (> 4.0)<br>" + simpleTooltip
+ "</br></html>");
}
"<html>By Score (> 4.0)<br>" + simpleTooltip
+ "</br></html>");
}