CAMEL-11225: fix tests

Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/90e2c6a8
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/90e2c6a8
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/90e2c6a8

Branch: refs/heads/camel-2.19.x
Commit: 90e2c6a8ba162d358f12fe97c8d244f5fb701485
Parents: 93c72f4
Author: lburgazzoli <lburgazz...@gmail.com>
Authored: Mon May 8 15:06:53 2017 +0200
Committer: lburgazzoli <lburgazz...@gmail.com>
Committed: Tue May 9 09:12:12 2017 +0200

----------------------------------------------------------------------
 .../camel/spring/CircularComponentCreationTest.java     | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/90e2c6a8/components/camel-spring/src/test/java/org/apache/camel/spring/CircularComponentCreationTest.java
----------------------------------------------------------------------
diff --git 
a/components/camel-spring/src/test/java/org/apache/camel/spring/CircularComponentCreationTest.java
 
b/components/camel-spring/src/test/java/org/apache/camel/spring/CircularComponentCreationTest.java
index 05f50ed..0a74bfe 100644
--- 
a/components/camel-spring/src/test/java/org/apache/camel/spring/CircularComponentCreationTest.java
+++ 
b/components/camel-spring/src/test/java/org/apache/camel/spring/CircularComponentCreationTest.java
@@ -29,7 +29,14 @@ import 
org.springframework.context.support.ClassPathXmlApplicationContext;
 public class CircularComponentCreationTest {
     @Test
     public void testSimple() {
-        
doTest("org/apache/camel/spring/CircularComponentCreationSimpleTest.xml");
+        try {
+            
doTest("org/apache/camel/spring/CircularComponentCreationSimpleTest.xml");
+
+            Assert.fail("Exception should have been thrown");
+        } catch (Exception e) {
+            Assert.assertTrue(e instanceof RuntimeCamelException);
+            Assert.assertTrue(e.getCause() instanceof 
FailedToCreateRouteException);
+        }
     }
 
     @Test
@@ -47,9 +54,6 @@ public class CircularComponentCreationTest {
         try {
             applicationContext = new ClassPathXmlApplicationContext(path);
             camelContext = new SpringCamelContext(applicationContext);
-        } catch (Exception e) {
-            Assert.assertTrue(e instanceof RuntimeCamelException);
-            Assert.assertTrue(e.getCause() instanceof 
FailedToCreateRouteException);
         } finally {
             IOHelper.close(applicationContext);
         }

Reply via email to