JAL-1270 JUnit to TestNG refactoring
[jalview.git] / test / jalview / io / JSONFileTest.java
index 92b172c..ec3f77b 100644 (file)
@@ -1,7 +1,11 @@
 package jalview.io;
 
 
-import static org.junit.Assert.assertNotNull;
+import static org.testng.AssertJUnit.assertNotNull;
+import org.testng.annotations.AfterMethod;
+import org.testng.annotations.Test;
+import org.testng.annotations.BeforeMethod;
+import org.testng.AssertJUnit;
 import jalview.datamodel.Alignment;
 import jalview.datamodel.AlignmentAnnotation;
 import jalview.datamodel.AlignmentI;
@@ -19,11 +23,6 @@ import java.io.IOException;
 import java.util.ArrayList;
 import java.util.HashMap;
 
-import org.junit.After;
-import org.junit.Assert;
-import org.junit.Before;
-import org.junit.Test;
-
 public class JSONFileTest
 {
 
@@ -43,7 +42,7 @@ public class JSONFileTest
   HashMap<String, AlignmentAnnotation> testAnnots = new HashMap<String, AlignmentAnnotation>();
   HashMap<String, SequenceGroup> testGrps = new HashMap<String, SequenceGroup>();
 
-  @Before
+  @BeforeMethod
   public void setup() throws Exception
   {
     // create and add sequences
@@ -146,7 +145,7 @@ public class JSONFileTest
     TEST_ANOT_HEIGHT = testAnnots.size();
   }
 
-  @After
+  @AfterMethod
   public void tearDown() throws Exception
   {
   }
@@ -171,34 +170,34 @@ public class JSONFileTest
     for (SequenceI seq : al.getSequences())
     {
       SequenceI expectedSeq = testSeqs.get(seq.getName());
-      Assert.assertTrue("Failed Sequence Test  for >>> " + seq.getName(),
+      AssertJUnit.assertTrue("Failed Sequence Test  for >>> " + seq.getName(),
               isSeqMatched(expectedSeq, seq));
       passedCount++;
     }
-    Assert.assertEquals("Some Sequences did not pass the test",
+    AssertJUnit.assertEquals("Some Sequences did not pass the test",
             TEST_SEQ_HEIGHT, passedCount);
 
     passedCount = 0;
     for (SequenceGroup seqGrp : al.getGroups())
     {
       SequenceGroup expectedGrp = testGrps.get(seqGrp.getName());
-      Assert.assertTrue(
+      AssertJUnit.assertTrue(
               "Failed SequenceGroup Test for >>> " + seqGrp.getName(),
               isGroupMatched(expectedGrp, seqGrp));
       passedCount++;
     }
-    Assert.assertEquals("Some SequenceGroups did not pass the test",
+    AssertJUnit.assertEquals("Some SequenceGroups did not pass the test",
             TEST_GRP_HEIGHT, passedCount);
 
     passedCount = 0;
     for (AlignmentAnnotation annot : al.getAlignmentAnnotation())
     {
       AlignmentAnnotation expectedAnnot = testAnnots.get(annot.label);
-      Assert.assertTrue("Failed AlignmentAnnotation Test for >>> "
+      AssertJUnit.assertTrue("Failed AlignmentAnnotation Test for >>> "
               + annot.label, isAnnotationMatched(expectedAnnot, annot));
       passedCount++;
     }
-    Assert.assertEquals("Some Sequences did not pass the test",
+    AssertJUnit.assertEquals("Some Sequences did not pass the test",
             TEST_ANOT_HEIGHT, passedCount);
 
     // af = new AlignFrame(al, 700, 500);