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.metadata.AllTestSuit;
\r
13 import compbio.ws.client.Jws2Client;
\r
14 import compbio.ws.client.Services;
\r
16 public class CategoryTester {
\r
18 // test category membership from string constants
\r
19 compbio.data.msa.RegistryWS registry = null;
\r
21 @BeforeTest(groups = AllTestSuit.test_group_webservices)
\r
22 public void setupTest() {
\r
25 * registry = Jws2Client .connectToRegistry(
\r
26 * "http://webserv1.cluster.lifesci.dundee.ac.uk:8089/jaba");
\r
28 registry = Jws2Client
\r
29 .connectToRegistry("http://localhost:8080/jabaws");
\r
30 } catch (ConnectException e) {
\r
31 e.printStackTrace();
\r
32 Assert.fail(e.getMessage());
\r
33 } catch (WebServiceException e) {
\r
34 e.printStackTrace();
\r
35 Assert.fail(e.getMessage());
\r
41 * This test will FAIL unless a connection to a running JABAWS web server is
\r
44 @Test(groups = AllTestSuit.test_group_webservices)
\r
45 public void categoryTest() {
\r
46 Set<Category> servicecategories = registry.getServiceCategories();
\r
48 boolean found = false;
\r
49 for (Category svccategory : servicecategories) {
\r
51 Set<Services> catservices;
\r
53 for (String category : new String[]{Category.CATEGORY_ALIGNMENT,
\r
54 Category.CATEGORY_CONSERVATION, Category.CATEGORY_DISORDER}) {
\r
55 if (category.equals(svccategory.name)) {
\r
57 catservices = svccategory.getServices();
\r
58 System.out.println("Found " + catservices.size()
\r
59 + " services in category " + category
\r
60 + "(service category string " + svccategory + ")");
\r
66 "Could not match any category to one of the given category constants");
\r