+
+ @Test(groups = { "Functional" })
+ public void testGetPrimaryDBRefs()
+ {
+ /*
+ * test PDB relationships for for getPrimaryDBRefs
+ */
+ SequenceI seq = new Sequence("aseq", "ASDF");
+ DBRefEntry upentry = new DBRefEntry("UNIPROT", "0", "1qip");
+ // primary - uniprot
+ seq.addDBRef(upentry);
+ // primary - type is PDB
+ DBRefEntry pdbentry = new DBRefEntry("PDB", "0", "1qip");
+ seq.addDBRef(pdbentry);
+ // not primary - type of PDBEntry is not PDB
+ 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));
+ seq.addPDBId(new PDBEntry("1AAA", null, null, null));
+ assertTrue("Couldn't find simple primary reference (UNIPROT)", seq
+ .getPrimaryDBRefs().contains(upentry));
+ assertTrue("Couldn't find expected PDB primary reference", seq
+ .getPrimaryDBRefs().contains(pdbentry));
+ assertEquals(2, seq.getPrimaryDBRefs().size());
+ }