import compbio.data.sequence.ScoreManager;\r
import compbio.data.sequence.SequenceUtil;\r
import compbio.metadata.JobStatus;\r
-import compbio.metadata.JobSubmissionException;\r
import compbio.metadata.Limit;\r
import compbio.metadata.LimitsManager;\r
import compbio.metadata.Option;\r
import compbio.metadata.Preset;\r
import compbio.metadata.PresetManager;\r
-import compbio.metadata.ResultNotAvailableException;\r
import compbio.metadata.RunnerConfig;\r
import compbio.metadata.UnsupportedRuntimeException;\r
-import compbio.metadata.WrongParameterException;\r
import compbio.util.FileUtil;\r
import compbio.util.Util;\r
\r
writer.println(OK);\r
}\r
succeed = true;\r
- } catch (UnsupportedRuntimeException e) {\r
- writer.println(FAILED);\r
- // If executable is not supported than none of the presets are\r
- // going to work\r
- throw new UnsupportedRuntimeException(e);\r
- } catch (JobSubmissionException e) {\r
- // TODO custom message\r
- writer.println(FAILED);\r
- writer.println();\r
- writer.println(e.getLocalizedMessage());\r
- e.printStackTrace(writer);\r
- continue;\r
- } catch (WrongParameterException e) {\r
- // TODO custom message\r
- writer.println(FAILED);\r
- writer.println();\r
- writer.println(e.getLocalizedMessage());\r
- e.printStackTrace(writer);\r
- continue;\r
- } catch (ResultNotAvailableException e) {\r
- // TODO custom message\r
- writer.println(FAILED);\r
- writer.println();\r
- writer.println(e.getLocalizedMessage());\r
- e.printStackTrace(writer);\r
+ } catch (Exception e) {\r
+ if (e instanceof UnsupportedRuntimeException) {\r
+ // If executable is not supported than none of the presets\r
+ // are\r
+ // going to work\r
+ throw (UnsupportedRuntimeException) e;\r
+ } else {\r
+ reportException(e);\r
+ }\r
continue;\r
}\r
}\r
+ wservice.getClass() + " is not supported! ");\r
}\r
} catch (UnsupportedRuntimeException e) {\r
- writer.println(e.getLocalizedMessage());\r
- e.printStackTrace(writer);\r
+ reportException(e);\r
return false;\r
}\r
}\r
\r
private <T> boolean testSequenceAnnotationWS(SequenceAnnotation<T> wservice)\r
throws UnsupportedRuntimeException {\r
- writer.println("Calling analyse.........");\r
+ writer.print("Calling analyse.........");\r
boolean success = testDefaultAnalyse(loadAlignment(), wservice, null,\r
null);\r
\r
List<Preset<T>> presets = presetman.getPresets();\r
if (presets != null && !presets.isEmpty()) {\r
Preset<T> preset = presets.get(0);\r
- writer.println("Calling analyse with Preset.........");\r
+ writer.print("Calling analyse with Preset.........");\r
success = testDefaultAnalyse(loadAlignment(), wservice, preset,\r
null);\r
}\r
}\r
Thread.sleep(1000);\r
scores = wsproxy.getAnnotation(jobId);\r
-\r
- } catch (JobSubmissionException e) {\r
- writer.println("Exception while submitting job to a web server. "\r
- + "Exception details are below:");\r
- e.printStackTrace(writer);\r
- } catch (ResultNotAvailableException e) {\r
- writer.println("Exception while waiting for results. "\r
- + "Exception details are below:");\r
- e.printStackTrace(writer);\r
- } catch (InterruptedException e) {\r
- // ignore and propagate an interruption\r
- Thread.currentThread().interrupt();\r
- writer.println("Exception while waiting for results. "\r
- + "Exception details are below:");\r
- e.printStackTrace(writer);\r
- } catch (WrongParameterException e) {\r
- writer.println("Exception while parsing the web method input parameters. "\r
- + "Exception details are below:");\r
- e.printStackTrace(writer);\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
return scores != null;\r
}\r
\r
+ private void reportException(Exception e) {\r
+ writer.println(FAILED);\r
+ writer.println("Exception while waiting for results. "\r
+ + "Exception details are below:");\r
+ writer.println(e.getLocalizedMessage());\r
+ e.printStackTrace(writer);\r
+ }\r
+\r
private <T> void testMetadata(Metadata<T> msaws)\r
throws UnsupportedRuntimeException {\r
\r
if (e instanceof UnsupportedRuntimeException) {\r
throw (UnsupportedRuntimeException) e;\r
} else {\r
- writer.println(FAILED);\r
- writer.println(e.getLocalizedMessage());\r
- e.printStackTrace(writer);\r
+ reportException(e);\r
}\r
}\r
if (al != null) {\r
}\r
return succeed;\r
}\r
-\r
/**\r
* Test JWS2 web services\r
* \r