-/* Copyright (c) 2009 Peter Troshin\r
+/* Copyright (c) 2011 Peter Troshin\r
* \r
- * JAva Bioinformatics Analysis Web Services (JABAWS) @version: 1.0 \r
+ * JAva Bioinformatics Analysis Web Services (JABAWS) @version: 2.0 \r
* \r
* This library is free software; you can redistribute it and/or modify it under the terms of the\r
* Apache License version 2 as published by the Apache Software Foundation\r
import java.io.Closeable;\r
import java.io.IOException;\r
import java.io.PrintWriter;\r
+import java.net.ConnectException;\r
import java.util.Arrays;\r
import java.util.List;\r
\r
+import javax.xml.ws.WebServiceException;\r
+\r
import org.apache.log4j.Logger;\r
\r
import compbio.data.msa.JABAService;\r
private final PrintWriter writer;\r
private final String hostname;\r
\r
+ /**\r
+ * Construct an instance of JABAWS tester\r
+ * \r
+ * @param hostname\r
+ * - fully qualified host and context name of JABAWS e.g.\r
+ * http://nanna.cluster.lifesci.dundee.ac.uk:8080/jaba\r
+ * @param writer\r
+ * a PrintWriter instance to writer test log to.\r
+ */\r
public WSTester(String hostname, PrintWriter writer) {\r
if (Util.isEmpty(hostname)) {\r
throw new NullPointerException("Hostname must be provided!");\r
\r
}\r
\r
- public boolean checkService(Services service) {\r
+ /**\r
+ * Test JABA web service\r
+ * \r
+ * @param service\r
+ * the service to test\r
+ * @return true if the service works as expected, false otherwise\r
+ * @throws WebServiceException\r
+ * @throws ConnectException\r
+ */\r
+ public boolean checkService(Services service) throws ConnectException,\r
+ WebServiceException {\r
JABAService ws = Jws2Client.connect(hostname, service);\r
if (ws == null) {\r
writer.println("Cannot estabilish the connection to host "\r