package compbio.ws.server; import static org.testng.Assert.assertEquals; import static org.testng.Assert.assertNotNull; import static org.testng.Assert.assertTrue; import static org.testng.Assert.fail; import java.util.EnumSet; import org.testng.annotations.Test; import compbio.metadata.AllTestSuit; import compbio.ws.client.Jws2Client; import compbio.ws.client.Services; import compbio.ws.client.WSTesterTester; public class RegistryWSTester { @Test(groups = {AllTestSuit.test_group_webservices}) public void testGetSupportedServices() { compbio.data.msa.RegistryWS reg = Jws2Client .connectToRegistry(WSTesterTester.SERVER); assertEquals(EnumSet.of(Services.AAConWS, Services.JronnWS, Services.MuscleWS, Services.ClustalWS), reg.getSupportedServices()); } @Test(groups = {AllTestSuit.test_group_webservices}) public void testTestService() { compbio.data.msa.RegistryWS reg = Jws2Client .connectToRegistry(WSTesterTester.SERVER); assertNotNull(reg.testService(Services.AAConWS)); } @Test(dependsOnMethods = {"testTestService"},groups = {AllTestSuit.test_group_webservices}) public void testIsOperating() { compbio.data.msa.RegistryWS reg = Jws2Client .connectToRegistry(WSTesterTester.SERVER); assertTrue(reg.isOperating(Services.AAConWS)); } @Test(dependsOnMethods = {"testTestService"},groups = {AllTestSuit.test_group_webservices}) public void testGetLastTestedOn() { compbio.data.msa.RegistryWS reg = Jws2Client .connectToRegistry(WSTesterTester.SERVER); assertNotNull(reg.getLastTestedOn(Services.AAConWS)); } @Test(dependsOnMethods = {"testTestService"},groups = {AllTestSuit.test_group_webservices}) public void testGetLastTested() { try { Thread.sleep(1000); } catch (InterruptedException e) { e.printStackTrace(); fail(e.getMessage()); } compbio.data.msa.RegistryWS reg = Jws2Client .connectToRegistry(WSTesterTester.SERVER); System.out.println(reg.getLastTested(Services.AAConWS)); assertTrue(reg.getLastTested(Services.AAConWS) > 0); } @Test(groups = {AllTestSuit.test_group_webservices}) public void testTestAllServices() { compbio.data.msa.RegistryWS reg = Jws2Client .connectToRegistry(WSTesterTester.SERVER); System.out.println(reg.testAllServices()); } }