From commits-return-63397-archive-asf-public=cust-asf.ponee.io@camel.apache.org Mon Jun 18 09:53:13 2018 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id 5D54E180679 for ; Mon, 18 Jun 2018 09:53:13 +0200 (CEST) Received: (qmail 46049 invoked by uid 500); 18 Jun 2018 07:53:12 -0000 Mailing-List: contact commits-help@camel.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@camel.apache.org Delivered-To: mailing list commits@camel.apache.org Received: (qmail 45846 invoked by uid 99); 18 Jun 2018 07:53:12 -0000 Received: from ec2-52-202-80-70.compute-1.amazonaws.com (HELO gitbox.apache.org) (52.202.80.70) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 18 Jun 2018 07:53:12 +0000 Received: by gitbox.apache.org (ASF Mail Server at gitbox.apache.org, from userid 33) id 86D7A8270C; Mon, 18 Jun 2018 07:53:11 +0000 (UTC) Date: Mon, 18 Jun 2018 07:53:14 +0000 To: "commits@camel.apache.org" Subject: [camel] 03/03: CAMEL-12586: consistant surefire version in CDI... MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit From: zregvart@apache.org In-Reply-To: <152930839103.10476.11096567753101713188@gitbox.apache.org> References: <152930839103.10476.11096567753101713188@gitbox.apache.org> X-Git-Host: gitbox.apache.org X-Git-Repo: camel X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Rev: 7dfdc79cc237cc53552357472313e6a93de25fb9 X-Git-NotificationType: diff X-Git-Multimail-Version: 1.5.dev Auto-Submitted: auto-generated Message-Id: <20180618075311.86D7A8270C@gitbox.apache.org> This is an automated email from the ASF dual-hosted git repository. zregvart pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/camel.git commit 7dfdc79cc237cc53552357472313e6a93de25fb9 Author: Zoran Regvart AuthorDate: Mon Jun 18 09:51:24 2018 +0200 CAMEL-12586: consistant surefire version in CDI... ... XML example This removes surefire version customization and tries to make the test less flaky by addressing the multi threading issue in route shutdown by using Awaitility to try to fetch route status multiple times. --- examples/camel-example-cdi-xml/pom.xml | 11 ++++------- .../java/org/apache/camel/example/cdi/xml/CdiXmlTest.java | 9 ++++----- 2 files changed, 8 insertions(+), 12 deletions(-) diff --git a/examples/camel-example-cdi-xml/pom.xml b/examples/camel-example-cdi-xml/pom.xml index 34a54b1..7e45e69 100644 --- a/examples/camel-example-cdi-xml/pom.xml +++ b/examples/camel-example-cdi-xml/pom.xml @@ -91,6 +91,10 @@ ${hamcrest-version} test + + org.awaitility + awaitility + @@ -113,13 +117,6 @@ - - - org.apache.maven.plugins - maven-surefire-plugin - - 2.19.1 - diff --git a/examples/camel-example-cdi-xml/src/test/java/org/apache/camel/example/cdi/xml/CdiXmlTest.java b/examples/camel-example-cdi-xml/src/test/java/org/apache/camel/example/cdi/xml/CdiXmlTest.java index ea65541..bf7b3c1 100644 --- a/examples/camel-example-cdi-xml/src/test/java/org/apache/camel/example/cdi/xml/CdiXmlTest.java +++ b/examples/camel-example-cdi-xml/src/test/java/org/apache/camel/example/cdi/xml/CdiXmlTest.java @@ -33,13 +33,11 @@ import org.apache.camel.management.event.CamelContextStartingEvent; import org.apache.camel.model.ModelCamelContext; import org.apache.camel.test.cdi.CamelCdiRunner; import org.apache.camel.test.cdi.Order; +import org.awaitility.Awaitility; import org.junit.Test; import org.junit.runner.RunWith; import static org.apache.camel.component.mock.MockEndpoint.assertIsSatisfied; -import static org.hamcrest.Matchers.equalTo; -import static org.hamcrest.Matchers.is; -import static org.junit.Assert.assertThat; @RunWith(CamelCdiRunner.class) public class CdiXmlTest { @@ -95,7 +93,8 @@ public class CdiXmlTest { @Test @Order(3) public void verifyRescue(CamelContext context) { - assertThat("Neo is still in the matrix!", - context.getRouteStatus("terminal"), is(equalTo(ServiceStatus.Stopped))); + Awaitility.await("Neo is still in the matrix!") + .atMost(5, TimeUnit.SECONDS) + .until(() -> ServiceStatus.Stopped.equals(context.getRouteStatus("terminal"))); } } -- To stop receiving notification emails like this one, please contact zregvart@apache.org.