@Test public void testDataParse() { final InsertParserMultiple parser = new InsertParserMultiple(); final InsertMultiQuery insert = new InsertMultiQuery(); try { parser.dataParse(insert.getData()); assertEquals("Data should be empty", 0, parser.getRequest().getData().size()); parser.dataParse(data); insert.parseData(data.toString()); assertEquals(parser.getRequest().getFinalInsert().toString(), insert.getFinalInsert().toString()); } catch (final InvalidParseOperationException e) { e.printStackTrace(); fail(e.getMessage()); } JsonNode node; try { node = JsonHandler.getFromString("{#id: \"value\"}"); } catch (final InvalidParseOperationException e) { e.printStackTrace(); fail(e.getMessage()); return; } try { parser.dataParse(node); fail("Should Failed"); } catch (final InvalidParseOperationException e) {} }
protected void dataParse(final JsonNode rootNode) throws InvalidParseOperationException { if (rootNode == null) { throw new InvalidParseOperationException( "Parse in error for Insert: empty data"); } GlobalDatas.sanityValueCheck(rootNode.toString()); final JsonNode newRootNode = insertAdapter.getFixedVarNameJsonNode(rootNode); try { ((InsertMultiQuery) request).setData(newRootNode); } catch (final Exception e) { throw new InvalidParseOperationException( "Parse in error for Insert: " + rootNode, e); } }
InsertParserMultiple extends RequestParserMultiple { protected void dataParse(final JsonNode rootNode) throws InvalidParseOperationException { if (rootNode == null) { throw new InvalidParseOperationException( "Parse in error for Insert: empty data"); } GlobalDatas.sanityValueCheck(rootNode.toString()); final JsonNode newRootNode = insertAdapter.getFixedVarNameJsonNode(rootNode); try { ((InsertMultiQuery) request).setData(newRootNode); } catch (final Exception e) { throw new InvalidParseOperationException( "Parse in error for Insert: " + rootNode, e); } } }
InsertParserMultiple extends RequestParserMultiple { protected void dataParse(final JsonNode rootNode) throws InvalidParseOperationException { if (rootNode == null) { throw new InvalidParseOperationException( "Parse in error for Insert: empty data"); } GlobalDatas.sanityValueCheck(rootNode.toString()); final JsonNode newRootNode = insertAdapter.getFixedVarNameJsonNode(rootNode); try { ((InsertMultiQuery) request).setData(newRootNode); } catch (final Exception e) { throw new InvalidParseOperationException( "Parse in error for Insert: " + rootNode, e); } } InsertParserMultiple();  InsertParserMultiple(VarNameAdapter adapter); }
InsertParserMultiple extends RequestParserMultiple { protected void dataParse(final JsonNode rootNode) throws InvalidParseOperationException { if (rootNode == null) { throw new InvalidParseOperationException( "Parse in error for Insert: empty data"); } GlobalDatas.sanityValueCheck(rootNode.toString()); final JsonNode newRootNode = insertAdapter.getFixedVarNameJsonNode(rootNode); try { ((InsertMultiQuery) request).setData(newRootNode); } catch (final Exception e) { throw new InvalidParseOperationException( "Parse in error for Insert: " + rootNode, e); } } InsertParserMultiple();  InsertParserMultiple(VarNameAdapter adapter); @Override void parse(final JsonNode request); @Override String toString(); @Override InsertMultiQuery getRequest(); }
InsertParserMultiple extends RequestParserMultiple { protected void dataParse(final JsonNode rootNode) throws InvalidParseOperationException { if (rootNode == null) { throw new InvalidParseOperationException( "Parse in error for Insert: empty data"); } GlobalDatas.sanityValueCheck(rootNode.toString()); final JsonNode newRootNode = insertAdapter.getFixedVarNameJsonNode(rootNode); try { ((InsertMultiQuery) request).setData(newRootNode); } catch (final Exception e) { throw new InvalidParseOperationException( "Parse in error for Insert: " + rootNode, e); } } InsertParserMultiple();  InsertParserMultiple(VarNameAdapter adapter); @Override void parse(final JsonNode request); @Override String toString(); @Override InsertMultiQuery getRequest();  }