This is an automated email from the ASF dual-hosted git repository. davsclaus pushed a commit to branch dataformat in repository https://gitbox.apache.org/repos/asf/camel.git
commit d3c5909177a797349e2b0d0a327535ccd4cb6a1d Author: Claus Ibsen <claus.ib...@gmail.com> AuthorDate: Sun Apr 21 21:56:50 2019 +0200 Fixed flaky test --- .../camel/component/xquery/XQueryURLBasedConcurrencyTest.java | 9 +++++++-- components/camel-saxon/src/test/resources/log4j2.properties | 2 +- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/components/camel-saxon/src/test/java/org/apache/camel/component/xquery/XQueryURLBasedConcurrencyTest.java b/components/camel-saxon/src/test/java/org/apache/camel/component/xquery/XQueryURLBasedConcurrencyTest.java index 393b9fc..dfaa87f 100644 --- a/components/camel-saxon/src/test/java/org/apache/camel/component/xquery/XQueryURLBasedConcurrencyTest.java +++ b/components/camel-saxon/src/test/java/org/apache/camel/component/xquery/XQueryURLBasedConcurrencyTest.java @@ -17,6 +17,7 @@ package org.apache.camel.component.xquery; import java.util.Random; +import java.util.concurrent.TimeUnit; import org.apache.camel.builder.RouteBuilder; import org.apache.camel.component.mock.MockEndpoint; @@ -52,13 +53,16 @@ public class XQueryURLBasedConcurrencyTest extends CamelTestSupport { } catch (InterruptedException e) { // ignore } - template.sendBody("direct:start", - "<mail><subject>" + (start + i) + "</subject><body>Hello world!</body></mail>"); + if (context.getStatus().isStarted()) { + template.sendBody("direct:start", + "<mail><subject>" + (start + i) + "</subject><body>Hello world!</body></mail>"); + } } } }); } + mock.setResultWaitTime(30000); mock.assertIsSatisfied(); // must use bodyAs(String.class) to force DOM to be converted to String XML // for duplication detection @@ -76,6 +80,7 @@ public class XQueryURLBasedConcurrencyTest extends CamelTestSupport { from("seda:foo?concurrentConsumers=5") .to("xquery:org/apache/camel/component/xquery/transform.xquery") + .to("log:result?groupSize=100") .to("mock:result"); } }; diff --git a/components/camel-saxon/src/test/resources/log4j2.properties b/components/camel-saxon/src/test/resources/log4j2.properties index de7da79..2de3421 100644 --- a/components/camel-saxon/src/test/resources/log4j2.properties +++ b/components/camel-saxon/src/test/resources/log4j2.properties @@ -24,5 +24,5 @@ appender.out.type = Console appender.out.name = out appender.out.layout.type = PatternLayout appender.out.layout.pattern = %d [%-15.15t] %-5p %-30.30c{1} - %m%n -rootLogger.level = DEBUG +rootLogger.level = INFO rootLogger.appenderRef.file.ref = file