- /**
- * Tests for the method that returns false for an attempt to add a feature
- * that would enclose, or be enclosed by, another feature
- */
- @Test(groups = "Functional")
- public void testAddNonNestedFeature()
- {
- FeatureStore fs = new FeatureStore();
-
- String type = "Domain";
- SequenceFeature sf1 = new SequenceFeature(type, type, 10, 20,
- Float.NaN, null);
- assertTrue(fs.addNonNestedFeature(sf1));
-
- // co-located feature is ok
- SequenceFeature sf2 = new SequenceFeature(type, type, 10, 20,
- Float.NaN, null);
- assertTrue(fs.addNonNestedFeature(sf2));
-
- // overlap left is ok
- SequenceFeature sf3 = new SequenceFeature(type, type, 5, 15, Float.NaN,
- null);
- assertTrue(fs.addNonNestedFeature(sf3));
-
- // overlap right is ok
- SequenceFeature sf4 = new SequenceFeature(type, type, 15, 25,
- Float.NaN, null);
- assertTrue(fs.addNonNestedFeature(sf4));
-
- // add enclosing feature is not ok
- SequenceFeature sf5 = new SequenceFeature(type, type, 10, 21,
- Float.NaN, null);
- assertFalse(fs.addNonNestedFeature(sf5));
- SequenceFeature sf6 = new SequenceFeature(type, type, 4, 15, Float.NaN,
- null);
- assertFalse(fs.addNonNestedFeature(sf6));
- SequenceFeature sf7 = new SequenceFeature(type, type, 1, 50, Float.NaN,
- null);
- assertFalse(fs.addNonNestedFeature(sf7));
-
- // add enclosed feature is not ok
- SequenceFeature sf8 = new SequenceFeature(type, type, 10, 19,
- Float.NaN, null);
- assertFalse(fs.addNonNestedFeature(sf8));
- SequenceFeature sf9 = new SequenceFeature(type, type, 16, 25,
- Float.NaN, null);
- assertFalse(fs.addNonNestedFeature(sf9));
- SequenceFeature sf10 = new SequenceFeature(type, type, 7, 7, Float.NaN,
- null);
- assertFalse(fs.addNonNestedFeature(sf10));
- }
-