@Test public void testMultipleResultMessages() throws Exception { createDatabase(); List<AdapterTypeVersion> dbItems = generate(11); AdapterTypeVersion entry = dbItems.get(0); populateDatabase(dbItems, false); JdbcDataQueryService s = createMultiService(); SplittingXmlPayloadTranslator translator = createPayloadTranslator().withMaxRowsPerMessage(2); s.setResultSetTranslator(translator); AdaptrisMessage msg = createMessage(entry); execute(s, msg); assertTrue(msg.headersContainsKey(ADAPTER_ID_KEY)); assertFalse(msg.headersContainsKey(JdbcDataQueryService.class.getCanonicalName())); List<AdaptrisMessage> outputMessages = producer.getMessages(); assertEquals(6, outputMessages.size()); int count = 0; for(AdaptrisMessage outputMessage: outputMessages) { XmlUtils xu = XmlHelper.createXmlUtils(outputMessage); assertNull("Xpath /Results/OriginalMessage", xu.getSingleNode("/Results/OriginalMessage")); assertEquals("/Results/Row", count<5 ? 2 : 1, xu.getNodeList("/Results/Row").getLength()); assertFalse(outputMessage.headersContainsKey(ADAPTER_ID_KEY)); count++; } }
public SplittingXmlPayloadTranslator withMaxRowsPerMessage(Integer b) { setMaxRowsPerMessage(b); return this; }
SplittingXmlPayloadTranslator extends XmlPayloadTranslatorImpl { public SplittingXmlPayloadTranslator withMaxRowsPerMessage(Integer b) { setMaxRowsPerMessage(b); return this; } }
SplittingXmlPayloadTranslator extends XmlPayloadTranslatorImpl { public SplittingXmlPayloadTranslator withMaxRowsPerMessage(Integer b) { setMaxRowsPerMessage(b); return this; } SplittingXmlPayloadTranslator(); }
SplittingXmlPayloadTranslator extends XmlPayloadTranslatorImpl { public SplittingXmlPayloadTranslator withMaxRowsPerMessage(Integer b) { setMaxRowsPerMessage(b); return this; } SplittingXmlPayloadTranslator(); @Override void init(); @Override void start(); @Override void prepare(); @Override void stop(); @Override void close(); @Override long translateResult(JdbcResult source, AdaptrisMessage inputMessage); Integer getMaxRowsPerMessage(); void setMaxRowsPerMessage(Integer maxRowsPerMessage); void setConnection(AdaptrisConnection conn); AdaptrisConnection getConnection(); void setProducer(AdaptrisMessageProducer prod); AdaptrisMessageProducer getProducer(); AdaptrisMessageFactory getMessageFactory(); void setMessageFactory(AdaptrisMessageFactory messageFactory); void setCopyMetadata(Boolean b); Boolean getCopyMetadata(); SplittingXmlPayloadTranslator withCopyMetadata(Boolean b); SplittingXmlPayloadTranslator withProducer(AdaptrisMessageProducer b); SplittingXmlPayloadTranslator withConnection(AdaptrisConnection b); SplittingXmlPayloadTranslator withMaxRowsPerMessage(Integer b); SplittingXmlPayloadTranslator withMessageFactory(AdaptrisMessageFactory b); }
SplittingXmlPayloadTranslator extends XmlPayloadTranslatorImpl { public SplittingXmlPayloadTranslator withMaxRowsPerMessage(Integer b) { setMaxRowsPerMessage(b); return this; } SplittingXmlPayloadTranslator(); @Override void init(); @Override void start(); @Override void prepare(); @Override void stop(); @Override void close(); @Override long translateResult(JdbcResult source, AdaptrisMessage inputMessage); Integer getMaxRowsPerMessage(); void setMaxRowsPerMessage(Integer maxRowsPerMessage); void setConnection(AdaptrisConnection conn); AdaptrisConnection getConnection(); void setProducer(AdaptrisMessageProducer prod); AdaptrisMessageProducer getProducer(); AdaptrisMessageFactory getMessageFactory(); void setMessageFactory(AdaptrisMessageFactory messageFactory); void setCopyMetadata(Boolean b); Boolean getCopyMetadata(); SplittingXmlPayloadTranslator withCopyMetadata(Boolean b); SplittingXmlPayloadTranslator withProducer(AdaptrisMessageProducer b); SplittingXmlPayloadTranslator withConnection(AdaptrisConnection b); SplittingXmlPayloadTranslator withMaxRowsPerMessage(Integer b); SplittingXmlPayloadTranslator withMessageFactory(AdaptrisMessageFactory b);  }