Web service stubs are regenerated to incorporate new the methods. Excveption handling...
[jabaws.git] / webservices / compbio / ws / client / WSTester.java
index 4db6778..7091f02 100644 (file)
@@ -182,8 +182,7 @@ public class WSTester {
                return succeed;\r
        }\r
 \r
-       private <T> boolean testMsaWS(MsaWS<T> msaws)\r
-                       throws UnsupportedRuntimeException {\r
+       private <T> boolean testMsaWS(MsaWS<T> msaws) throws Exception {\r
                assert msaws != null;\r
 \r
                boolean succeed = testDefaultAlignment(msaws);\r
@@ -225,14 +224,14 @@ public class WSTester {
                                throw new UnsupportedOperationException("The service: "\r
                                                + wservice.getClass() + " is not supported! ");\r
                        }\r
-               } catch (UnsupportedRuntimeException e) {\r
+               } catch (Exception e) {\r
                        reportException(e);\r
                        return false;\r
                }\r
        }\r
 \r
        private <T> boolean testSequenceAnnotationWS(SequenceAnnotation<T> wservice)\r
-                       throws UnsupportedRuntimeException {\r
+                       throws Exception {\r
                writer.print("Calling analyse.........");\r
                boolean success = testDefaultAnalyse(loadAlignment(), wservice, null,\r
                                null);\r
@@ -253,30 +252,24 @@ public class WSTester {
 \r
        private <T> boolean testDefaultAnalyse(List<FastaSequence> fastalist,\r
                        SequenceAnnotation<T> wsproxy, Preset<T> preset,\r
-                       List<Option<T>> customOptions) throws UnsupportedRuntimeException {\r
+                       List<Option<T>> customOptions) throws Exception {\r
 \r
                ScoreManager scores = null;\r
-               try {\r
-                       String jobId = null;\r
-                       if (customOptions != null) {\r
-                               jobId = wsproxy.customAnalize(fastalist, customOptions);\r
-                       } else if (preset != null) {\r
-                               jobId = wsproxy.presetAnalize(fastalist, preset);\r
-                       } else {\r
-                               jobId = wsproxy.analize(fastalist);\r
-                       }\r
-                       Thread.sleep(1000);\r
-                       scores = wsproxy.getAnnotation(jobId);\r
-                       if (scores != null) {\r
-                               writer.println(OK);\r
-                       }\r
-               } catch (Exception e) {\r
-                       if (e instanceof UnsupportedRuntimeException) {\r
-                               throw (UnsupportedRuntimeException) e;\r
-                       } else {\r
-                               reportException(e);\r
-                       }\r
+\r
+               String jobId = null;\r
+               if (customOptions != null) {\r
+                       jobId = wsproxy.customAnalize(fastalist, customOptions);\r
+               } else if (preset != null) {\r
+                       jobId = wsproxy.presetAnalize(fastalist, preset);\r
+               } else {\r
+                       jobId = wsproxy.analize(fastalist);\r
                }\r
+               Thread.sleep(1000);\r
+               scores = wsproxy.getAnnotation(jobId);\r
+               if (scores != null) {\r
+                       writer.println(OK);\r
+               }\r
+\r
                return scores != null;\r
        }\r
 \r
@@ -332,30 +325,22 @@ public class WSTester {
         * @param msaws\r
         * @throws UnsupportedRuntimeException\r
         */\r
-       private <T> boolean testDefaultAlignment(MsaWS<T> msaws)\r
-                       throws UnsupportedRuntimeException {\r
+       private <T> boolean testDefaultAlignment(MsaWS<T> msaws) throws Exception {\r
                writer.print("Testing alignment with default parameters:");\r
                Alignment al = null;\r
                boolean succeed = false;\r
-               try {\r
-                       String taskId = msaws.align(seqs);\r
-                       writer.print("\nQuerying job status...");\r
-                       JobStatus status = msaws.getJobStatus(taskId);\r
-                       while (status != JobStatus.FINISHED) {\r
-                               Thread.sleep(1000);\r
-                               status = msaws.getJobStatus(taskId);\r
-                       }\r
-                       writer.println(OK);\r
-                       writer.print("Retrieving results...");\r
-                       al = msaws.getResult(taskId);\r
-                       succeed = true;\r
-               } catch (Exception e) {\r
-                       if (e instanceof UnsupportedRuntimeException) {\r
-                               throw (UnsupportedRuntimeException) e;\r
-                       } else {\r
-                               reportException(e);\r
-                       }\r
+\r
+               String taskId = msaws.align(seqs);\r
+               writer.print("\nQuerying job status...");\r
+               JobStatus status = msaws.getJobStatus(taskId);\r
+               while (status != JobStatus.FINISHED) {\r
+                       Thread.sleep(1000);\r
+                       status = msaws.getJobStatus(taskId);\r
                }\r
+               writer.println(OK);\r
+               writer.print("Retrieving results...");\r
+               al = msaws.getResult(taskId);\r
+               succeed = true;\r
                if (al != null) {\r
                        writer.println(OK);\r
                }\r
@@ -436,7 +421,7 @@ public class WSTester {
                        writer.println("Check is completed. The Service " + serv\r
                                        + " IS WORKING\n");\r
                } else {\r
-                       writer.println("Check is completed. The Service " + serv\r
+                       writer.println("Check is aborted. The Service " + serv\r
                                        + " HAS SOME PROBLEMS\n");\r
                }\r
        }\r