@Test public void testWrongParseSelect() throws InvalidParseOperationException, InvalidCreateOperationException { final SelectParserMultiple request = new SelectParserMultiple(); String s = "{\"$roots\":[]," + "\"$query\":[{\"$and\":[{\"$and\":[{\"$term\":{\"_id\":\"value1\"}},{\"$gte\":{\"var02\":3}}]}," + "{\"$eq\":{\"var5\":\"value\"}}]}," + "{\"$and\":[{\"$term\":{\"var11\":\"value2\"}},{\"$gte\":{\"var12\":4}}]}]," + "\"$filter\":{\"$limit\":10000,\"$orderby\":{\"var1\":1,\"var2\":-1}}," + "\"$projection\":{\"$fields\":{\"var3\":1,\"var4\":0}}}"; try { request.parse(JsonHandler.getFromString(s)); fail("Should fail"); } catch (final InvalidParseOperationException e) { } s = "{\"$roots\":[]," + "\"$query\":[{\"$and\":[{\"$and\":[{\"$term\":{\"var01\":\"value1\"}},{\"$gte\":{\"var02\":3}}]}," + "{\"$eq\":{\"var5\":\"value\"}}]}," + "{\"$and\":[{\"$term\":{\"var11\":\"value2\"}},{\"$gte\":{\"var12\":4}}]}]," + "\"$filter\":{\"$limit\":10000,\"$orderby\":{\"var1\":1,\"var2\":-1}}," + "\"$projection\":{\"$fields\":{\"_id\":1,\"var4\":0}}}"; try { request.parse(JsonHandler.getFromString(s)); fail("Should fail"); } catch (final InvalidParseOperationException e) { } s = "{\"$roots\":[]," + "\"$query\":[{\"$and\":[{\"$and\":[{\"$term\":{\"var01\":\"value1\"}},{\"$gte\":{\"var02\":3}}]}," + "{\"$eq\":{\"var5\":\"value\"}}]}," + "{\"$and\":[{\"$term\":{\"var11\":\"value2\"}},{\"$gte\":{\"var12\":4}}]}]," + "\"$filter\":{\"$limit\":10000,\"$orderby\":{\"_id\":1,\"var2\":-1}}," + "\"$projection\":{\"$fields\":{\"var3\":1,\"var4\":0}}}"; try { request.parse(JsonHandler.getFromString(s)); fail("Should fail"); } catch (final InvalidParseOperationException e) { } s = "{\"$roots\":[]," + "\"$query\":[{\"$eq\":{\"var5\":\"value\"}}]," + "\"$filter\":{\"$limit\":10000}," + "\"$projection\":{\"$fields\":{\"var3\":1,\"var4\":0}}," + "\"$facets\":[{\"$name\":\"myFacet\"]}"; try { request.parse(JsonHandler.getFromString(s)); fail("Should fail"); } catch (final InvalidParseOperationException e) { } s = "{\"$roots\":[]," + "\"$query\":[{\"$eq\":{\"var5\":\"value\"}}]," + "\"$filter\":{\"$limit\":10000}," + "\"$projection\":{\"$fields\":{\"var3\":1,\"var4\":0}}," + "\"$facets\":[{\"$name\":\"mafacet\", \"$terms\":{\"$field\":\"mavar1\"}}]}"; try { request.parse(JsonHandler.getFromString(s)); fail("Should fail"); } catch (final InvalidParseOperationException e) { } s = "{\"$roots\":[]," + "\"$query\":[{\"$eq\":{\"var5\":\"value\"}}]," + "\"$filter\":{\"$limit\":10000}," + "\"$projection\":{\"$fields\":{\"var3\":1,\"var4\":0}}," + "\"$facets\":[{\"$name\":\"mafacet\", \"$terms\":{\"$field\":\"mavar1\",\"$order\":\"ASC\"}}]}"; try { request.parse(JsonHandler.getFromString(s)); fail("Should fail"); } catch (final InvalidParseOperationException e) { } s = "{\"$roots\":[]," + "\"$query\":[{\"$eq\":{\"var5\":\"value\"}}]," + "\"$filter\":{\"$limit\":10000}," + "\"$projection\":{\"$fields\":{\"var3\":1,\"var4\":0}}," + "\"$facets\":[{\"$name\":\"mafacet\", \"$terms\":{\"$field\":\"mavar1\",\"$size\":1}}]}"; try { request.parse(JsonHandler.getFromString(s)); fail("Should fail"); } catch (final InvalidParseOperationException e) { } }
@Override public void parse(final JsonNode request) throws InvalidParseOperationException { parseJson(request); internalParseSelect(); }
SelectParserMultiple extends RequestParserMultiple { @Override public void parse(final JsonNode request) throws InvalidParseOperationException { parseJson(request); internalParseSelect(); } }
SelectParserMultiple extends RequestParserMultiple { @Override public void parse(final JsonNode request) throws InvalidParseOperationException { parseJson(request); internalParseSelect(); } SelectParserMultiple();  SelectParserMultiple(VarNameAdapter adapter); }
SelectParserMultiple extends RequestParserMultiple { @Override public void parse(final JsonNode request) throws InvalidParseOperationException { parseJson(request); internalParseSelect(); } 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 void parse(final JsonNode request) throws InvalidParseOperationException { parseJson(request); internalParseSelect(); } 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();  }