Class CommonalityRankingStrategyTest

java.lang.Object
ubic.gemma.rest.ranking.CommonalityRankingStrategyTest

public class CommonalityRankingStrategyTest extends Object
Pure-data tests for ?rank=commonality. No Spring, no database — the strategy is a scoring function over a hit list plus a prior map, so every case here is stated as literal counts.

The counts used are the ones measured against the production corpus (see the DAO javadoc), so a change that inverts one of these orderings is a real behavioural change, not a fixture artifact.

  • Constructor Details

    • CommonalityRankingStrategyTest

      public CommonalityRankingStrategyTest()
  • Method Details

    • prior_separates_two_legitimate_hits_that_usage_cannot

      @Test public void prior_separates_two_legitimate_hits_that_usage_cannot()
    • it_is_a_frequency_comparison_not_a_preference_for_synonyms

      @Test public void it_is_a_frequency_comparison_not_a_preference_for_synonyms()
    • a_low_prior_hit_can_still_be_overtaken_on_lucene_rank

      @Test public void a_low_prior_hit_can_still_be_overtaken_on_lucene_rank()
    • prior_is_scored_against_the_best_candidate_in_the_same_result_set

      @Test public void prior_is_scored_against_the_best_candidate_in_the_same_result_set()
    • systematic_chemical_names_are_demoted_when_the_corpus_is_silent

      @Test public void systematic_chemical_names_are_demoted_when_the_corpus_is_silent()
    • designation_penalty_does_not_fire_on_ordinary_names

      @Test public void designation_penalty_does_not_fire_on_ordinary_names()
    • ordering_is_stable_when_nothing_separates_the_hits

      @Test public void ordering_is_stable_when_nothing_separates_the_hits()
    • three_arg_overload_still_works_for_callers_that_have_no_prior

      @Test public void three_arg_overload_still_works_for_callers_that_have_no_prior()
    • strategy_declares_it_needs_the_prior_and_not_the_usage_counts

      @Test public void strategy_declares_it_needs_the_prior_and_not_the_usage_counts()