X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=test%2Fjalview%2Fschemes%2FFeatureColourTest.java;h=1beca80759ad0b1864daf3de6880baceb9805cc5;hb=b9d3d1f71c6a8aee09cd23e1303b062cbe43a239;hp=c16d5411f6a6313647696dfb38add903aea7620e;hpb=b0cee3aaf7d8873910939f97b6acb217d518968d;p=jalview.git diff --git a/test/jalview/schemes/FeatureColourTest.java b/test/jalview/schemes/FeatureColourTest.java index c16d541..1beca80 100644 --- a/test/jalview/schemes/FeatureColourTest.java +++ b/test/jalview/schemes/FeatureColourTest.java @@ -87,7 +87,8 @@ public class FeatureColourTest public void testIsColored_simpleColour() { FeatureColour fc = new FeatureColour(Color.RED); - assertTrue(fc.isColored(new SequenceFeature())); + assertTrue(fc + .isColored(new SequenceFeature("Cath", "", 1, 2, 0f, null))); } @Test(groups = { "Functional" }) @@ -95,7 +96,8 @@ public class FeatureColourTest { FeatureColour fc = new FeatureColour(); fc.setColourByLabel(true); - assertTrue(fc.isColored(new SequenceFeature())); + assertTrue(fc + .isColored(new SequenceFeature("Cath", "", 1, 2, 0f, null))); } @Test(groups = { "Functional" }) @@ -112,13 +114,15 @@ public class FeatureColourTest assertEquals(Color.WHITE, fc.getColor(sf)); // score 120 is adjusted to top of range - sf.setScore(120f); + sf = new SequenceFeature(sf, sf.getBegin(), sf.getEnd(), + sf.getFeatureGroup(), 120f); assertEquals(Color.BLACK, fc.getColor(sf)); // value below threshold is still rendered // setting threshold has no effect yet... fc.setThreshold(60f); - sf.setScore(36f); + sf = new SequenceFeature(sf, sf.getBegin(), sf.getEnd(), + sf.getFeatureGroup(), 36f); assertTrue(fc.isColored(sf)); assertEquals(new Color(204, 204, 204), fc.getColor(sf)); @@ -128,7 +132,9 @@ public class FeatureColourTest // colour is still returned though ?!? assertEquals(new Color(204, 204, 204), fc.getColor(sf)); - sf.setScore(84); // above threshold now + sf = new SequenceFeature(sf, sf.getBegin(), sf.getEnd(), + sf.getFeatureGroup(), 84f); + // above threshold now assertTrue(fc.isColored(sf)); assertEquals(new Color(51, 51, 51), fc.getColor(sf)); } @@ -137,7 +143,8 @@ public class FeatureColourTest public void testGetColor_simpleColour() { FeatureColour fc = new FeatureColour(Color.RED); - assertEquals(Color.RED, fc.getColor(new SequenceFeature())); + assertEquals(Color.RED, + fc.getColor(new SequenceFeature("Cath", "", 1, 2, 0f, null))); } @Test(groups = { "Functional" })