Assert.assertTrue(cra.getXrefViews().size() > 0,
"No crossrefs retrieved for " + db);
cra_views = cra.getXrefViews();
+ assertNucleotide(cra_views.get(0),
+ "Nucleotide panel included proteins for " + first
+ + " -> " + db);
+ assertProtein(cra_views.get(1),
+ "Protein panel included nucleotides for " + first
+ + " -> " + db);
}
else
{
+ "' to " + xrefdb + " via '"
+ nextaf.getTitle() + "'");
cra_views2 = cra.getXrefViews();
+ assertNucleotide(cra_views2.get(0),
+ "Nucleotide panel included proteins for '"
+ + nextxref + "' to " + xrefdb
+ + " via '" + nextaf.getTitle() + "'");
+ assertProtein(cra_views2.get(1),
+ "Protein panel included nucleotides for '"
+ + nextxref + "' to " + xrefdb
+ + " via '" + nextaf.getTitle() + "'");
+
}
else
{
}
}
+ private void assertProtein(AlignmentViewPanel alignmentViewPanel,
+ String message)
+ {
+ assertType(true, alignmentViewPanel, message);
+ }
+
+ private void assertNucleotide(AlignmentViewPanel alignmentViewPanel,
+ String message)
+ {
+ assertType(false, alignmentViewPanel, message);
+ }
+
+ private void assertType(boolean expectProtein,
+ AlignmentViewPanel alignmentViewPanel, String message)
+ {
+ List<SequenceI> nonType = new ArrayList<SequenceI>();
+ for (SequenceI sq : alignmentViewPanel.getAlignViewport()
+ .getAlignment()
+ .getSequences())
+ {
+ if (sq.isProtein() != expectProtein)
+ {
+ nonType.add(sq);
+ }
+ }
+ if (nonType.size() > 0)
+ {
+ Assert.fail(message + " [ "
+ + (expectProtein ? "nucleotides were " : "proteins were ")
+ + nonType.toString()
+ + " ]");
+ }
+ }
+
/**
* first time called, record strings derived from alignment and
* alignedcodonframes, and save view to a project file. Second time called,