@Test
public void testBuildResultfromThTable() throws Exception {

    this.settingManager.setValue(Settings.SYSTEM_ENABLE_ALL_THESAURUS, false);
    final int numThesaurus = this.thesaurusManager.getThesauriMap().size();
    Element element = this.thesaurusManager.buildResultfromThTable(createServiceContext());
    assertEquals(numThesaurus, Xml.selectNodes(element, "thesaurus").size());
    this.settingManager.setValue(Settings.SYSTEM_ENABLE_ALL_THESAURUS, true);
    element = this.thesaurusManager.buildResultfromThTable(createServiceContext());
    assertEquals(numThesaurus + 1, Xml.selectNodes(element, "thesaurus").size());
    this.settingManager.setValue(Settings.SYSTEM_ENABLE_ALL_THESAURUS, false);
    element = this.thesaurusManager.buildResultfromThTable(createServiceContext());
    assertEquals(numThesaurus, Xml.selectNodes(element, "thesaurus").size());
}