JAL-2154 patch regression on DbRefFetcher due to PDB being dropped from NUCLEOTIDEDBS...
authorJim Procter <jprocter@issues.jalview.org>
Fri, 26 Aug 2016 15:09:16 +0000 (16:09 +0100)
committerJim Procter <jprocter@issues.jalview.org>
Fri, 26 Aug 2016 15:09:16 +0000 (16:09 +0100)
src/jalview/ws/DBRefFetcher.java
test/jalview/analysis/CrossRefTest.java
test/jalview/ws/seqfetcher/DbRefFetcherTest.java

index 6213568..ca403c5 100644 (file)
@@ -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);
index 62bcae8..24ddb34 100644 (file)
@@ -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]);
   }
 
   /**
index b3c7e10..59bf445 100644 (file)
@@ -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<String> defdb = new ArrayList<String>();
+    defdb.addAll(Arrays.asList(DBRefSource.PROTEINDBS));
+    defdb.add(DBRefSource.PDB);
     List<DbSourceProxy> srces = new ArrayList<DbSourceProxy>();
     SequenceFetcher sfetcher = new SequenceFetcher();
     boolean pdbFound = false;