X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=webservices%2Fcompbio%2Fws%2Fclient%2FWSTester.java;h=2f33cb1dd4a3d4166128722ec99eaa949141cdac;hb=652864eebc0ecdeb6f8bfef1700e3b365a0d7227;hp=e9a349c75e5551da6d6c136ac3d6ae05e1e4927f;hpb=c46caed03164e4396eb55dc30e7db3558a7b06cc;p=jabaws.git 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();