JAL-1782 JAL-1780 JAL-653 JAL-1892 update patched refactored test suite with TestNG
[jalview.git] / test / jalview / io / BioJsHTMLOutputTest.java
index ac2b599..8440b6d 100644 (file)
@@ -11,8 +11,9 @@ import java.net.URL;
 import java.net.URLConnection;
 import java.util.TreeMap;
 
-import org.junit.Assert;
-import org.junit.Test;
+import org.testng.Assert;
+import org.testng.AssertJUnit;
+import org.testng.annotations.Test;
 
 
 public class BioJsHTMLOutputTest
@@ -43,7 +44,7 @@ public class BioJsHTMLOutputTest
     Assert.assertNotNull(bjsTemplate);
   }
 
-  @Test(expected = NullPointerException.class)
+  @Test(expectedExceptions = NullPointerException.class)
   public void expectedNullPointerException()
   {
     try
@@ -51,7 +52,7 @@ public class BioJsHTMLOutputTest
       BioJsHTMLOutput.refreshBioJSVersionsInfo(null);
     } catch (URISyntaxException e)
     {
-      Assert.fail("Expception occured while testing!");
+      AssertJUnit.fail("Expception occured while testing!");
       e.printStackTrace();
     }
   }
@@ -67,11 +68,11 @@ public class BioJsHTMLOutputTest
       versions = BioJsHTMLOutput.getBioJsMSAVersions();
     } catch (URISyntaxException e)
     {
-      Assert.fail("Expception occured while testing!");
+      AssertJUnit.fail("Expception occured while testing!");
       e.printStackTrace();
     }
-    Assert.assertNotNull("No versions found", versions);
-    Assert.assertTrue("One or more Templates required", versions.size() > 0);
+    AssertJUnit.assertNotNull("No versions found", versions);
+    AssertJUnit.assertTrue("One or more Templates required", versions.size() > 0);
     System.out
             .println("Number of discovered versions : "
             + versions.size());
@@ -83,7 +84,7 @@ public class BioJsHTMLOutputTest
 
     System.out.println("\nCurrent latest version : "
             + BioJsHTMLOutput.getCurrentBJSTemplateFile());
-    Assert.assertNotNull("Latest BioJsMSA version NOT found!",
+    AssertJUnit.assertNotNull("Latest BioJsMSA version NOT found!",
             BioJsHTMLOutput.getCurrentBJSTemplateFile());
 
   }
@@ -92,9 +93,9 @@ public class BioJsHTMLOutputTest
   public void testBioJsUpdate()
   {
     String url = BioJsHTMLOutput.BJS_TEMPLATE_GIT_REPO;
-    Assert.assertTrue("URL not reacable : " + url, urlIsReachable(url));
+    AssertJUnit.assertTrue("URL not reacable : " + url, urlIsReachable(url));
     String response = BioJsHTMLOutput.getURLContentAsString(url);
-    Assert.assertNotNull("Null response read from url!", response);
+    AssertJUnit.assertNotNull("Null response read from url!", response);
     BioJSRepositoryPojo repository = new BioJSRepositoryPojo(response);
     System.out.println(">>> description : " + repository.getDescription());
     System.out