assertNull(QueryTranslator.translateHttpSearchRequest(this.schema,this.parameterMap,null));
String contentQuery = "content1 -content2 \"exact Content\"";
parameterMap.put("q", new String[]{contentQuery});
String expected = CONTENT_FIELD+":("+contentQuery+") ";
assertEquals(expected,QueryTranslator.translateHttpSearchRequest(this.schema,this.parameterMap,null));
parameterMap.put("updated-min", new String[]{"2005-08-09T10:57:00-08:00"});
parameterMap.put("updated-max", new String[]{"2005-10-09T10:57:00-08:00"});
parameterMap.put("max-results", new String[]{"3"});
parameterMap.remove("q");
parameterMap.put(CONTENT_FIELD, new String[]{"apache"});
String tranlatedQuery = QueryTranslator.translateHttpSearchRequest(this.schema,this.parameterMap,"test |{urn:google.com} {urn:apache.org}");
assertTrue(tranlatedQuery.contains("updated:[1123613820000 TO 1128884219999]"));
assertTrue(tranlatedQuery.contains(CONTENT_FIELD+":(apache)"));
parameterMap.remove("updated-max");
tranlatedQuery = QueryTranslator.translateHttpSearchRequest(this.schema,this.parameterMap,"test |{urn:google.com} {urn:apache.org}");
assertTrue(tranlatedQuery.contains("updated:[1123613820000 TO "+Long.MAX_VALUE+"]"));
assertTrue(tranlatedQuery.contains(CONTENT_FIELD+":(apache)"));
parameterMap.put("updated-max", new String[]{"2005-10-09T10:57:00-08:00"});
parameterMap.remove("updated-min");
tranlatedQuery = QueryTranslator.translateHttpSearchRequest(this.schema,this.parameterMap,"test |{urn:google.com} {urn:apache.org}");
assertTrue(tranlatedQuery.contains("updated:["+0+" TO 1128884219999]"));
assertTrue(tranlatedQuery.contains(CONTENT_FIELD+":(apache)"));
parameterMap.put("wrong-parameter", new String[]{"3"});
try{
QueryTranslator.translateHttpSearchRequest(this.schema,this.parameterMap,"test |{urn:google.com} {urn:apache.org}");
fail("illegal parameter");
}catch (RuntimeException e) {
}