package jalview.io;
-import static org.junit.Assert.assertNotNull;
+import static org.testng.AssertJUnit.assertNotNull;
+
import jalview.datamodel.Alignment;
import jalview.datamodel.AlignmentAnnotation;
import jalview.datamodel.AlignmentI;
import java.util.ArrayList;
import java.util.HashMap;
-import org.junit.After;
-import org.junit.Assert;
-import org.junit.Before;
-import org.junit.Test;
+import org.testng.AssertJUnit;
+import org.testng.annotations.AfterMethod;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
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
TEST_ANOT_HEIGHT = testAnnots.size();
}
- @After
+ @AfterMethod
public void tearDown() throws Exception
{
}
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);