JAL-1805 modified test setup's so the are ran for groups which requires them
[jalview.git] / test / jalview / analysis / AlignmentAnnotationUtilsTest.java
index c34bb68..b68842a 100644 (file)
@@ -1,8 +1,14 @@
 package jalview.analysis;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
+import static org.testng.AssertJUnit.assertEquals;
+import static org.testng.AssertJUnit.assertFalse;
+import static org.testng.AssertJUnit.assertTrue;
+
+import jalview.datamodel.AlignmentAnnotation;
+import jalview.datamodel.AlignmentI;
+import jalview.datamodel.Annotation;
+import jalview.datamodel.SequenceI;
+import jalview.io.AppletFormatAdapter;
 
 import java.io.IOException;
 import java.util.ArrayList;
@@ -12,14 +18,8 @@ import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 
-import org.junit.Before;
-import org.junit.Test;
-
-import jalview.datamodel.AlignmentAnnotation;
-import jalview.datamodel.AlignmentI;
-import jalview.datamodel.Annotation;
-import jalview.datamodel.SequenceI;
-import jalview.io.AppletFormatAdapter;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
 
 public class AlignmentAnnotationUtilsTest
 {
@@ -45,7 +45,7 @@ public class AlignmentAnnotationUtilsTest
   /**
    * Test method that converts a (possibly null) array to a list.
    */
-  @Test
+  @Test(groups ={ "Functional" })
   public void testAsList()
   {
     // null array
@@ -118,7 +118,7 @@ public class AlignmentAnnotationUtilsTest
    * 
    * @throws IOException
    */
-  @Before
+ @BeforeMethod(alwaysRun = true)
   public void setUp() throws IOException
   {
     alignment = new jalview.io.FormatAdapter().readFile(TEST_DATA,
@@ -143,7 +143,7 @@ public class AlignmentAnnotationUtilsTest
   /**
    * Test a mixture of show/hidden annotations in/outside selection group.
    */
-  @Test
+  @Test(groups ={ "Functional" })
   public void testGetShownHiddenTypes_forSelectionGroup()
   {
     Map<String, List<List<String>>> shownTypes = new HashMap<String, List<List<String>>>();
@@ -222,7 +222,7 @@ public class AlignmentAnnotationUtilsTest
    * Test case where there are 'grouped' annotations, visible and hidden, within
    * and without the selection group.
    */
-  @Test
+  @Test(groups ={ "Functional" })
   public void testGetShownHiddenTypes_withGraphGroups()
   {
     final int GROUP_3 = 3;
@@ -348,7 +348,7 @@ public class AlignmentAnnotationUtilsTest
   /**
    * Test method that determines visible graph groups.
    */
-  @Test
+  @Test(groups ={ "Functional" })
   public void testGetVisibleGraphGroups()
   {
     AlignmentAnnotation[] anns = alignment.getAlignmentAnnotation();
@@ -395,7 +395,7 @@ public class AlignmentAnnotationUtilsTest
    * Test for case where no sequence is selected. Shouldn't normally arise but
    * check it handles it gracefully.
    */
-  @Test
+  @Test(groups ={ "Functional" })
   public void testGetShownHiddenTypes_noSequenceSelected()
   {
     Map<String, List<List<String>>> shownTypes = new HashMap<String, List<List<String>>>();