IteratingPipe extends MessageSendingPipe { @Override public void setSender(ISender sender) { super.setSender(sender); senderStatisticsKeeper = new StatisticsKeeper("-> "+(StringUtils.isNotEmpty(sender.getName())?sender.getName():ClassUtils.nameOf(sender))); }  @Override void configure(); @Override MessageOutputStream provideOutputStream(IPipeLineSession session); @Override boolean canStreamToNextPipe(); @Override void iterateOverStatistics(StatisticsKeeperIterationHandler hski, Object data, int action); @Override void setSender(ISender sender); void setTaskExecutor(TaskExecutor executor); TaskExecutor getTaskExecutor(); @IbisDoc({"1", "Stylesheet to apply to each message, before sending it", ""}) void setStyleSheetName(String stylesheetName); String getStyleSheetName(); @IbisDoc({"2", "Alternatively: xpath-expression to create stylesheet from", ""}) void setXpathExpression(String string); String getXpathExpression(); @IbisDoc({"3", "Namespace defintions for xpathExpression. Must be in the form of a comma or space separated list of <code>prefix=namespaceuri</code>-definitions. For some use other cases (NOT xpathExpression), one entry can be without a prefix, that will define the default namespace.", ""}) void setNamespaceDefs(String namespaceDefs); String getNamespaceDefs(); @IbisDoc({"4", "Either 'text' or 'xml'. only valid for xpathexpression", "text"}) void setOutputType(String string); String getOutputType(); @IbisDoc({"5", "Force the transformer generated from the xpath-expression to omit the xml declaration", "true"}) void setOmitXmlDeclaration(boolean b); boolean isOmitXmlDeclaration(); @IbisDoc({"6", "Key of session variable to store number of items processed, i.e. the position or index in the set of items to be processed.", ""}) void setItemNoSessionKey(String string); String getItemNoSessionKey(); @IbisDoc({"7", "The maximum number of items returned. The (default) value of 0 means unlimited, all available items will be returned","0"}) void setMaxItems(int maxItems); int getMaxItems(); @IbisDoc({"7", "Expression evaluated on each result if set. " + "Iteration stops if condition returns anything other than an empty result. To test for the root element to have an attribute 'finished' with the value 'yes', the expression <code>*[@finished='yes']</code> can be used. " + "This can be used if the condition to stop can be derived from the item result. To stop after a maximum number of items has been processed, use <code>maxItems</code>." + "Previous versions documented that <code>position()=2</code> could be used. This is not working as expected; Use maxItems instead", ""}) void setStopConditionXPathExpression(String string); String getStopConditionXPathExpression(); @IbisDoc({"8", "When <code>true</code> ignore any exception thrown by executing sender", "false"}) void setIgnoreExceptions(boolean b); boolean isIgnoreExceptions(); @IbisDoc({"9", "Controls whether all the results of each iteration will be collected in one result message. If set <code>false</code>, only a small summary is returned. " + "Setting this attributes to <code>false</code> is often required to enable processing of very large files. N.B. Remember in such a case that setting transactionAttribute to NotSupported might be necessary too", "true"}) void setCollectResults(boolean b); boolean isCollectResults(); @IbisDoc({"10", "Postprocess each partial result, to remove the xml-declaration, as this is not allowed inside an xml-document", "false"}) void setRemoveXmlDeclarationInResults(boolean b); boolean isRemoveXmlDeclarationInResults(); @IbisDoc({"11", "When <code>true</code> the input is added to the result in an input element", "false"}) void setAddInputToResult(boolean b); boolean isAddInputToResult(); @IbisDoc({"12", "When <code>true</code> duplicate input elements are removed, i.e. they are handled only once", "false"}) void setRemoveDuplicates(boolean b); boolean isRemoveDuplicates(); @IbisDoc({"13", "When set <code>true</code>, the calls for all items are done in parallel (a new thread is started for each call). when collectresults set <code>true</code>, this pipe will wait for all calls to finish before results are collected and pipe result is returned", "false"}) void setParallel(boolean parallel); boolean isParallel(); @IbisDoc({"14", "maximum number of child threads that may run in parallel simultaneously (combined total of all threads calling this pipe)", "0 (unlimited)"}) void setMaxChildThreads(int maxChildThreads); int getMaxChildThreads(); @IbisDoc({"15", "Controls multiline behaviour. when set to a value greater than 0, it specifies the number of rows send in a block to the sender.", "0 (one line at a time, no prefix of suffix)"}) void setBlockSize(int i); int getBlockSize();  }
@Test public void testNullIterator() throws Exception { pipe.setSender(getElementRenderer(false)); configurePipe(); pipe.start(); String expected = "<results/>"; PipeRunResult prr = doPipe(new Message("")); MatchUtils.assertXmlEquals("null iterator", expected, prr.getResult().asString(), true); }