JCRSessionWrapper session = JCRSessionFactory.getInstance().getCurrentUserSession(Constants.EDIT_WORKSPACE,
LanguageCodeConverters.languageCodeToLocale(DEFAULT_LANGUAGE));
// test i18n facets
QueryResultWrapper res = doQuery(session, "eventsType", "rep:facet(facet.query=0\\:FACET\\:eventsType:[a TO p]&facet.query=0\\:FACET\\:eventsType:[p TO z])");
Map<String,Long> queryFacet = res.getFacetQuery();
assertNotNull("Query facet result is null",queryFacet);
assertEquals("Query did not return correct number of facets", 2, queryFacet.size());
assertEquals("Facet count is incorrect", 10, queryFacet.get("0\\:FACET\\:eventsType:[a TO p]").longValue());
assertEquals("Facet count is incorrect", 17, queryFacet.get("0\\:FACET\\:eventsType:[p TO z]").longValue());
QueryResultWrapper resCheck = doQuery(session, "rep:filter()", "0\\:FACET\\:eventsType:[a TO p]");
checkResultSize(resCheck, 10);
resCheck = doQuery(session, "rep:filter()", "0\\:FACET\\:eventsType:[p TO z]");
checkResultSize(resCheck, 17);
res = doQuery(session, "startDate", "rep:facet(facet.query=0\\:FACET\\:startDate:[2000-01-01T00:00:00.000Z TO 2000-01-01T00:00:00.000Z+1MONTH]&facet.query=0\\:FACET\\:startDate:[2000-01-01T00:00:00.000Z+1MONTH TO 2000-01-01T00:00:00.000Z+2MONTH])");