modify test cases.

This commit is contained in:
Shinsuke Sugaya 2014-02-22 17:31:53 +09:00
parent 5d76801985
commit 681811e9b4
3 changed files with 8 additions and 3 deletions

View file

@ -40,7 +40,7 @@ import jp.sf.fess.entity.SearchQuery.SortField;
import jp.sf.fess.helper.BrowserTypeHelper;
import jp.sf.fess.helper.QueryHelper;
import jp.sf.fess.helper.RoleQueryHelper;
import jp.sf.fess.util.ComponentUtil;
import jp.sf.fess.helper.SystemHelper;
import jp.sf.fess.util.QueryUtil;
import jp.sf.fess.util.SearchParamMap;
@ -85,6 +85,9 @@ public class QueryHelperImpl implements QueryHelper, Serializable {
@Resource
protected RoleQueryHelper roleQueryHelper;
@Resource
protected SystemHelper systemHelper;
protected Set<String> apiResponseFieldSet;
protected String[] responseFields = new String[] { "id", "docId", "score",
@ -910,7 +913,7 @@ public class QueryHelperImpl implements QueryHelper, Serializable {
}
protected String getQueryLanguage() {
final String[] supportedLanguages = ComponentUtil.getSystemHelper()
final String[] supportedLanguages = systemHelper
.getSupportedLanguages();
if (supportedLanguages.length == 0) {
return null;

View file

@ -1809,7 +1809,7 @@ public class QueryHelperImplTest extends S2TestCase {
assertEquals("zh", queryHelperImpl.getQueryLanguage());
request.setLocale(Locale.CANADA_FRENCH);
assertEquals("fr", queryHelperImpl.getQueryLanguage());
request.setLocale(Locale.ENGLISH);
request.setLocale(new Locale("aa"));
assertNull(queryHelperImpl.getQueryLanguage());
}

View file

@ -2,6 +2,8 @@
<!DOCTYPE components PUBLIC "-//SEASAR//DTD S2Container 2.4//EN"
"http://www.seasar.org/dtd/components24.dtd">
<components>
<component name="systemHelper" class="jp.sf.fess.helper.SystemHelper">
</component>
<component name="queryHelper" class="jp.sf.fess.helper.impl.QueryHelperImpl">
</component>