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-2624 additional tests for FeatureColour.getColour(),
[jalview.git]
/
test
/
jalview
/
schemes
/
FeatureColourTest.java
diff --git
a/test/jalview/schemes/FeatureColourTest.java
b/test/jalview/schemes/FeatureColourTest.java
index
03f7efa
..
7a72c15
100644
(file)
--- a/
test/jalview/schemes/FeatureColourTest.java
+++ b/
test/jalview/schemes/FeatureColourTest.java
@@
-128,17
+128,28
@@
public class FeatureColourTest
150f);
SequenceFeature sf = new SequenceFeature("type", "desc", 0, 20, 70f,
null);
150f);
SequenceFeature sf = new SequenceFeature("type", "desc", 0, 20, 70f,
null);
+
+ /*
+ * feature with score of Float.NaN is always assigned minimum colour
+ */
+ SequenceFeature sf2 = new SequenceFeature("type", "desc", 0, 20,
+ Float.NaN, null);
+
fc.setThreshold(100f); // ignore for now
assertEquals(new Color(204, 204, 204), fc.getColor(sf));
fc.setThreshold(100f); // ignore for now
assertEquals(new Color(204, 204, 204), fc.getColor(sf));
+ assertEquals(Color.white, fc.getColor(sf2));
fc.setAboveThreshold(true); // feature lies below threshold
assertNull(fc.getColor(sf));
fc.setAboveThreshold(true); // feature lies below threshold
assertNull(fc.getColor(sf));
+ assertEquals(Color.white, fc.getColor(sf2));
fc.setBelowThreshold(true);
fc.setThreshold(70f);
assertNull(fc.getColor(sf)); // feature score == threshold - hidden
fc.setBelowThreshold(true);
fc.setThreshold(70f);
assertNull(fc.getColor(sf)); // feature score == threshold - hidden
+ assertEquals(Color.white, fc.getColor(sf2));
fc.setThreshold(69f);
assertNull(fc.getColor(sf)); // feature score > threshold - hidden
fc.setThreshold(69f);
assertNull(fc.getColor(sf)); // feature score > threshold - hidden
+ assertEquals(Color.white, fc.getColor(sf2));
}
/**
}
/**