1 package compbio.data.msa;
\r
3 import java.net.ConnectException;
\r
4 import java.util.Set;
\r
6 import javax.xml.ws.WebServiceException;
\r
8 import org.testng.Assert;
\r
9 import org.testng.annotations.BeforeTest;
\r
10 import org.testng.annotations.Test;
\r
12 import compbio.ws.client.Jws2Client;
\r
13 import compbio.ws.client.Services;
\r
15 public class CategoryTester {
\r
17 // test category membership from string constants
\r
18 compbio.data.msa.RegistryWS registry = null;
\r
21 public void setupTest() {
\r
24 * registry = Jws2Client .connectToRegistry(
\r
25 * "http://webserv1.cluster.lifesci.dundee.ac.uk:8089/jaba");
\r
27 registry = Jws2Client
\r
28 .connectToRegistry("http://localhost:8080/jabaws");
\r
29 } catch (ConnectException e) {
\r
30 e.printStackTrace();
\r
31 Assert.fail(e.getMessage());
\r
32 } catch (WebServiceException e) {
\r
33 e.printStackTrace();
\r
34 Assert.fail(e.getMessage());
\r
39 public void categoryTest() {
\r
40 Set<Category> servicecategories = registry.getServiceCategories();
\r
42 boolean found = false;
\r
43 for (Category svccategory : servicecategories) {
\r
45 Set<Services> catservices;
\r
47 for (String category : new String[]{Category.CATEGORY_ALIGNMENT,
\r
48 Category.CATEGORY_CONSERVATION, Category.CATEGORY_DISORDER}) {
\r
49 if (category.equals(svccategory.name)) {
\r
51 catservices = svccategory.getServices();
\r
52 System.out.println("Found " + catservices.size()
\r
53 + " services in category " + category
\r
54 + "(service category string " + svccategory + ")");
\r
60 "Could not match any category to one of the given category constants");
\r