Ejemplo n.º 1
0
  public void testTypes() throws Exception {
    assertTrue(!FilterUtils.areProperSubset(tf1, tf2));
    assertTrue(FilterUtils.areProperSubset(tf1, tf1));

    assertTrue(FilterUtils.areDisjoint(tf1, tf2));
    assertTrue(!FilterUtils.areDisjoint(tf1, tf1));
  }
Ejemplo n.º 2
0
 public void testParentAncestor() throws Exception {
   assertTrue(
       FilterUtils.areProperSubset(parent_cf_ComponentFeature, ancestor_cf_ComponentFeature));
   assertTrue(
       !FilterUtils.areProperSubset(ancestor_cf_ComponentFeature, parent_cf_ComponentFeature));
   assertTrue(
       FilterUtils.areDisjoint(ancestor_cf_ComponentFeature, not_ancestor_cf_ComponentFeature));
   assertTrue(
       FilterUtils.areDisjoint(not_ancestor_cf_ComponentFeature, parent_cf_ComponentFeature));
 }
Ejemplo n.º 3
0
  public void testNot() throws Exception {
    assertTrue(FilterUtils.areProperSubset(ntf1, ntf1));
    assertTrue(!FilterUtils.areDisjoint(ntf1, ntf1));

    assertTrue(FilterUtils.areDisjoint(tf1, ntf1));
    assertTrue(!FilterUtils.areProperSubset(tf1, ntf1));

    assertTrue(!FilterUtils.areDisjoint(tf2, ntf1));
    assertTrue(FilterUtils.areProperSubset(tf2, ntf1));
  }
Ejemplo n.º 4
0
  public void testByProperty() throws Exception {
    assertTrue("are disjoint: " + pf4 + ", " + pf5, FilterUtils.areDisjoint(pf4, pf5));
    assertTrue("not disjoint: " + pf4 + ", " + pf6, !FilterUtils.areDisjoint(pf4, pf6));
    assertTrue("not disjoint: " + pf5 + ", " + pf6, !FilterUtils.areDisjoint(pf5, pf6));

    assertTrue("not subset: " + pf4 + ", " + pf5, !FilterUtils.areProperSubset(pf4, pf5));
    assertTrue("not subset: " + pf4 + ", " + pf6, !FilterUtils.areProperSubset(pf4, pf6));
    assertTrue("not subset: " + pf5 + ", " + pf6, !FilterUtils.areProperSubset(pf5, pf6));

    assertTrue("are subset: " + pf4 + ", " + pf4, FilterUtils.areProperSubset(pf4, pf4));
  }
Ejemplo n.º 5
0
  public void testOr() throws Exception {
    assertTrue(FilterUtils.areProperSubset(tf1, tf1_or_tf2));
    assertTrue(!FilterUtils.areDisjoint(tf1, tf1_or_tf2));
    assertTrue(FilterUtils.areDisjoint(tf3, tf1_or_tf2));

    assertTrue(!FilterUtils.areProperSubset(tf1_or_tf2, tf2_or_tf3));
    assertTrue(!FilterUtils.areDisjoint(tf1_or_tf2, tf2_or_tf3));

    assertTrue(FilterUtils.areProperSubset(tf1_or_tf2, tf1_or_tf2_or_tf3));
    assertTrue(FilterUtils.areProperSubset(tf2_or_tf3, tf1_or_tf2_or_tf3));
    assertTrue(FilterUtils.areProperSubset(tf1_or_tf3, tf1_or_tf2_or_tf3));
  }
Ejemplo n.º 6
0
  public void testLocation() throws Exception {
    // Simple comparison of locations.

    assertTrue(FilterUtils.areProperSubset(olf1, olf1));
    assertTrue(!FilterUtils.areProperSubset(olf1, olf2));
    assertTrue(!FilterUtils.areDisjoint(olf1, olf1));

    // Assymetry between containment and overlapping

    assertTrue(FilterUtils.areProperSubset(clf1, olf1));
    assertTrue(!FilterUtils.areProperSubset(olf1, clf1));

    assertTrue(FilterUtils.areDisjoint(olf1, clf2));
    assertTrue(FilterUtils.areDisjoint(clf1, olf2));
  }
