From bf0a46a8e950f4cf270c2f13e0f5bcf9dd206b70 Mon Sep 17 00:00:00 2001 From: Jim Procter Date: Fri, 26 Aug 2016 16:09:16 +0100 Subject: [PATCH] JAL-2154 patch regression on DbRefFetcher due to PDB being dropped from NUCLEOTIDEDBS and PROTEINDBS lists --- src/jalview/ws/DBRefFetcher.java | 3 +++ test/jalview/analysis/CrossRefTest.java | 7 +++---- test/jalview/ws/seqfetcher/DbRefFetcherTest.java | 5 ++++- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/src/jalview/ws/DBRefFetcher.java b/src/jalview/ws/DBRefFetcher.java index 6213568..ca403c5 100644 --- a/src/jalview/ws/DBRefFetcher.java +++ b/src/jalview/ws/DBRefFetcher.java @@ -176,6 +176,9 @@ public class DBRefFetcher implements Runnable srces.addAll(srcesfordb); } } + // append the PDB data source, since it is 'special', catering for both + // nucleotide and protein + srces.addAll(sfetcher.getSourceProxy(DBRefSource.PDB)); // append the selected sequence sources to the default dbs srces.addAll(selsources); diff --git a/test/jalview/analysis/CrossRefTest.java b/test/jalview/analysis/CrossRefTest.java index 62bcae8..24ddb34 100644 --- a/test/jalview/analysis/CrossRefTest.java +++ b/test/jalview/analysis/CrossRefTest.java @@ -80,12 +80,11 @@ public class CrossRefTest * Just the protein refs: */ found = DBRefUtils.selectDbRefs(false, refs); - assertEquals(5, found.length); + assertEquals(4, found.length); assertSame(ref1, found[0]); assertSame(ref2, found[1]); - assertSame(ref3, found[2]); - assertSame(ref4, found[3]); - assertSame(ref9, found[4]); + assertSame(ref4, found[2]); + assertSame(ref9, found[3]); } /** diff --git a/test/jalview/ws/seqfetcher/DbRefFetcherTest.java b/test/jalview/ws/seqfetcher/DbRefFetcherTest.java index b3c7e10..59bf445 100644 --- a/test/jalview/ws/seqfetcher/DbRefFetcherTest.java +++ b/test/jalview/ws/seqfetcher/DbRefFetcherTest.java @@ -37,6 +37,7 @@ import jalview.ws.dbsources.Pdb; import jalview.ws.dbsources.Uniprot; import java.util.ArrayList; +import java.util.Arrays; import java.util.List; import org.testng.annotations.AfterClass; @@ -75,7 +76,9 @@ public class DbRefFetcherTest @Test(groups = { "Functional" }) public void testStandardProtDbs() { - String[] defdb = DBRefSource.PROTEINDBS; + List defdb = new ArrayList(); + defdb.addAll(Arrays.asList(DBRefSource.PROTEINDBS)); + defdb.add(DBRefSource.PDB); List srces = new ArrayList(); SequenceFetcher sfetcher = new SequenceFetcher(); boolean pdbFound = false; -- 1.7.10.2