@Test public void testParse() { try { final DeleteParserMultiple request1 = new DeleteParserMultiple(); request1.parse(exampleBothEsMd.deepCopy()); assertTrue("Should refuse the request since ES is not allowed", request1.hasFullTextQuery()); request1.parse(exampleMd.deepCopy()); assertFalse("Should accept the request since ES is not allowed", request1.hasFullTextQuery()); } catch (final Exception e) {} try { final DeleteParserMultiple request1 = new DeleteParserMultiple(); request1.parse(exampleBothEsMd.deepCopy()); assertNotNull(request1); assertTrue("Should refuse the request since ES is not allowed", request1.hasFullTextQuery()); final DeleteMultiQuery delete = new DeleteMultiQuery(); delete.addRoots("id0"); delete.addQueries(path("id1", "id2")); delete.addQueries( and().add(exists("mavar1"), missing("mavar2"), isNull("mavar3"), or().add(in("mavar4", 1, 2).add("maval1"), nin("mavar5", "maval2").add(true)))); delete.addQueries( not().add(size("mavar5", 5), gt("mavar6", 7), lte("mavar7", 8)) .setExactDepthLimit(4)); delete.addQueries(not() .add(eq("mavar8", 5), ne("mavar9", "ab"), range("mavar10", 12, true, 20, true)) .setDepthLimit(1)); delete.addQueries(matchPhrase("mavar11", "ceci est une phrase") .setRelativeDepthLimit(0)); delete.addQueries(matchPhrasePrefix("mavar11", "ceci est une phrase") .setMatchMaxExpansions(10) .setDepthLimit(0)); delete.addQueries(flt("ceci est une phrase", "mavar12", "mavar13") .setRelativeDepthLimit(1)); delete.addQueries(and().add(search("mavar13", "ceci est une phrase"), regex("mavar14", "^start?aa.*"))); delete.addQueries(and() .add(term("mavar14", "motMajuscule").add("mavar15", "simplemot"))); delete.addQueries( and().add(term("mavar16", "motMajuscule").add("mavar17", "simplemot"), or().add(eq("mavar19", "abcd"), match("mavar18", "quelques mots")))); delete.addQueries(regex("mavar14", "^start?aa.*")); delete.setMult(false); final DeleteParserMultiple request2 = new DeleteParserMultiple(); request2.parse(delete.getFinalDelete()); assertNotNull(request2); final List<Query> query1 = request1.getRequest().getQueries(); final List<Query> query2 = request2.getRequest().getQueries(); for (int i = 0; i < query1.size(); i++) { if (!query1.get(i).toString().equals(query2.get(i).toString())) { System.err.println(query1.get(i)); System.err.println(query2.get(i)); } assertEquals("TypeRequest should be equal", query1.get(i).toString(), query2.get(i).toString()); } assertTrue("Filter should be equal", request1.getRequest().getFilter().toString() .equals(request2.getRequest().getFilter().toString())); assertEquals(request1.getLastDepth(), request2.getLastDepth()); assertEquals(request1.hasFullTextQuery(), request2.hasFullTextQuery()); assertEquals(request1.getRequest().getRoots().toString(), request2.getRequest().getRoots().toString()); assertEquals(request1.getRequest().getFinalDelete().toString(), request2.getRequest().getFinalDelete().toString()); assertTrue("Command should be equal", request1.toString().equals(request2.toString())); } catch (final Exception e) { e.printStackTrace(); fail(e.getMessage()); } }
@Override public void parse(final JsonNode request) throws InvalidParseOperationException { parseJson(request); }
DeleteParserMultiple extends RequestParserMultiple { @Override public void parse(final JsonNode request) throws InvalidParseOperationException { parseJson(request); } }
DeleteParserMultiple extends RequestParserMultiple { @Override public void parse(final JsonNode request) throws InvalidParseOperationException { parseJson(request); } DeleteParserMultiple();  DeleteParserMultiple(VarNameAdapter adapter); }
DeleteParserMultiple extends RequestParserMultiple { @Override public void parse(final JsonNode request) throws InvalidParseOperationException { parseJson(request); } DeleteParserMultiple();  DeleteParserMultiple(VarNameAdapter adapter); @Override void parse(final JsonNode request); @Override String toString(); @Override DeleteMultiQuery getRequest(); }
DeleteParserMultiple extends RequestParserMultiple { @Override public void parse(final JsonNode request) throws InvalidParseOperationException { parseJson(request); } DeleteParserMultiple();  DeleteParserMultiple(VarNameAdapter adapter); @Override void parse(final JsonNode request); @Override String toString(); @Override DeleteMultiQuery getRequest();  }