From: gmungoc Date: Thu, 21 Jan 2016 14:56:27 +0000 (+0000) Subject: JAL-1705 tidy and todo comment, no functional change X-Git-Tag: Release_2_10_0~296^2~79 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=c7e8d3a34d2bac0206a942b393e9b6d4d52c55a2;p=jalview.git JAL-1705 tidy and todo comment, no functional change --- diff --git a/test/jalview/ws/seqfetcher/DbRefFetcherTest.java b/test/jalview/ws/seqfetcher/DbRefFetcherTest.java index ddd8b33..5265a72 100644 --- a/test/jalview/ws/seqfetcher/DbRefFetcherTest.java +++ b/test/jalview/ws/seqfetcher/DbRefFetcherTest.java @@ -33,6 +33,8 @@ import jalview.datamodel.SequenceFeature; import jalview.datamodel.SequenceI; import jalview.util.DBRefUtils; import jalview.ws.SequenceFetcher; +import jalview.ws.dbsources.Pdb; +import jalview.ws.dbsources.Uniprot; import java.util.ArrayList; import java.util.List; @@ -67,7 +69,7 @@ public class DbRefFetcherTest /** * Tests that standard protein database sources include Uniprot (as the first) - * and also PDB. (Additional sources are dependent on available of DAS + * and also PDB. (Additional sources are dependent on availability of DAS * services.) */ @Test(groups = { "Functional" }) @@ -75,30 +77,31 @@ public class DbRefFetcherTest { String[] defdb = DBRefSource.PROTEINDBS; List srces = new ArrayList(); + SequenceFetcher sfetcher = new SequenceFetcher(); + boolean pdbFound = false; + for (String ddb : defdb) { - SequenceFetcher sfetcher = new SequenceFetcher(); List srcesfordb = sfetcher.getSourceProxy(ddb); if (srcesfordb != null) { + // TODO is this right? get duplicate entries srces.addAll(srcesfordb); } } int i = 0; int uniprotPos = -1; - int pdbPos = -1; - // append the selected sequence sources to the default dbs for (DbSourceProxy s : srces) { - if (s instanceof jalview.ws.dbsources.Uniprot) + if (s instanceof Uniprot && uniprotPos == -1) { uniprotPos = i; } - if (s instanceof jalview.ws.dbsources.Pdb) + if (s instanceof Pdb) { - pdbPos = i; + pdbFound = true; } i++; } @@ -107,7 +110,7 @@ public class DbRefFetcherTest + srces.size() + " sources (source was at position " + uniprotPos + ")", uniprotPos == 0); assertTrue("Failed to find PDB source amongst " + srces.size() - + " sources", pdbPos >= 0); + + " sources", pdbFound); } /**