@Test public void testFilterParse() { final SelectParserMultiple request = new SelectParserMultiple(); final SelectMultiQuery select = new SelectMultiQuery(); try { request.filterParse(select.getFilter()); assertNull("Hint should be null", request.getRequest().getFilter().get(SELECTFILTER.HINT.exactToken())); assertNotNull("Limit should not be null", request.getRequest().getFilter() .get(SELECTFILTER.LIMIT.exactToken())); assertNull("Offset should be null", request.getRequest().getFilter() .get(SELECTFILTER.OFFSET.exactToken())); assertNull("OrderBy should be null", request.getRequest().getFilter() .get(SELECTFILTER.ORDERBY.exactToken())); select.addHintFilter(FILTERARGS.CACHE.exactToken()); request.filterParse(select.getFilter()); assertEquals("Hint should be True", FILTERARGS.CACHE.exactToken(), request.getRequest().getFilter().get(SELECTFILTER.HINT.exactToken()) .get(0).asText()); select.resetHintFilter(); request.filterParse(select.getFilter()); assertNull("Hint should be null", request.getRequest().getFilter().get(SELECTFILTER.HINT.exactToken())); select.setLimitFilter(0, 1000); request.filterParse(select.getFilter()); assertEquals(1000, request.getRequest().getFilter().get(SELECTFILTER.LIMIT.exactToken()) .asLong()); assertNull("Offset should be null", request.getRequest().getFilter() .get(SELECTFILTER.OFFSET.exactToken())); select.setLimitFilter(100, 0); request.filterParse(select.getFilter()); assertEquals(100, request.getRequest().getFilter().get(SELECTFILTER.OFFSET.exactToken()) .asLong()); assertEquals(GlobalDatas.LIMIT_LOAD, request.getRequest().getFilter().get(SELECTFILTER.LIMIT.exactToken()) .asLong()); select.addOrderByAscFilter("var1", "var2").addOrderByDescFilter("var3"); request.filterParse(select.getFilter()); assertNotNull("OrderBy should not be null", request.getRequest().getFilter() .get(SELECTFILTER.ORDERBY.exactToken())); assertEquals(3, request.getRequest().getFilter() .get(SELECTFILTER.ORDERBY.exactToken()).size()); for (final Iterator<Entry<String, JsonNode>> iterator = request.getRequest().getFilter() .get(SELECTFILTER.ORDERBY.exactToken()).fields(); iterator .hasNext();) { final Entry<String, JsonNode> entry = iterator.next(); if (entry.getKey().equals("var1")) { assertEquals(1, entry.getValue().asInt()); } if (entry.getKey().equals("var2")) { assertEquals(1, entry.getValue().asInt()); } if (entry.getKey().equals("var3")) { assertEquals(-1, entry.getValue().asInt()); } } select.resetOrderByFilter(); request.filterParse(select.getFilter()); assertNull("OrderBy should be null", request.getRequest().getFilter() .get(SELECTFILTER.ORDERBY.exactToken())); } catch (final InvalidParseOperationException e) { e.printStackTrace(); fail(e.getMessage()); } }
@Override public SelectMultiQuery getRequest() { return (SelectMultiQuery) request; }
SelectParserMultiple extends RequestParserMultiple { @Override public SelectMultiQuery getRequest() { return (SelectMultiQuery) request; } }
SelectParserMultiple extends RequestParserMultiple { @Override public SelectMultiQuery getRequest() { return (SelectMultiQuery) request; } SelectParserMultiple();  SelectParserMultiple(VarNameAdapter adapter); }
SelectParserMultiple extends RequestParserMultiple { @Override public SelectMultiQuery getRequest() { return (SelectMultiQuery) request; } SelectParserMultiple();  SelectParserMultiple(VarNameAdapter adapter); @Override void parse(final JsonNode request); @Override void parseQueryOnly(final String query); static final FACET getFacetCommand(final JsonNode facet); @Override SelectMultiQuery getRequest(); }
SelectParserMultiple extends RequestParserMultiple { @Override public SelectMultiQuery getRequest() { return (SelectMultiQuery) request; } SelectParserMultiple();  SelectParserMultiple(VarNameAdapter adapter); @Override void parse(final JsonNode request); @Override void parseQueryOnly(final String query); static final FACET getFacetCommand(final JsonNode facet); @Override SelectMultiQuery getRequest();  }