* wait for Conservation thread to complete
*/
AlignViewport viewport = af.getViewport();
+ waitForCalculations(viewport);
+ AlignmentAnnotation[] anns = viewport.getAlignment()
+ .getAlignmentAnnotation();
+ assertNotNull("No annotations found", anns);
+ assertEquals("More than one annotation found", 1, anns.length);
+ assertTrue("Annotation is not Quality",
+ anns[0].description.startsWith("Alignment Quality"));
+ Annotation[] annotations = anns[0].annotations;
+ assertNotNull("Quality annotations are null", annotations);
+ assertNotNull("Quality in column 1 is null", annotations[0]);
+ assertTrue("No quality value in column 1", annotations[0].value > 10f);
+ }
+
+ /**
+ * Wait for consensus etc calculation threads to complete
+ *
+ * @param viewport
+ */
+ protected void waitForCalculations(AlignViewport viewport)
+ {
synchronized (this)
{
while (viewport.getCalcManager().isWorking())
}
}
}
- AlignmentAnnotation[] anns = viewport.getAlignment()
- .getAlignmentAnnotation();
- assertNotNull("No annotations found", anns);
- assertEquals("More than one annotation found", 1, anns.length);
- assertTrue("Annotation is not Quality",
- anns[0].description.startsWith("Alignment Quality"));
- Annotation[] annotations = anns[0].annotations;
- assertNotNull("Quality annotations are null", annotations);
- assertNotNull("Quality in column 1 is null", annotations[0]);
- assertTrue("No quality value in column 1", annotations[0].value > 10f);
}
@Test(groups = { "Functional" })
AlignFrame af = new FileLoader().LoadFileWaitTillLoaded(fasta,
DataSourceType.PASTE);
AlignViewport testme = af.getViewport();
+ waitForCalculations(testme);
SequenceI cons = testme.getConsensusSeq();
assertEquals("A-C", cons.getSequenceAsString());
}