import jalview.ws.seqfetcher.DbSourceProxy;
import java.util.Enumeration;
+import java.util.HashMap;
import java.util.List;
+import java.util.Map;
import java.util.Vector;
+import org.testng.Assert;
import org.testng.annotations.BeforeClass;
+import org.testng.annotations.Test;
public class SequenceFetcherTest
{
JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION);
}
+ @Test(groups = "Functional")
+ public void testNoDuplicatesInFetchDbRefs()
+ {
+ Map<String, List<DbSourceProxy>> seen = new HashMap<>();
+ jalview.ws.SequenceFetcher sfetcher = new jalview.ws.SequenceFetcher();
+ String dupes = "";
+ for (String src : sfetcher.getOrderedSupportedSources())
+ {
+ List<DbSourceProxy> seenitem = seen.get(src);
+ if (seenitem != null)
+ {
+ dupes += (dupes.length() > 0 ? "," : "") + src;
+ }
+ else
+ {
+ seen.put(src, sfetcher.getSourceProxy(src));
+ }
+ }
+ if (dupes.length() > 0)
+ {
+ Assert.fail("Duplicate sources : " + dupes);
+ }
+ }
+
/**
* simple run method to test dbsources.
*