X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=test%2Fjalview%2Fschemes%2FPIDColourSchemeTest.java;h=fa4b5d922614ae6f7d0a6d821515aa6d63d0bdd9;hb=a264330266dd81fd668303c7289229b3a8867090;hp=6f60e50245194d6a5cfa6708256ae04d1a7e64d7;hpb=9270bd30c65a1304c4228b2f07734bc8461cd531;p=jalview.git
diff --git a/test/jalview/schemes/PIDColourSchemeTest.java b/test/jalview/schemes/PIDColourSchemeTest.java
index 6f60e50..fa4b5d9 100644
--- a/test/jalview/schemes/PIDColourSchemeTest.java
+++ b/test/jalview/schemes/PIDColourSchemeTest.java
@@ -35,13 +35,14 @@ public class PIDColourSchemeTest
*
case insensitive matching
*
*/
- @Test
+ @Test(groups = "Functional")
public void testFindColour()
{
ColourSchemeI scheme = new PIDColourScheme();
/*
* doesn't use column or sequence
+ * we assume consensus residue is computed as upper case
*/
assertEquals(scheme.findColour('A', 0, null, "A", 0f), white);
assertEquals(scheme.findColour('A', 0, null, "A", 40f), white);
@@ -54,8 +55,6 @@ public class PIDColourSchemeTest
assertEquals(scheme.findColour('A', 0, null, "KFV", 100f), white);
assertEquals(scheme.findColour('a', 0, null, "A", 80f), over60);
- assertEquals(scheme.findColour('A', 0, null, "a", 80f), over60);
- assertEquals(scheme.findColour('a', 0, null, "a", 80f), over60);
assertEquals(scheme.findColour('A', 0, null, "AC", 80f), over60);
assertEquals(scheme.findColour('A', 0, null, "KCA", 80f), over60);
}
@@ -65,7 +64,7 @@ public class PIDColourSchemeTest
* option on the annotation label popup menu) results in a change to the
* colouring
*/
- @Test
+ @Test(groups = "Functional")
public void testFindColour_ignoreGaps()
{
/*
@@ -78,10 +77,26 @@ public class PIDColourSchemeTest
* first column PID is 50%, or 67% ignoring gaps
*/
String seqs = ">seq1\nAAAAA\n>seq2\nAAAAA\n>seq3\n-CCCC\n>seq4\nFFFFF\n";
+
+ /*
+ * load data and wait for consensus to be computed
+ */
AlignFrame af = new FileLoader().LoadFileWaitTillLoaded(seqs,
DataSourceType.PASTE);
AlignViewport viewport = af.getViewport();
viewport.setIgnoreGapsConsensus(false, af.alignPanel);
+ while (viewport.getConsensusSeq() == null)
+ {
+ synchronized (this)
+ {
+ try
+ {
+ wait(50);
+ } catch (InterruptedException e)
+ {
+ }
+ }
+ }
af.changeColour_actionPerformed(JalviewColourScheme.PID.toString());
SequenceI seq = viewport.getAlignment().getSequenceAt(0);
@@ -90,7 +105,7 @@ public class PIDColourSchemeTest
* including gaps, A should be coloured for 50% consensus
*/
Color c = viewport
- .getViewportColourScheme().findColour('A', 0, seq);
+ .getResidueShading().findColour('A', 0, seq);
assertEquals(c, over40);
/*
@@ -98,7 +113,7 @@ public class PIDColourSchemeTest
*/
viewport.setIgnoreGapsConsensus(true, af.alignPanel);
c = viewport
- .getViewportColourScheme().findColour('A', 0, seq);
+ .getResidueShading().findColour('A', 0, seq);
assertEquals(c, over60);
}
}