From: Sasha Sherstnev Date: Thu, 5 Sep 2013 09:46:52 +0000 (+0100) Subject: Changes which allow JpredWS test X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=652864eebc0ecdeb6f8bfef1700e3b365a0d7227;p=jabaws.git Changes which allow JpredWS test --- diff --git a/webservices/compbio/stat/collector/InputFilter.java b/webservices/compbio/stat/collector/InputFilter.java index f55e843..4c36445 100644 --- a/webservices/compbio/stat/collector/InputFilter.java +++ b/webservices/compbio/stat/collector/InputFilter.java @@ -24,7 +24,7 @@ public class InputFilter { if (input == null) return true; assert input.isFile() : "Input file is not a file! " + input; - String[] fastainput = WSTester.fastaInput.split("\n"); + String[] fastainput = WSTester.fastaInput2records.split("\n"); assert fastainput.length == 4; String[] aligninput = WSTester.fastaAlignment.split("\n"); assert aligninput.length == 4; diff --git a/webservices/compbio/ws/client/WSTester.java b/webservices/compbio/ws/client/WSTester.java index e9a349c..2f33cb1 100644 --- a/webservices/compbio/ws/client/WSTester.java +++ b/webservices/compbio/ws/client/WSTester.java @@ -63,10 +63,13 @@ public class WSTester { /** * Sequences to be used as input for all WS */ - public static final String fastaInput = ">Foo\n" + public static final String fastaInput2records = ">Foo\n" + "MTADGPRELLQLRAAVRHRPQDFVAWLMLADAELGMGDTTAGEMAVQRGLALHPGHPEAV" + "\n>Bar\n" + "ASDAAPEHPGIALWLHALEDAGQAEAAAAYTRAHQLLPEEPYITAQLLNAVA\n"; + public static final String fastaInput1record = ">Foo\n" + + "MTADGPRELLQLRAAVRHRPQDFVAWLMLADAELGMGDTTAGEMAVQRGLALHPGHPEAV" + + "\n"; public static final String fastaAlignment = ">Foo\n" + "MTADGPRELLQLRAAVRHRPQDFVAWLMLADAELGMGDTTAGEMAVQRGLALHPGHPEAV--------\n" @@ -74,7 +77,7 @@ public class WSTester { + "ASDAAPEH------------PGIALWLHALE-DAGQAEAAA---AYTRAHQLLPEEPYITAQLLNAVA\n" + ""; - static final List seqs = loadSeqs(); + static final List seqs = loadSeqs(2); private static final String FAILED = "FAILED"; private static final String OK = "OK"; @@ -86,10 +89,12 @@ public class WSTester { * * @return List of FastaSequence records */ - private static List loadSeqs() { + private static List loadSeqs(int nLines) { try { - return SequenceUtil.readFasta(new ByteArrayInputStream(fastaInput - .getBytes())); + if (nLines == 1) { + return SequenceUtil.readFasta(new ByteArrayInputStream(fastaInput1record.getBytes())); + } + return SequenceUtil.readFasta(new ByteArrayInputStream(fastaInput2records.getBytes())); } catch (IOException ignored) { // Should not happen as a source is not a external stream ignored.printStackTrace(); @@ -240,10 +245,13 @@ public class WSTester { SequenceAnnotation wservice, Services service) throws Exception { writer.print("Calling analyse........."); - List input = loadSeqs(); + List input = loadSeqs(2); if (service == Services.AAConWS) { input = loadAlignment(); } + if (service == Services.JpredWS) { + input = loadSeqs(1); + } boolean success = testDefaultAnalyse(input, wservice, null, null); PresetManager presetman = wservice.getPresets();