X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;ds=inline;f=test%2Fjalview%2Fanalysis%2FGroupingTest.java;h=55823e41e5cfac41984be29047e87c561159c490;hb=0f68d9445845550e0e207334de23ac9e61024d22;hp=5c7a30543a64311fc31b2e3423992f3a43575d98;hpb=96817673359ec2199e0a9f7afab86bea4f2f1f38;p=jalview.git
diff --git a/test/jalview/analysis/GroupingTest.java b/test/jalview/analysis/GroupingTest.java
index 5c7a305..55823e4 100644
--- a/test/jalview/analysis/GroupingTest.java
+++ b/test/jalview/analysis/GroupingTest.java
@@ -1,3 +1,23 @@
+/*
+ * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
+ * Copyright (C) $$Year-Rel$$ The Jalview Authors
+ *
+ * This file is part of Jalview.
+ *
+ * Jalview is free software: you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation, either version 3
+ * of the License, or (at your option) any later version.
+ *
+ * Jalview is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty
+ * of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ * PURPOSE. See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with Jalview. If not, see .
+ * The Jalview Authors are detailed in the 'AUTHORS' file.
+ */
package jalview.analysis;
import jalview.datamodel.Alignment;
@@ -10,8 +30,8 @@ import jalview.datamodel.SequenceI;
import java.util.ArrayList;
import java.util.Arrays;
-import org.junit.Assert;
-import org.junit.Test;
+import org.testng.AssertJUnit;
+import org.testng.annotations.Test;
public class GroupingTest
{
@@ -25,19 +45,18 @@ public class GroupingTest
Sequence s5 = new Sequence("s5", "AAAADDEDTTEE");
- SequenceGroup sg1 = new SequenceGroup(Arrays.asList(new SequenceI[]
- { s1, s2 }), "Group1", null, false, false, false, 0, 5);
+ SequenceGroup sg1 = new SequenceGroup(Arrays.asList(new SequenceI[] { s1,
+ s2 }), "Group1", null, false, false, false, 0, 5);
- SequenceGroup sg2 = new SequenceGroup(Arrays.asList(new SequenceI[]
- { s3, s4, s5 }), "Group2", null, false, false, false, 0, 5);
+ SequenceGroup sg2 = new SequenceGroup(Arrays.asList(new SequenceI[] { s3,
+ s4, s5 }), "Group2", null, false, false, false, 0, 5);
- AlignmentI alignment = new Alignment(new SequenceI[]
- { s1, s2, s3, s4, s5 });
+ AlignmentI alignment = new Alignment(
+ new SequenceI[] { s1, s2, s3, s4, s5 });
- int[] positions = new int[]
- { 1, 7, 9 };
+ int[] positions = new int[] { 1, 7, 9 };
- @Test
+ @Test(groups = { "Functional" })
public void testMakeGroupsWithBoth()
{
ArrayList str = new ArrayList();
@@ -53,8 +72,7 @@ public class GroupingTest
SequenceGroup[] seqgroupsString = Grouping.makeGroupsFrom(
alignment.getSequencesArray(),
str.toArray(new String[str.size()]),
- Arrays.asList(new SequenceGroup[]
- { sg1, sg2 }));
+ Arrays.asList(new SequenceGroup[] { sg1, sg2 }));
ColumnSelection cs = new ColumnSelection();
for (int p : positions)
{
@@ -62,19 +80,19 @@ public class GroupingTest
}
SequenceGroup[] seqgroupsColSel = Grouping.makeGroupsFromCols(
alignment.getSequencesArray(), cs,
- Arrays.asList(new SequenceGroup[]
- { sg1, sg2 }));
- Assert.assertEquals(seqgroupsString.length, seqgroupsColSel.length);
+ Arrays.asList(new SequenceGroup[] { sg1, sg2 }));
+ AssertJUnit
+ .assertEquals(seqgroupsString.length, seqgroupsColSel.length);
for (int p = 0; p < seqgroupsString.length; p++)
{
- Assert.assertEquals(seqgroupsString[p].getName(),
+ AssertJUnit.assertEquals(seqgroupsString[p].getName(),
seqgroupsColSel[p].getName());
- Assert.assertArrayEquals(
+ AssertJUnit.assertArrayEquals(
seqgroupsString[p].getSequencesInOrder(alignment),
seqgroupsColSel[p].getSequencesInOrder(alignment));
if (seqgroupsString[p].getSequences().contains(s2))
{
- Assert.assertTrue(seqgroupsString[p].getSize() == 2);
+ AssertJUnit.assertTrue(seqgroupsString[p].getSize() == 2);
}
}
}