X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;ds=inline;f=testsrc%2Fcompbio%2Fws%2Fclient%2FTestRNAalifoldWS.java;fp=testsrc%2Fcompbio%2Fws%2Fclient%2FTestRNAalifoldWS.java;h=b061fcc92ca2c4fae62bd1e0e7e34ade2cd7c455;hb=9072bd850138bedbd005509e5b14bb5e104574b4;hp=2d392f74f5e5cc4b8e48fb7b84266b7c1c2bf585;hpb=fa61eaad52ffe5ee0db449c3dd9ec5fa67aec43f;p=jabaws.git diff --git a/testsrc/compbio/ws/client/TestRNAalifoldWS.java b/testsrc/compbio/ws/client/TestRNAalifoldWS.java index 2d392f7..b061fcc 100644 --- a/testsrc/compbio/ws/client/TestRNAalifoldWS.java +++ b/testsrc/compbio/ws/client/TestRNAalifoldWS.java @@ -1,5 +1,6 @@ package compbio.ws.client; +import compbio.metadata.AllTestSuit; import static org.testng.Assert.assertEquals; import static org.testng.Assert.assertNotNull; import static org.testng.Assert.fail; @@ -17,10 +18,10 @@ import javax.xml.ws.WebServiceException; import org.testng.annotations.BeforeTest; import org.testng.annotations.Test; +import compbio.data.msa.FoldWS; import compbio.data.msa.JABAService; import compbio.data.msa.SequenceAnnotation; import compbio.data.sequence.Alignment; -import compbio.data.structure.FoldWS; import compbio.data.sequence.RNAstruct; import compbio.data.sequence.ClustalAlignmentUtil; import compbio.data.sequence.ConservationMethod; @@ -37,47 +38,50 @@ import compbio.metadata.ResultNotAvailableException; import compbio.metadata.RunnerConfig; import compbio.metadata.UnsupportedRuntimeException; import compbio.metadata.WrongParameterException; - import compbio.runner.conservation.AACon; import compbio.util.SysPrefs; import compbio.ws.server.RNAalifoldWS; + public class TestRNAalifoldWS { FoldWS foldws; -// @BeforeTest(groups = {AllTestSuit.test_group_webservices}) -// void initConnection() { -// -// try { -// JABAService client = Jws2Client.connect( -// "http://localhost:8080/jabaws", Services.RNAalifoldWS); -// foldws = (FoldWS) client; -// } catch (ConnectException e) { -// e.printStackTrace(); -// fail(e.getMessage()); -// } catch (WebServiceException e) { -// e.printStackTrace(); -// fail(e.getMessage()); -// } -// } + @BeforeTest(groups = {AllTestSuit.test_group_webservices}) + void initConnection() { + + try { + JABAService client = Jws2Client.connect( + "http://localhost:8080/jabaws", Services.RNAalifoldWS); + foldws = (FoldWS) client; + } catch (ConnectException e) { + e.printStackTrace(); + fail(e.getMessage()); + } catch (WebServiceException e) { + e.printStackTrace(); + fail(e.getMessage()); + } + } @Test(groups = {AllTestSuit.test_group_webservices}) public void testFold() throws FileNotFoundException, IOException, UnknownFileFormatException { - String CURRENT_DIRECTORY = SysPrefs.getCurrentDirectory() - + File.separator; +// String CURRENT_DIRECTORY = SysPrefs.getCurrentDirectory() +// + File.separator; Alignment aln = ClustalAlignmentUtil.readClustalFile(new FileInputStream( - CURRENT_DIRECTORY + "testsrc" + File.separator + "testdata" - + File.separator + "unfolded_RF00031.aln")); + AllTestSuit.test_input_aln)); try { - String jobId = foldws.fold(aln); + List> options = new ArrayList>(); + options.add(foldws.getRunnerOptions().getArgumentByOptionName("--mis")); + System.out.println("TestRNAalifoldWS: print options: " + options.toString()); + String jobId = foldws.customFold(aln, options); System.out.println("J: " + jobId); - RNAstruct result = foldws.getResult(jobId); + String result = foldws.getResult(jobId); + System.out.println("fold results: \n" + result); assertNotNull(result); } catch (UnsupportedRuntimeException e) { @@ -92,7 +96,10 @@ public class TestRNAalifoldWS { } catch (ResultNotAvailableException e) { e.printStackTrace(); fail(e.getMessage()); - } + } catch (WrongParameterException e) { + e.printStackTrace(); + fail(e.getMessage()); + } } }