X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=test%2Fjalview%2Fanalysis%2FAlignmentSorterTest.java;h=090ae1ac15373d4407869680947e0a8aec8ceef9;hb=709f51ae2e2c9e2b8d798300819c7e75b282bcfc;hp=0255f666bff7a03517b57f995126a8242bcde4b0;hpb=45715055c536e1c31020b8ab7ce30b2e28f3aafd;p=jalview.git diff --git a/test/jalview/analysis/AlignmentSorterTest.java b/test/jalview/analysis/AlignmentSorterTest.java index 0255f66..090ae1a 100644 --- a/test/jalview/analysis/AlignmentSorterTest.java +++ b/test/jalview/analysis/AlignmentSorterTest.java @@ -11,10 +11,10 @@ import jalview.datamodel.SequenceI; 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") @@ -31,7 +31,10 @@ public class AlignmentSorterTest /* * 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(null, null, 0, al.getWidth(), al, AlignmentSorter.FEATURE_SCORE); @@ -62,9 +65,9 @@ public class AlignmentSorterTest /* * sort by ascending score, no filter on feature type or group - * NB sort order for the same feature set (none) is toggled so descending + * NB sort order for the same feature set (none) gets toggled, so descending */ - PA.setValue(AlignmentSorter.class, "sortByFeatureScoreAscending", true); + PA.setValue(sorter, "sortByFeatureAscending", true); AlignmentSorter.sortByFeature(null, null, 0, al.getWidth(), al, AlignmentSorter.FEATURE_SCORE); assertSame(al.getSequenceAt(3), seq3); // -0.5 @@ -114,7 +117,7 @@ public class AlignmentSorterTest * seq1 is now 2.0, seq3 is now -4 */ // fails because seq1.findPosition(4) returns 4 - // although residue 4 is in column 5! + // although residue 4 is in column 5! - JAL-2544 AlignmentSorter.sortByFeature(null, null, 0, 4, al, AlignmentSorter.FEATURE_SCORE); assertSame(al.getSequenceAt(0), seq3); // -4