X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=test%2Fjalview%2Fext%2Fensembl%2FEnsemblRestClientTest.java;h=09d86f819691cdb5af4c148f7f5bde1a6bcd4e30;hb=57738a1f3c19b1c3a00bd3ac5108f8cd0af32f99;hp=31001da0d811a49420561d3076bc820943409350;hpb=604cbee405a837565ba1a74aa9bddd62aed685ab;p=jalview.git diff --git a/test/jalview/ext/ensembl/EnsemblRestClientTest.java b/test/jalview/ext/ensembl/EnsemblRestClientTest.java index 31001da..09d86f8 100644 --- a/test/jalview/ext/ensembl/EnsemblRestClientTest.java +++ b/test/jalview/ext/ensembl/EnsemblRestClientTest.java @@ -20,21 +20,40 @@ */ package jalview.ext.ensembl; +import static org.testng.Assert.assertTrue; + import jalview.datamodel.AlignmentI; import java.net.MalformedURLException; import java.net.URL; import java.util.List; +import org.testng.annotations.BeforeMethod; import org.testng.annotations.Test; public class EnsemblRestClientTest { + private EnsemblRestClient sf; @Test(suiteName = "live") public void testIsEnsemblAvailable() { - EnsemblRestClient sf = new EnsemblRestClient() + boolean isAvailable = sf.isEnsemblAvailable(); + if (isAvailable) + { + System.out.println("Ensembl is UP!"); + } + else + { + System.err.println( + "Ensembl is DOWN or unreachable ******************* BAD!"); + } + } + + @BeforeMethod(alwaysRun = true) + protected void setUp() + { + sf = new EnsemblRestClient() { @Override @@ -60,30 +79,15 @@ public class EnsemblRestClientTest { return false; } - - @Override - protected String getRequestMimeType(boolean b) - { - return null; - } - - @Override - protected String getResponseMimeType() - { - return null; - } - }; - boolean isAvailable = sf.isEnsemblAvailable(); - if (isAvailable) - { - System.out.println("Ensembl is UP!"); - } - else + } + + @Test(groups = "Network") + public void testCheckEnsembl_overload() + { + for (int i = 0; i < 20; i++) { - System.err - .println("Ensembl is DOWN or unreachable ******************* BAD!"); + assertTrue(sf.checkEnsembl(), "Error on " + (i + 1) + "th ping"); } } - }