--- /dev/null
+/**
+ *
+ */
+package jalview.ws.seqfetcher;
+
+import static org.junit.Assert.*;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import jalview.datamodel.DBRefSource;
+import jalview.ws.DBRefFetcher;
+import jalview.ws.SequenceFetcher;
+import jalview.ws.dbsources.das.api.jalviewSourceI;
+
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+/**
+ * @author jimp
+ *
+ */
+public class DbRefFetcherTest
+{
+
+ /**
+ * @throws java.lang.Exception
+ */
+ @BeforeClass
+ public static void setUpBeforeClass() throws Exception
+ {
+ }
+
+ /**
+ * @throws java.lang.Exception
+ */
+ @AfterClass
+ public static void tearDownAfterClass() throws Exception
+ {
+ }
+
+ @Test
+ public void testStandardProtDbs()
+ {
+ String[] defdb = DBRefSource.PROTEINDBS;
+ List<DbSourceProxy> srces = new ArrayList<DbSourceProxy>();
+ for (String ddb : defdb)
+ {
+ SequenceFetcher sfetcher= new SequenceFetcher();
+ List<DbSourceProxy> srcesfordb = sfetcher.getSourceProxy(ddb);
+
+ if (srcesfordb != null)
+ {
+ srces.addAll(srcesfordb);
+ }
+ }
+ DbSourceProxy uniprot=null;
+ int i=0;
+ // append the selected sequence sources to the default dbs
+ for (DbSourceProxy s:srces)
+ {
+ if (s.getDbSource().equalsIgnoreCase(DBRefSource.UNIPROT))
+ {
+ i++;
+ }
+
+ if (s instanceof jalview.ws.dbsources.Uniprot)
+ {
+ uniprot = s;
+ break;
+ }
+ }
+
+ assertTrue("Failed to find Uniprot source as first source amongst "+srces.size()+" sources (source was at position "+i+")", uniprot!=null && i<2);
+ }
+
+}