JAL-2371 CollectionColourScheme renamed ResidueShader and moved to
[jalview.git] / test / jalview / renderer / ResidueShaderTest.java
@@ -1,4 +1,4 @@
-package jalview.schemes;
+package jalview.renderer;
 
 import static org.testng.AssertJUnit.assertEquals;
 import static org.testng.AssertJUnit.assertFalse;
@@ -10,13 +10,14 @@ import jalview.datamodel.ProfileI;
 import jalview.datamodel.Profiles;
 import jalview.datamodel.Sequence;
 import jalview.datamodel.SequenceI;
+import jalview.schemes.PIDColourScheme;
 
 import java.awt.Color;
 import java.util.Collections;
 
 import org.testng.annotations.Test;
 
-public class CollectionColourSchemeTest
+public class ResidueShaderTest
 {
 
   @Test(groups = "Functional")
@@ -34,10 +35,9 @@ public class CollectionColourSchemeTest
     profiles[1] = new Profile(4, 0, 4, "R");
     profiles[2] = new Profile(4, 4, 0, "");
     profiles[3] = new Profile(4, 1, 2, "T");
-    CollectionColourScheme ccs = new CollectionColourScheme(
-            new PIDColourScheme());
+    ResidueShader ccs = new ResidueShader(new PIDColourScheme());
     ccs.setConsensus(new Profiles(profiles));
-    
+
     /*
      * no threshold
      */
@@ -49,7 +49,7 @@ public class CollectionColourSchemeTest
     assertTrue(ccs.aboveThreshold('W', 2));
     assertTrue(ccs.aboveThreshold('t', 3));
     assertTrue(ccs.aboveThreshold('Q', 3));
-  
+
     /*
      * with threshold, include gaps
      */
@@ -59,7 +59,7 @@ public class CollectionColourSchemeTest
     assertTrue(ccs.aboveThreshold('R', 1));
     assertFalse(ccs.aboveThreshold('W', 2));
     assertFalse(ccs.aboveThreshold('t', 3)); // 50% < 60%
-  
+
     /*
      * with threshold, ignore gaps
      */
@@ -78,12 +78,11 @@ public class CollectionColourSchemeTest
   @Test(groups = "Functional")
   public void testApplyConservation()
   {
-    CollectionColourScheme ccs = new CollectionColourScheme(
-            new PIDColourScheme());
-  
+    ResidueShader ccs = new ResidueShader(new PIDColourScheme());
+
     // no conservation present - no fading
     assertEquals(Color.RED, ccs.applyConservation(Color.RED, 12));
-    
+
     /*
      * stub Conservation to return a given consensus string
      */
@@ -92,16 +91,17 @@ public class CollectionColourSchemeTest
             Collections.<SequenceI> emptyList(), 0, 0)
     {
       @Override
-      public SequenceI getConsSequence() {
+      public SequenceI getConsSequence()
+      {
         return new Sequence("seq", consSequence);
       }
     };
     ccs.setConservation(cons);
-  
+
     // column out of range:
     assertEquals(Color.RED,
             ccs.applyConservation(Color.RED, consSequence.length()));
-  
+
     /*
      * with 100% threshold, 'fade factor' is 
      * (11-score)/10 * 100/20 = (11-score)/2
@@ -121,7 +121,7 @@ public class CollectionColourSchemeTest
     assertEquals(Color.RED, ccs.applyConservation(Color.RED, 10));
     assertEquals(Color.RED, ccs.applyConservation(Color.RED, 11));
     assertEquals(Color.WHITE, ccs.applyConservation(Color.RED, 12));
-  
+
     /*
      * with 0% threshold, there should be no fading
      */
@@ -139,7 +139,7 @@ public class CollectionColourSchemeTest
     assertEquals(Color.RED, ccs.applyConservation(Color.RED, 10));
     assertEquals(Color.RED, ccs.applyConservation(Color.RED, 11));
     assertEquals(Color.WHITE, ccs.applyConservation(Color.RED, 12)); // gap
-  
+
     /*
      * with 40% threshold, 'fade factor' is 
      * (11-score)/10 * 40/20 = (11-score)/5