From: Jim Procter Date: Sun, 4 Sep 2016 14:15:03 +0000 (+0100) Subject: JAL-1803 JAL-2106 patch tests for tighter PDB Primary DBRef definition X-Git-Tag: Release_2_10_0~47^2~4^2~15 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=bbcafe66766773929c15cbe80d7e7c731f743946;p=jalview.git JAL-1803 JAL-2106 patch tests for tighter PDB Primary DBRef definition --- diff --git a/test/jalview/datamodel/SequenceTest.java b/test/jalview/datamodel/SequenceTest.java index 3ad309e..0a1ca67 100644 --- a/test/jalview/datamodel/SequenceTest.java +++ b/test/jalview/datamodel/SequenceTest.java @@ -31,6 +31,7 @@ import static org.testng.internal.junit.ArrayAsserts.assertArrayEquals; import jalview.datamodel.PDBEntry.Type; import jalview.util.MapList; +import java.io.File; import java.util.ArrayList; import java.util.Arrays; import java.util.List; @@ -453,9 +454,9 @@ public class SequenceTest DBRefEntry pdb1pdb = new DBRefEntry("PDB", "version1", "1PDB"); DBRefEntry pdb2pdb = new DBRefEntry("PDB", "version1", "2PDB"); - //FIXME pdb2pdb's matching PDBEntry has Type.MMCIF - but 2.10 only has PDBEntry with type==PDB to indicate ID is a real PDB entry - List primRefs = Arrays.asList(new DBRefEntry[] { pdb1pdb }); + List primRefs = Arrays.asList(new DBRefEntry[] { pdb1pdb, + pdb2pdb }); sq.getDatasetSequence().addDBRef(pdb1pdb); sq.getDatasetSequence().addDBRef(pdb2pdb); @@ -779,11 +780,15 @@ public class SequenceTest // primary - type is PDB DBRefEntry pdbentry = new DBRefEntry("PDB", "0", "1qip"); seq.addDBRef(pdbentry); - // not primary - type of PDBEntry is not PDB + // not primary - PDBEntry has no file seq.addDBRef(new DBRefEntry("PDB", "0", "1AAA")); // not primary - no PDBEntry seq.addDBRef(new DBRefEntry("PDB", "0", "1DDD")); - seq.addPDBId(new PDBEntry("1QIP", null, Type.PDB, null)); + // add corroborating PDB entry for primary DBref - needs to have a file as + // well as matching ID + seq.addPDBId(new PDBEntry("1QIP", null, Type.PDB, new File("/blah") + .toString())); + // not valid DBRef - no file.. seq.addPDBId(new PDBEntry("1AAA", null, null, null)); assertTrue("Couldn't find simple primary reference (UNIPROT)", seq .getPrimaryDBRefs().contains(upentry));