JAL-2904 replaced assert for (getEnd()-getStart()+1)==getLength() in testPdb/mmCIFSeq...
authorJim Procter <jprocter@issues.jalview.org>
Mon, 12 Feb 2018 16:29:49 +0000 (16:29 +0000)
committerJim Procter <jprocter@issues.jalview.org>
Mon, 12 Feb 2018 16:34:02 +0000 (16:34 +0000)
test/jalview/ws/PDBSequenceFetcherTest.java

index 0572c85..78ab67e 100644 (file)
@@ -25,6 +25,7 @@ import static org.testng.AssertJUnit.assertTrue;
 
 import jalview.bin.Cache;
 import jalview.datamodel.AlignmentI;
+import jalview.datamodel.SequenceFeature;
 import jalview.datamodel.SequenceI;
 import jalview.gui.JvOptionPane;
 import jalview.structure.StructureImportSettings;
@@ -142,10 +143,15 @@ public class PDBSequenceFetcherTest
                 sq.getAnnotation().length > 0);
         assertTrue("No PDBEntry on sequence " + sq.getName(),
                 sq.getAllPDBEntries().size() > 0);
-        org.testng.Assert.assertEquals(sq.getEnd() - sq.getStart() + 1,
-                sq.getLength(),
-                "Sequence start/end doesn't match number of residues in sequence for "
-                        + sq.getName());
+        // FIXME: should test that all residues extracted as sequences from
+        // chains in structure have a mapping to data in the structure
+
+        for (int rs = sq.getStart(); rs < sq.getStart()
+                + sq.getLength(); rs++)
+        {
+          List<SequenceFeature> sf = sq.findFeatures(rs, rs, "RESNUM");
+          assertEquals(sf.size(), 1);
+        }
       }
     }
   }