From c7e8d3a34d2bac0206a942b393e9b6d4d52c55a2 Mon Sep 17 00:00:00 2001 From: gmungoc Date: Thu, 21 Jan 2016 14:56:27 +0000 Subject: [PATCH] JAL-1705 tidy and todo comment, no functional change --- test/jalview/ws/seqfetcher/DbRefFetcherTest.java | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) 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); } /** -- 1.7.10.2