X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=test%2Fjalview%2Fws%2FSequenceFetcherTest.java;fp=test%2Fjalview%2Fws%2FSequenceFetcherTest.java;h=0000000000000000000000000000000000000000;hb=4f77328104498504339216829abf5ea87e2791ec;hp=8e18cc076d4f9c5d9591f2b45f61a9d64c05bdf9;hpb=2b8c0785318a3528e1876e8e2dd48b7d831eae69;p=jalview.git
diff --git a/test/jalview/ws/SequenceFetcherTest.java b/test/jalview/ws/SequenceFetcherTest.java
deleted file mode 100644
index 8e18cc0..0000000
--- a/test/jalview/ws/SequenceFetcherTest.java
+++ /dev/null
@@ -1,247 +0,0 @@
-/*
- * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
- * Copyright (C) $$Year-Rel$$ The Jalview Authors
- *
- * This file is part of Jalview.
- *
- * Jalview is free software: you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation, either version 3
- * of the License, or (at your option) any later version.
- *
- * Jalview is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty
- * of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE. See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with Jalview. If not, see .
- * The Jalview Authors are detailed in the 'AUTHORS' file.
- */
-package jalview.ws;
-
-import jalview.analysis.CrossRef;
-import jalview.datamodel.Alignment;
-import jalview.datamodel.AlignmentI;
-import jalview.datamodel.DBRefSource;
-import jalview.datamodel.SequenceI;
-import jalview.gui.JvOptionPane;
-import jalview.ws.seqfetcher.ASequenceFetcher;
-import jalview.ws.seqfetcher.DbSourceProxy;
-
-import java.util.Enumeration;
-import java.util.List;
-import java.util.Vector;
-
-import org.testng.annotations.BeforeClass;
-
-public class SequenceFetcherTest
-{
-
- @BeforeClass(alwaysRun = true)
- public void setUpJvOptionPane()
- {
- JvOptionPane.setInteractiveMode(false);
- JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION);
- }
-
- /**
- * simple run method to test dbsources.
- *
- * @param argv
- * @j2sIgnore
- */
- public static void main(String[] argv)
- {
- // TODO: extracted from SequenceFetcher - convert to network dependent
- // functional integration test with
- // assertions
-
- String usage = "SequenceFetcher.main [-nodas] [ []]\n"
- + "With no arguments, all DbSources will be queried with their test Accession number.\n"
- + "With one argument, the argument will be resolved to one or more db sources and each will be queried with their test accession only.\n"
- + "If given two arguments, SequenceFetcher will try to find the DbFetcher corresponding to and retrieve from it.";
-
- if (argv != null && argv.length > 0)
- {
- String targs[] = new String[argv.length - 1];
- System.arraycopy(argv, 1, targs, 0, targs.length);
- argv = targs;
- }
- if (argv != null && argv.length > 0)
- {
- List sps = SequenceFetcher.getInstance()
- .getSourceProxy(argv[0]);
-
- if (sps != null)
- {
- for (DbSourceProxy sp : sps)
- {
- // AlignmentI al = null;
- try
- {
- testRetrieval(argv[0], sp,
- argv.length > 1 ? argv[1] : sp.getTestQuery());
- } catch (Exception e)
- {
- e.printStackTrace();
- System.err.println("Error when retrieving "
- + (argv.length > 1 ? argv[1] : sp.getTestQuery())
- + " from " + argv[0] + "\nUsage: " + usage);
- }
- }
- return;
- }
- else
- {
- System.err.println("Can't resolve " + argv[0]
- + " as a database name. Allowed values are :\n"
- + SequenceFetcher.getInstance().getSupportedDb());
- }
- System.out.println(usage);
- return;
- }
- ASequenceFetcher sfetcher = SequenceFetcher.getInstance();
- String[] dbSources = sfetcher.getSupportedDb();
- for (int dbsource = 0; dbsource < dbSources.length; dbsource++)
- {
- String db = dbSources[dbsource];
- // skip me
- if (db.equals(DBRefSource.PDB))
- {
- continue;
- }
- for (DbSourceProxy sp : sfetcher.getSourceProxy(db))
- {
- testRetrieval(db, sp, sp.getTestQuery());
- }
- }
-
- }
-
- private static void testRetrieval(String db, DbSourceProxy sp,
- String testQuery)
- {
- AlignmentI ds = null;
- Vector