package jalview.analysis;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
-import jalview.datamodel.AlignmentAnnotation;
-import jalview.datamodel.AlignmentI;
-import jalview.datamodel.SequenceI;
-import jalview.io.AppletFormatAdapter;
-
+import static org.testng.AssertJUnit.assertEquals;
+import static org.testng.AssertJUnit.assertFalse;
+import static org.testng.AssertJUnit.assertTrue;
+import org.testng.annotations.Test;
+import org.testng.annotations.BeforeMethod;
import java.io.IOException;
import java.util.ArrayList;
import java.util.BitSet;
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;
public class AlignmentAnnotationUtilsTest
{
return result;
}
- @Before
+ /**
+ * Load the test alignment and generate annotations on it
+ *
+ * @throws IOException
+ */
+ @BeforeMethod
public void setUp() throws IOException
{
alignment = new jalview.io.FormatAdapter().readFile(TEST_DATA,
AlignmentAnnotation[] anns = new AlignmentAnnotation[SEQ_ANN_COUNT];
for (int i = 0; i < anns.length; i++)
{
- anns[i] = new AlignmentAnnotation("Label" + i, null, 0d);
+ /*
+ * Use the constructor for a positional annotation (with an Annotation
+ * array)
+ */
+ anns[i] = new AlignmentAnnotation("Label" + i, "Desc " + i,
+ new Annotation[]
+ {});
anns[i].setCalcId("CalcId" + i);
anns[i].visible = true;
alignment.addAnnotation(anns[i]);
anns[9].graph = AlignmentAnnotation.LINE_GRAPH;
anns[9].graphGroup = GROUP_4;
+ /*
+ * Generate annotations[] arrays to match aligned columns
+ */
+ // adjustForAlignment(anns);
+
List<SequenceI> selected = selectSequences(0, 3);
AlignmentAnnotationUtils.getShownHiddenTypes(shownTypes, hiddenTypes,
AlignmentAnnotationUtils.asList(anns),