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
15 import compbio.ws.client.WSTesterTester;
\r
17 public class CategoryTester {
\r
19 // test category membership from string constants
\r
20 RegistryWS registry = null;
\r
22 @BeforeTest(groups = AllTestSuit.test_group_webservices)
\r
23 public void setupTest() {
\r
26 * registry = Jws2Client .connectToRegistry(
\r
27 * "http://webserv1.cluster.lifesci.dundee.ac.uk:8089/jaba");
\r
29 registry = Jws2Client.connectToRegistry(WSTesterTester.SERVER);
\r
31 } catch (ConnectException e) {
\r
32 e.printStackTrace();
\r
33 Assert.fail(e.getMessage());
\r
34 } catch (WebServiceException e) {
\r
35 e.printStackTrace();
\r
36 Assert.fail(e.getMessage());
\r
42 * This test will FAIL unless a connection to a running JABAWS web server is
\r
45 @Test(groups = AllTestSuit.test_group_webservices)
\r
46 public void categoryTest() {
\r
47 Set<Category> servicecategories = registry.getServiceCategories();
\r
49 boolean found = false;
\r
50 for (Category svccategory : servicecategories) {
\r
52 Set<Services> catservices;
\r
54 for (String category : new String[]{Category.CATEGORY_ALIGNMENT,
\r
55 Category.CATEGORY_CONSERVATION, Category.CATEGORY_DISORDER}) {
\r
56 if (category.equals(svccategory.name)) {
\r
58 catservices = svccategory.getServices();
\r
59 System.out.println("Found " + catservices.size()
\r
60 + " services in category " + category
\r
61 + "(service category string " + svccategory + ")");
\r
66 Assert.fail("Could not match any category to one of the given category constants");
\r