Ejemplo n.º 7
0
  public void testHasByProperty() throws Exception {
    assertTrue("not disjoint: " + pf1 + ", " + pf4, !FilterUtils.areDisjoint(pf1, pf4));
    assertTrue("not disjoint: " + pf2 + ", " + pf4, !FilterUtils.areDisjoint(pf2, pf4));
    assertTrue("not disjoint: " + pf3 + ", " + pf4, !FilterUtils.areDisjoint(pf3, pf4));

    assertTrue("not subset: " + pf1 + ", " + pf4, !FilterUtils.areProperSubset(pf1, pf4));
    assertTrue("are subset: " + pf4 + ", " + pf1, FilterUtils.areProperSubset(pf4, pf1));
    assertTrue("are subset: " + pf5 + ", " + pf1, FilterUtils.areProperSubset(pf5, pf1));
    assertTrue("not subset: " + pf6 + ", " + pf1, !FilterUtils.areProperSubset(pf6, pf1));

    assertTrue("not subset: " + pf2 + ", " + pf4, !FilterUtils.areProperSubset(pf2, pf4));
    assertTrue("not subset: " + pf4 + ", " + pf2, !FilterUtils.areProperSubset(pf4, pf2));
    assertTrue("not subset: " + pf5 + ", " + pf2, !FilterUtils.areProperSubset(pf5, pf2));
    assertTrue("are subset: " + pf6 + ", " + pf2, FilterUtils.areProperSubset(pf6, pf2));
  }
Ejemplo n.º 8
0
 public void testAndOr() throws Exception {
   assertTrue(FilterUtils.areProperSubset(pf1_and_tf1, pf1_AND_tf1_or_tf2));
   assertTrue(FilterUtils.areProperSubset(pf1_and_pf2_and_tf1, pf1_and_pf2_OR_tf1));
 }
