From: Jim Procter Date: Tue, 13 Feb 2018 12:50:40 +0000 (+0000) Subject: JAL-2781 report exactly which residues do not receive RESNUM annotation from associat... X-Git-Tag: Release_2_10_4~68^2~12 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=07b7e8f1faf772c1ffa85999a09c84dce96a63b1;p=jalview.git JAL-2781 report exactly which residues do not receive RESNUM annotation from associated structure data --- diff --git a/test/jalview/ws/PDBSequenceFetcherTest.java b/test/jalview/ws/PDBSequenceFetcherTest.java index 78ab67e..ba90dd8 100644 --- a/test/jalview/ws/PDBSequenceFetcherTest.java +++ b/test/jalview/ws/PDBSequenceFetcherTest.java @@ -35,6 +35,7 @@ import jalview.ws.seqfetcher.DbSourceProxy; 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; @@ -145,12 +146,34 @@ public class PDBSequenceFetcherTest 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 prev = null; + int lastp = -1; for (int rs = sq.getStart(); rs < sq.getStart() + sq.getLength(); rs++) { List 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()); } } }