camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From zregv...@apache.org
Subject [camel] 03/03: CAMEL-12586: consistant surefire version in CDI...
Date Mon, 18 Jun 2018 07:53:14 GMT
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 <zregvart@apache.org>
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 @@
       <version>${hamcrest-version}</version>
       <scope>test</scope>
     </dependency>
+    <dependency>
+      <groupId>org.awaitility</groupId>
+      <artifactId>awaitility</artifactId>
+    </dependency>
   </dependencies>
 
   <build>
@@ -113,13 +117,6 @@
           </dependency>
         </dependencies>
       </plugin>
-
-      <plugin>
-        <groupId>org.apache.maven.plugins</groupId>
-        <artifactId>maven-surefire-plugin</artifactId>
-        <!-- need older version of surefire to make test work -->
-        <version>2.19.1</version>
-      </plugin>
     </plugins>
   </build>
 </project>
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.

Mime
View raw message