*/
package jalview.datamodel;
+import static org.testng.Assert.assertTrue;
import static org.testng.AssertJUnit.assertEquals;
import static org.testng.AssertJUnit.assertFalse;
assertEquals("Failed parseCigar", ex_cs_gapped,
gen_sgapped.getCigarstring());
- testSeqRecovery(gen_sgapped, s_gapped);
+ assertTrue(testSeqRecovery(gen_sgapped, s_gapped,true));
/*
* Test dataset resolution
*/
SeqCigar sub_gapped = new SeqCigar(s_subsequence_gapped);
- testSeqRecovery(sub_gapped, s_subsequence_gapped);
+ assertTrue(testSeqRecovery(sub_gapped, s_subsequence_gapped,true));
/*
* Test width functions
assertEquals("Failed getCigarstring", ex_cs_gapped, cs_gapped);
}
- protected void testSeqRecovery(SeqCigar gen_sgapped, SequenceI s_gapped)
+ protected boolean testSeqRecovery(SeqCigar gen_sgapped, SequenceI s_gapped,boolean startEndCheck)
{
// this is non-rigorous - start and end recovery is not tested.
SequenceI gen_sgapped_s = gen_sgapped.getSeq('-');
System.err.println("Couldn't reconstruct sequence.\n"
+ gen_sgapped_s.getSequenceAsString() + "\n"
+ s_gapped.getSequenceAsString());
+ return false;
}
+ if (startEndCheck)
+ {
+ assertEquals("Start not conserved in reconstructed sequence",s_gapped.getStart(),gen_sgapped_s.getStart());
+ assertEquals("End not conserved in reconstructed sequence",s_gapped.getEnd(),gen_sgapped_s.getEnd());
+ }
+ return true;
}
}