JWS-50 patch AAConWS test for refactoring of calculation parameters to a series of...
authorJim Procter <jprocter@compbio.dundee.ac.uk>
Wed, 19 Jun 2013 14:42:50 +0000 (15:42 +0100)
committerJim Procter <jprocter@compbio.dundee.ac.uk>
Wed, 19 Jun 2013 14:42:50 +0000 (15:42 +0100)
testsrc/compbio/ws/client/TestAAConWS.java

index b6be0d7..d54e67f 100644 (file)
@@ -9,6 +9,7 @@ import java.io.FileInputStream;
 import java.io.FileNotFoundException;\r
 import java.io.IOException;\r
 import java.net.ConnectException;\r
+import java.util.ArrayList;\r
 import java.util.List;\r
 \r
 import javax.xml.ws.WebServiceException;\r
@@ -213,21 +214,23 @@ public class TestAAConWS {
                // System.out.println(options.getArguments());\r
 \r
                try {\r
-                       options.getArgument("Calculation method").setDefaultValue("SMERFS");\r
+                       List<Option<AACon>> args = new ArrayList<Option<AACon>>();\r
+                       Option<AACon> arg,normarg;\r
+                       args.add(arg=options.getArgument("SMERFS"));\r
+                       args.add(normarg=options.getArgument("Normalize"));\r
+                       arg.setValue(arg.getPossibleValues().get(0));\r
                        // options.getArgument("SMERFS Column Scoring Method")\r
                        // .setDefaultValue("MAX_SCORE");\r
                        // options.getArgument("SMERFS Gap Threshhold").setDefaultValue("1");\r
-                       String jobId = msaws.customAnalize(fsl, options.getArguments());\r
+                       String jobId = msaws.customAnalize(fsl, args);\r
                        ScoreManager result = msaws.getAnnotation(jobId);\r
                        assertNotNull(result);\r
                        assertEquals(result.asSet().size(), 1);\r
                        assertEquals(result.asSet().iterator().next().getScores().get(0),\r
                                        0.698f);\r
-\r
-                       options.getArgument("Calculation method").setDefaultValue("SMERFS");\r
-                       options.removeArgument("Normalize");\r
-                       System.out.println(options);\r
-                       jobId = msaws.customAnalize(fsl, options.getArguments());\r
+                       args.remove(normarg); // remove normalization argument\r
+                       // System.out.println(options);\r
+                       jobId = msaws.customAnalize(fsl, args);\r
                        result = msaws.getAnnotation(jobId);\r
                        assertNotNull(result);\r
                        assertEquals(result.asSet().size(), 1);\r