JAL-1803 patch test: PDBEntry.getFile() will always be different, but never null
authorJim Procter <jprocter@issues.jalview.org>
Sun, 4 Sep 2016 12:11:44 +0000 (13:11 +0100)
committerJim Procter <jprocter@issues.jalview.org>
Sun, 4 Sep 2016 12:11:44 +0000 (13:11 +0100)
test/jalview/io/Jalview2xmlTests.java

index f7853ff..39d2c89 100644 (file)
@@ -713,13 +713,19 @@ public class Jalview2xmlTests extends Jalview2xmlBase
 
     // The Asserts below are expected to fail until the PDB chainCode is
     // recoverable from a Jalview projects
-    Assert.assertTrue(rseqs[0].getDatasetSequence().getAllPDBEntries()
-            .get(0).equals(pdbEntries[0]));
-    Assert.assertTrue(rseqs[1].getDatasetSequence().getAllPDBEntries()
-            .get(0).equals(pdbEntries[1]));
-    Assert.assertTrue(rseqs[2].getDatasetSequence().getAllPDBEntries()
-            .get(0).equals(pdbEntries[2]));
-    Assert.assertTrue(rseqs[3].getDatasetSequence().getAllPDBEntries()
-            .get(0).equals(pdbEntries[3]));
+    for (int chain = 0; chain < 4; chain++)
+    {
+      PDBEntry recov = rseqs[chain].getDatasetSequence().getAllPDBEntries()
+              .get(0);
+      PDBEntry expected = pdbEntries[chain];
+      Assert.assertEquals(recov.getId(), expected.getId(),
+              "Mismatch PDB ID");
+      Assert.assertEquals(recov.getChainCode(), expected.getChainCode(),
+              "Mismatch PDB ID");
+      Assert.assertEquals(recov.getType(), expected.getType(),
+              "Mismatch PDBEntry 'Type'");
+      Assert.assertNotNull(recov.getFile(),
+              "Recovered PDBEntry should have a non-null file entry");
+    }
   }
 }