You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Claus Ibsen (Jira)" <ji...@apache.org> on 2020/10/20 09:32:00 UTC
[jira] [Resolved] (CAMEL-15708) loopDoWhile with delay does not see
end of loop
[ https://issues.apache.org/jira/browse/CAMEL-15708?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Claus Ibsen resolved CAMEL-15708.
---------------------------------
Resolution: Not A Bug
> loopDoWhile with delay does not see end of loop
> -----------------------------------------------
>
> Key: CAMEL-15708
> URL: https://issues.apache.org/jira/browse/CAMEL-15708
> Project: Camel
> Issue Type: Bug
> Components: camel-core
> Affects Versions: 3.5.0
> Reporter: Alexander Kizchenko
> Assignee: Claus Ibsen
> Priority: Major
> Fix For: 3.7.0
>
>
> "*LoopDoWhile*" with "*delay*" in the body of the loop does not see the "*end*" and calls steps after the "*end*" during each iteration.
> *How to reproduce:*
> In the test of _org.apache.camel.processor.LoopDoWhileTest_ add "*delay*" into the route configuration
> {code:java}
> @Override
> protected RouteBuilder createRouteBuilder() throws Exception {
> return new RouteBuilder() {
> @Override
> public void configure() throws Exception {
> from("direct:simple").loopDoWhile(simple("${body.length} <= 5"))
> .to("mock:loop")
> .transform(body().append("A"))
> .delay(1000).asyncDelayed()
> .end().to("mock:result");
> from("direct:functional").loopDoWhile().body(String.class, b -> b.length() <= 5)
> .delay(1000).syncDelayed()
> .to("mock:loop").transform()
> .body(String.class, b -> b += "A").end()
> .to("mock:result");
> }
> };
> }
> {code}
> After that both tests will fall
> {code:java}
> java.lang.AssertionError: mock://result Body of message: 0. Expected: <AAAAAA> but was: <AA>
> Expected :<AAAAAA>
> Actual :<AA>
> <Click to see difference>
> {code}
> The *syncDelayed* or *asyncDelayed* options does not affect the result.
>
--
This message was sent by Atlassian Jira
(v8.3.4#803005)