2 * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8.2)
3 * Copyright (C) 2014 The Jalview Authors
5 * This file is part of Jalview.
7 * Jalview is free software: you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation, either version 3
10 * of the License, or (at your option) any later version.
12 * Jalview is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty
14 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15 * PURPOSE. See the GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with Jalview. If not, see <http://www.gnu.org/licenses/>.
19 * The Jalview Authors are detailed in the 'AUTHORS' file.
21 package jalview.ws.seqfetcher;
23 import static org.junit.Assert.*;
25 import java.util.ArrayList;
26 import java.util.List;
28 import jalview.datamodel.DBRefSource;
29 import jalview.ws.DBRefFetcher;
30 import jalview.ws.SequenceFetcher;
31 import jalview.ws.dbsources.das.api.jalviewSourceI;
33 import org.junit.AfterClass;
34 import org.junit.BeforeClass;
35 import org.junit.Test;
41 public class DbRefFetcherTest
45 * @throws java.lang.Exception
48 public static void setUpBeforeClass() throws Exception
53 * @throws java.lang.Exception
56 public static void tearDownAfterClass() throws Exception
61 public void testStandardProtDbs()
63 String[] defdb = DBRefSource.PROTEINDBS;
64 List<DbSourceProxy> srces = new ArrayList<DbSourceProxy>();
65 for (String ddb : defdb)
67 SequenceFetcher sfetcher = new SequenceFetcher();
68 List<DbSourceProxy> srcesfordb = sfetcher.getSourceProxy(ddb);
70 if (srcesfordb != null)
72 srces.addAll(srcesfordb);
75 DbSourceProxy uniprot = null;
77 // append the selected sequence sources to the default dbs
78 for (DbSourceProxy s : srces)
80 if (s.getDbSource().equalsIgnoreCase(DBRefSource.UNIPROT))
85 if (s instanceof jalview.ws.dbsources.Uniprot)
92 assertTrue("Failed to find Uniprot source as first source amongst "
93 + srces.size() + " sources (source was at position " + i + ")",
94 uniprot != null && i < 2);