import java.util.Arrays;
import java.util.List;
+import org.testng.Assert;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
sq.getAllPDBEntries().size() > 0);
// FIXME: should test that all residues extracted as sequences from
// chains in structure have a mapping to data in the structure
-
+ StringBuilder errors = new StringBuilder();
+ List<SequenceFeature> prev = null;
+ int lastp = -1;
for (int rs = sq.getStart(); rs < sq.getStart()
+ sq.getLength(); rs++)
{
List<SequenceFeature> sf = sq.findFeatures(rs, rs, "RESNUM");
- assertEquals(sf.size(), 1);
+ if (sf.size() != 1)
+ {
+ errors.append(
+ "Expected feature at " + rs + ": saw " + sf.size());
+ errors.append("\n");
+ if (prev != null)
+ {
+ errors.append("Last Feature was at " + lastp + ": "
+ + prev.get(0).toString());
+ errors.append("\n");
+ }
+ }
+ else
+ {
+ prev = sf;
+ lastp = rs;
+ }
+ }
+ if (errors.length() > 0)
+ {
+ Assert.fail(errors.toString());
}
}
}