import static org.testng.Assert.assertSame;
import static org.testng.Assert.assertTrue;
-import jalview.datamodel.SequenceFeature;
-
import java.util.ArrayList;
import java.util.List;
import java.util.Set;
import org.testng.annotations.Test;
+import jalview.datamodel.SequenceFeature;
+
public class FeatureStoreTest
{
}
@Test(groups = "Functional")
+ public void testFindFeatures_colocated()
+ {
+ FeatureStore fs = new FeatureStore();
+ SequenceFeature sf1 = new SequenceFeature("domain", "Cath", 10, 50, Float.NaN,
+ null);
+ fs.addFeature(sf1);
+ SequenceFeature sf2 = new SequenceFeature("domain", "Pfam", 10, 50, Float.NaN,
+ null);
+ fs.addFeature(sf2);
+ List<SequenceFeature> features = fs.findOverlappingFeatures(1, 100);
+
+ /*
+ * check co-located features are returned in the order they were added
+ */
+ assertEquals(features.size(), 2);
+ assertSame(features.get(0), sf1);
+ assertSame(features.get(1), sf2);
+ }
+
+ @Test(groups = "Functional")
public void testFindFeatures_mixed()
{
FeatureStore fs = new FeatureStore();