import java.util.Arrays;
import java.util.List;
-import junit.extensions.PA;
-
import org.testng.annotations.Test;
+import junit.extensions.PA;
+
public class AlignmentSorterTest
{
@Test(groups = "Functional")
/*
* sort with no score features does nothing
*/
- PA.setValue(AlignmentSorter.class, "lastSortByFeatureScore", null);
+ AlignmentSorter sorter = (AlignmentSorter) PA
+ .invokeMethod(AlignmentSorter.class, "getInstance()",
+ new Object[] {});
+ PA.setValue(sorter, "sortByFeatureCriteria", null);
- AlignmentSorter.sortByFeature((String) null, null, 0, al.getWidth(),
- al,
+ AlignmentSorter.sortByFeature(null, null, 0, al.getWidth(), al,
AlignmentSorter.FEATURE_SCORE);
assertSame(al.getSequenceAt(0), seq1);
assertSame(al.getSequenceAt(1), seq2);
* sort by ascending score, no filter on feature type or group
* NB sort order for the same feature set (none) gets toggled, so descending
*/
- PA.setValue(AlignmentSorter.class, "sortByFeatureScoreAscending", true);
- AlignmentSorter.sortByFeature((String) null, null, 0, al.getWidth(),
- al, AlignmentSorter.FEATURE_SCORE);
+ PA.setValue(sorter, "sortByFeatureAscending", true);
+ AlignmentSorter.sortByFeature(null, null, 0, al.getWidth(), al,
+ AlignmentSorter.FEATURE_SCORE);
assertSame(al.getSequenceAt(3), seq3); // -0.5
assertSame(al.getSequenceAt(2), seq2); // 2.5
assertSame(al.getSequenceAt(1), seq1); // 3.0
/*
* repeat sort toggles order - now ascending
*/
- AlignmentSorter.sortByFeature((String) null, null, 0, al.getWidth(),
- al, AlignmentSorter.FEATURE_SCORE);
+ AlignmentSorter.sortByFeature(null, null, 0, al.getWidth(), al,
+ AlignmentSorter.FEATURE_SCORE);
assertSame(al.getSequenceAt(0), seq3); // -0.5
assertSame(al.getSequenceAt(1), seq2); // 2.5
assertSame(al.getSequenceAt(2), seq1); // 3.0
*/
// fails because seq1.findPosition(4) returns 4
// although residue 4 is in column 5! - JAL-2544
- AlignmentSorter.sortByFeature((String) null, null, 0, 4, al,
+ AlignmentSorter.sortByFeature(null, null, 0, 4, al,
AlignmentSorter.FEATURE_SCORE);
assertSame(al.getSequenceAt(0), seq3); // -4
assertSame(al.getSequenceAt(1), seq1); // 2.0