X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=test%2Fjalview%2Fws%2FSequenceFetcherTest.java;h=8e18cc076d4f9c5d9591f2b45f61a9d64c05bdf9;hb=447c5c1b22bd12a78730640321264fb38c39ec7b;hp=32afd5f7ab3beaa5a328e576e31fcdac3f676fc8;hpb=5f4e1e4c330b045e9c8bce28ee132a0fca3834d8;p=jalview.git diff --git a/test/jalview/ws/SequenceFetcherTest.java b/test/jalview/ws/SequenceFetcherTest.java index 32afd5f..8e18cc0 100644 --- a/test/jalview/ws/SequenceFetcherTest.java +++ b/test/jalview/ws/SequenceFetcherTest.java @@ -49,36 +49,35 @@ public class SequenceFetcherTest * simple run method to test dbsources. * * @param argv + * @j2sIgnore */ public static void main(String[] argv) { - // TODO: extracted from SequenceFetcher - convert to proper unit test with + // 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.\n" - + "The -nodas option will exclude DAS sources from the database fetchers Jalview will try to use."; - boolean withDas = true; - if (argv != null && argv.length > 0 - && argv[0].toLowerCase().startsWith("-nodas")) + + "If given two arguments, SequenceFetcher will try to find the DbFetcher corresponding to and retrieve from it."; + + if (argv != null && argv.length > 0) { - withDas = false; 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 = new SequenceFetcher(withDas) + List sps = SequenceFetcher.getInstance() .getSourceProxy(argv[0]); if (sps != null) { for (DbSourceProxy sp : sps) { - AlignmentI al = null; + // AlignmentI al = null; try { testRetrieval(argv[0], sp, @@ -97,12 +96,12 @@ public class SequenceFetcherTest { System.err.println("Can't resolve " + argv[0] + " as a database name. Allowed values are :\n" - + new SequenceFetcher().getSupportedDb()); + + SequenceFetcher.getInstance().getSupportedDb()); } System.out.println(usage); return; } - ASequenceFetcher sfetcher = new SequenceFetcher(withDas); + ASequenceFetcher sfetcher = SequenceFetcher.getInstance(); String[] dbSources = sfetcher.getSupportedDb(); for (int dbsource = 0; dbsource < dbSources.length; dbsource++) { @@ -124,7 +123,7 @@ public class SequenceFetcherTest String testQuery) { AlignmentI ds = null; - Vector noProds = new Vector(); + Vector noProds = new Vector<>(); System.out.println("Source: " + sp.getDbName() + " (" + db + "): retrieving test:" + sp.getTestQuery()); {