Ejemplo n.º 9
0
  public void testAnd() throws Exception {
    // all_and_all vs all
    assertTrue(
        "are subset: " + all_and_all + ", " + FeatureFilter.all,
        FilterUtils.areProperSubset(all_and_all, FeatureFilter.all));
    assertTrue(
        "not disjoint: " + all_and_all + ", " + FeatureFilter.all,
        !FilterUtils.areDisjoint(all_and_all, FeatureFilter.all));
    assertTrue(
        "are subset: " + FeatureFilter.all + ", " + all_and_all,
        FilterUtils.areProperSubset(FeatureFilter.all, all_and_all));
    assertTrue(
        "not disjoint: " + FeatureFilter.all + ", " + all_and_all,
        !FilterUtils.areDisjoint(FeatureFilter.all, all_and_all));

    // all_and_all vs none
    assertTrue(
        "not subset: " + all_and_all + ", " + FeatureFilter.none,
        !FilterUtils.areProperSubset(all_and_all, FeatureFilter.none));
    assertTrue(
        "are disjoint: " + all_and_all + ", " + FeatureFilter.none,
        FilterUtils.areDisjoint(all_and_all, FeatureFilter.none));
    assertTrue(
        "are subset: " + FeatureFilter.none + ", " + all_and_all,
        FilterUtils.areProperSubset(FeatureFilter.none, all_and_all));
    assertTrue(
        "are disjoint: " + FeatureFilter.none + ", " + all_and_all,
        FilterUtils.areDisjoint(FeatureFilter.none, all_and_all));

    // all_and_none vs all
    assertTrue(
        "are subset: " + all_and_none + ", " + FeatureFilter.all,
        FilterUtils.areProperSubset(all_and_none, FeatureFilter.all));
    assertTrue(
        "are disjoint: " + all_and_none + ", " + FeatureFilter.all,
        FilterUtils.areDisjoint(all_and_none, FeatureFilter.all));
    assertTrue(
        "not subset: " + FeatureFilter.all + ", " + all_and_none,
        !FilterUtils.areProperSubset(FeatureFilter.all, all_and_none));
    assertTrue(
        "are disjoint: " + FeatureFilter.all + ", " + all_and_none,
        FilterUtils.areDisjoint(FeatureFilter.all, all_and_none));

    // all_and_none vs none
    assertTrue(
        "are subset: " + all_and_none + ", " + FeatureFilter.none,
        FilterUtils.areProperSubset(all_and_none, FeatureFilter.none));
    assertTrue(
        "are disjoint: " + all_and_none + ", " + FeatureFilter.none,
        FilterUtils.areDisjoint(all_and_none, FeatureFilter.none));
    assertTrue(
        "are subset: " + FeatureFilter.none + ", " + all_and_none,
        FilterUtils.areProperSubset(FeatureFilter.none, all_and_none));
    assertTrue(
        "are disjoint: " + FeatureFilter.none + ", " + all_and_none,
        FilterUtils.areDisjoint(FeatureFilter.none, all_and_none));

    // none_and_all vs all
    assertTrue(
        "are subset: " + none_and_all + ", " + FeatureFilter.all,
        FilterUtils.areProperSubset(none_and_all, FeatureFilter.all));
    assertTrue(
        "are disjoint: " + none_and_all + ", " + FeatureFilter.all,
        FilterUtils.areDisjoint(none_and_all, FeatureFilter.all));
    assertTrue(
        "not subset: " + FeatureFilter.all + ", " + none_and_all,
        !FilterUtils.areProperSubset(FeatureFilter.all, none_and_all));
    assertTrue(
        "are disjoint: " + FeatureFilter.all + ", " + none_and_all,
        FilterUtils.areDisjoint(FeatureFilter.all, none_and_all));

    // none_and_all vs none
    assertTrue(
        "are subset: " + none_and_all + ", " + FeatureFilter.none,
        FilterUtils.areProperSubset(none_and_all, FeatureFilter.none));
    assertTrue(
        "are disjoint: " + none_and_all + ", " + FeatureFilter.none,
        FilterUtils.areDisjoint(none_and_all, FeatureFilter.none));
    assertTrue(
        "are subset: " + FeatureFilter.none + ", " + none_and_all,
        FilterUtils.areProperSubset(FeatureFilter.none, none_and_all));
    assertTrue(
        "are disjoint: " + FeatureFilter.none + ", " + none_and_all,
        FilterUtils.areDisjoint(FeatureFilter.none, none_and_all));

    // none_and_none vs all
    assertTrue(
        "are subset: " + none_and_none + ", " + FeatureFilter.all,
        FilterUtils.areProperSubset(none_and_none, FeatureFilter.all));
    assertTrue(
        "are disjoint: " + none_and_none + ", " + FeatureFilter.all,
        FilterUtils.areDisjoint(none_and_none, FeatureFilter.all));
    assertTrue(
        "not subset: " + FeatureFilter.all + ", " + none_and_none,
        !FilterUtils.areProperSubset(FeatureFilter.all, none_and_none));
    assertTrue(
        "are disjoint: " + FeatureFilter.all + ", " + none_and_none,
        FilterUtils.areDisjoint(FeatureFilter.all, none_and_none));

    // none_and_none vs none
    assertTrue(
        "are subset: " + none_and_none + ", " + FeatureFilter.none,
        FilterUtils.areProperSubset(none_and_none, FeatureFilter.none));
    assertTrue(
        "are disjoint: " + none_and_none + ", " + FeatureFilter.none,
        FilterUtils.areDisjoint(none_and_none, FeatureFilter.none));
    assertTrue(
        "are subset: " + FeatureFilter.none + ", " + none_and_none,
        FilterUtils.areProperSubset(FeatureFilter.none, none_and_none));
    assertTrue(
        "are disjoint: " + FeatureFilter.none + ", " + none_and_none,
        FilterUtils.areDisjoint(FeatureFilter.none, none_and_none));

    // pf1_and_pf2 vs pf1, pf2
    assertTrue(
        "are subset: " + pf1_and_pf2 + ", " + pf1, FilterUtils.areProperSubset(pf1_and_pf2, pf1));
    assertTrue(
        "not disjoint: " + pf1_and_pf2 + ", " + pf1, !FilterUtils.areDisjoint(pf1_and_pf2, pf1));
    assertTrue(
        "are subset: " + pf1_and_pf2 + ", " + pf2, FilterUtils.areProperSubset(pf1_and_pf2, pf2));
    assertTrue(
        "not disjoint: " + pf1_and_pf2 + ", " + pf2, !FilterUtils.areDisjoint(pf1_and_pf2, pf2));

    assertTrue(
        "not subset: " + pf1_and_pf2 + ", " + pf3, !FilterUtils.areProperSubset(pf1_and_pf2, pf3));
    assertTrue(
        "not subset: " + pf2_and_pf3 + ", " + pf1_and_pf2,
        !FilterUtils.areProperSubset(pf2_and_pf3, pf1_and_pf2));
    assertTrue(
        "are subset: " + pf1_and_pf2_and_pf3 + ", " + pf1_and_pf2,
        FilterUtils.areProperSubset(pf1_and_pf2_and_pf3, pf1_and_pf2));
    assertTrue(
        "are subset: " + pf1_and_pf2_and_pf3 + ", " + pf2_and_pf3,
        FilterUtils.areProperSubset(pf1_and_pf2_and_pf3, pf2_and_pf3));

    assertTrue(
        "are subset: " + pf1_and_pf2_and_tf1 + ", " + pf1_and_pf2,
        FilterUtils.areProperSubset(pf1_and_pf2_and_tf1, pf1_and_pf2));
    assertTrue(
        "are subset: " + pf1_and_pf2_and_tf1 + ", " + pf1_and_tf1,
        FilterUtils.areProperSubset(pf1_and_pf2_and_tf1, pf1_and_tf1));

    assertTrue(
        "are disjoint: " + pf1_and_tf1 + ", " + tf2, FilterUtils.areDisjoint(pf1_and_tf1, tf2));
    assertTrue(
        "are disjoint: " + pf1_and_pf2_and_tf1 + ", " + tf2,
        FilterUtils.areDisjoint(pf1_and_pf2_and_tf1, tf2));
  }
Ejemplo n.º 10
0
 public void testByClass() throws Exception {
   assertTrue(FilterUtils.areProperSubset(cf_HomologyFeature, cf_StrandedFeature));
   assertTrue(FilterUtils.areProperSubset(cf_ComponentFeature, cf_StrandedFeature));
   assertTrue(FilterUtils.areDisjoint(cf_ComponentFeature, cf_HomologyFeature));
 }