@Test public void testParse() { try { final InsertParserMultiple request1 = new InsertParserMultiple(); 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 InsertParserMultiple request1 = new InsertParserMultiple(); request1.parse(exampleBothEsMd.deepCopy()); assertNotNull(request1); assertTrue("Should refuse the request since ES is not allowed", request1.hasFullTextQuery()); final InsertMultiQuery insert = new InsertMultiQuery(); insert.addRoots("id0"); insert.addQueries(path("id1", "id2")); insert.addQueries( and().add(exists("mavar1"), missing("mavar2"), isNull("mavar3"), or().add(in("mavar4", 1, 2).add("maval1"), nin("mavar5", "maval2").add(true)))); insert.addQueries( not().add(size("mavar5", 5), gt("mavar6", 7), lte("mavar7", 8)) .setExactDepthLimit(4)); insert.addQueries(not() .add(eq("mavar8", 5), ne("mavar9", "ab"), range("mavar10", 12, true, 20, true)) .setDepthLimit(1)); insert.addQueries(matchPhrase("mavar11", "ceci est une phrase") .setRelativeDepthLimit(0)); insert.addQueries(matchPhrasePrefix("mavar11", "ceci est une phrase") .setMatchMaxExpansions(10) .setDepthLimit(0)); insert.addQueries(flt("ceci est une phrase", "mavar12", "mavar13") .setRelativeDepthLimit(1)); insert.addQueries(and().add(search("mavar13", "ceci est une phrase"), regex("mavar14", "^start?aa.*"))); insert.addQueries(and() .add(term("mavar14", "motMajuscule").add("mavar15", "simplemot"))); insert.addQueries( and().add(term("mavar16", "motMajuscule").add("mavar17", "simplemot"), or().add(eq("mavar19", "abcd"), match("mavar18", "quelques mots")))); insert.addQueries(regex("mavar14", "^start?aa.*")); insert.setMult(false); insert.setData(data); final InsertParserMultiple request2 = new InsertParserMultiple(); request2.parse(insert.getFinalInsert()); 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("Data should be equal", request1.getRequest().getData().toString() .equals(request2.getRequest().getData().toString())); assertTrue("OrderBy 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().getFinalInsert().toString(), request2.getRequest().getFinalInsert().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); internalParseInsert(); }
InsertParserMultiple extends RequestParserMultiple { @Override public void parse(final JsonNode request) throws InvalidParseOperationException { parseJson(request); internalParseInsert(); } }
InsertParserMultiple extends RequestParserMultiple { @Override public void parse(final JsonNode request) throws InvalidParseOperationException { parseJson(request); internalParseInsert(); } InsertParserMultiple();  InsertParserMultiple(VarNameAdapter adapter); }
InsertParserMultiple extends RequestParserMultiple { @Override public void parse(final JsonNode request) throws InvalidParseOperationException { parseJson(request); internalParseInsert(); } InsertParserMultiple();  InsertParserMultiple(VarNameAdapter adapter); @Override void parse(final JsonNode request); @Override String toString(); @Override InsertMultiQuery getRequest(); }
InsertParserMultiple extends RequestParserMultiple { @Override public void parse(final JsonNode request) throws InvalidParseOperationException { parseJson(request); internalParseInsert(); } InsertParserMultiple();  InsertParserMultiple(VarNameAdapter adapter); @Override void parse(final JsonNode request); @Override String toString(); @Override InsertMultiQuery getRequest();  }