From: Jim Procter Date: Wed, 28 Sep 2016 14:57:58 +0000 (+0100) Subject: JAL-2210 JAL-2235 fix deriveSequence test for tightened up setDBRefs and addDBRef... X-Git-Tag: Release_2_10_0~20^2~25 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=9bddf64f7592879716221d69710588aac803c50d;p=jalview.git JAL-2210 JAL-2235 fix deriveSequence test for tightened up setDBRefs and addDBRef behaviour (always add to dataset sequence if present) --- diff --git a/test/jalview/datamodel/SequenceTest.java b/test/jalview/datamodel/SequenceTest.java index cfcb9ec..0c401e2 100644 --- a/test/jalview/datamodel/SequenceTest.java +++ b/test/jalview/datamodel/SequenceTest.java @@ -460,19 +460,20 @@ public class SequenceTest sq.addPDBId(new PDBEntry("2PDB", "A", Type.MMCIF, "filePath/test2")); sq.addPDBId(new PDBEntry("2PDB", "B", Type.MMCIF, "filePath/test2")); + // these are the same as ones already added DBRefEntry pdb1pdb = new DBRefEntry("PDB", "version1", "1PDB"); - DBRefEntry pdb2pdb = new DBRefEntry("PDB", "version1", "2PDB"); + DBRefEntry pdb2pdb = new DBRefEntry("PDB", "version2", "2PDB"); List primRefs = Arrays.asList(new DBRefEntry[] { pdb1pdb, pdb2pdb }); - sq.getDatasetSequence().addDBRef(pdb1pdb); - sq.getDatasetSequence().addDBRef(pdb2pdb); + sq.getDatasetSequence().addDBRef(pdb1pdb); // should do nothing + sq.getDatasetSequence().addDBRef(pdb2pdb); // should do nothing sq.getDatasetSequence().addDBRef( - new DBRefEntry("PDB", "version3", "3PDB")); + new DBRefEntry("PDB", "version3", "3PDB")); // should do nothing sq.getDatasetSequence().addDBRef( - new DBRefEntry("PDB", "version4", "4PDB")); + new DBRefEntry("PDB", "version4", "4PDB")); // should do nothing PDBEntry pdbe1a=new PDBEntry("1PDB", "A", Type.PDB, "filePath/test1"); PDBEntry pdbe1b = new PDBEntry("1PDB", "B", Type.PDB, "filePath/test1"); @@ -509,11 +510,14 @@ public class SequenceTest new AlignmentAnnotation("Test annot", "Test annot description", annots)); Assert.assertEquals(sq.getDescription(), "Test sequence description.."); - Assert.assertEquals(sq.getDBRefs().length, 5); + Assert.assertEquals(sq.getDBRefs().length, 5); // DBRefs are on dataset + // sequence Assert.assertEquals(sq.getAllPDBEntries().size(), 4); Assert.assertNotNull(sq.getAnnotation()); Assert.assertEquals(sq.getAnnotation()[0].annotations.length, 2); - Assert.assertEquals(sq.getDatasetSequence().getDBRefs().length, 4); + Assert.assertEquals(sq.getDatasetSequence().getDBRefs().length, 5); // same + // as + // sq.getDBRefs() Assert.assertEquals(sq.getDatasetSequence().getAllPDBEntries().size(), 4); Assert.assertNotNull(sq.getDatasetSequence().getAnnotation()); @@ -522,11 +526,11 @@ public class SequenceTest Assert.assertEquals(derived.getDescription(), "Test sequence description.."); - Assert.assertEquals(derived.getDBRefs().length, 4); // come from dataset + Assert.assertEquals(derived.getDBRefs().length, 5); // come from dataset Assert.assertEquals(derived.getAllPDBEntries().size(), 4); Assert.assertNotNull(derived.getAnnotation()); Assert.assertEquals(derived.getAnnotation()[0].annotations.length, 2); - Assert.assertEquals(derived.getDatasetSequence().getDBRefs().length, 4); + Assert.assertEquals(derived.getDatasetSequence().getDBRefs().length, 5); Assert.assertEquals(derived.getDatasetSequence().getAllPDBEntries() .size(), 4); Assert.assertNotNull(derived.getDatasetSequence().getAnnotation());