Repository: camel
Updated Branches:
  refs/heads/master d505286c2 -> 69934ac79


CAMEL-8367: Added unit test.


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

Branch: refs/heads/master
Commit: 69934ac79afa48ba30387da06823e526f10d8aa0
Parents: d505286
Author: Claus Ibsen <davscl...@apache.org>
Authored: Wed Feb 18 09:59:06 2015 +0100
Committer: Claus Ibsen <davscl...@apache.org>
Committed: Wed Feb 18 09:59:06 2015 +0100

----------------------------------------------------------------------
 .../RouteBuilderConfigureExceptionTest.java     | 53 ++++++++++++++++++++
 .../RouteBuilderConfigureExceptionTest.java     | 52 +++++++++++++++++++
 2 files changed, 105 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/69934ac7/components/camel-test/src/test/java/org/apache/camel/test/patterns/RouteBuilderConfigureExceptionTest.java
----------------------------------------------------------------------
diff --git 
a/components/camel-test/src/test/java/org/apache/camel/test/patterns/RouteBuilderConfigureExceptionTest.java
 
b/components/camel-test/src/test/java/org/apache/camel/test/patterns/RouteBuilderConfigureExceptionTest.java
new file mode 100644
index 0000000..fca945f
--- /dev/null
+++ 
b/components/camel-test/src/test/java/org/apache/camel/test/patterns/RouteBuilderConfigureExceptionTest.java
@@ -0,0 +1,53 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.test.patterns;
+
+import org.apache.camel.Predicate;
+import org.apache.camel.builder.RouteBuilder;
+import org.apache.camel.test.junit4.CamelTestSupport;
+import org.junit.Test;
+
+public class RouteBuilderConfigureExceptionTest extends CamelTestSupport {
+
+    private Predicate iAmNull;
+
+    @Override
+    public void setUp() throws Exception {
+        try {
+            super.setUp();
+            fail("Should have thrown exception");
+        } catch (Exception e) {
+            // expected
+        }
+    }
+
+    @Test
+    public void testFoo() throws Exception {
+    }
+
+    @Override
+    protected RouteBuilder createRouteBuilder() {
+        return new RouteBuilder() {
+            public void configure() {
+                from("direct:start")
+                    .choice()
+                        .when(iAmNull).to("mock:dead");
+            }
+        };
+    }
+}
+

http://git-wip-us.apache.org/repos/asf/camel/blob/69934ac7/components/camel-testng/src/test/java/org/apache/camel/testng/patterns/RouteBuilderConfigureExceptionTest.java
----------------------------------------------------------------------
diff --git 
a/components/camel-testng/src/test/java/org/apache/camel/testng/patterns/RouteBuilderConfigureExceptionTest.java
 
b/components/camel-testng/src/test/java/org/apache/camel/testng/patterns/RouteBuilderConfigureExceptionTest.java
new file mode 100644
index 0000000..e44c09b
--- /dev/null
+++ 
b/components/camel-testng/src/test/java/org/apache/camel/testng/patterns/RouteBuilderConfigureExceptionTest.java
@@ -0,0 +1,52 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.testng.patterns;
+
+import org.apache.camel.Predicate;
+import org.apache.camel.builder.RouteBuilder;
+import org.apache.camel.testng.CamelTestSupport;
+import org.testng.annotations.Test;
+
+public class RouteBuilderConfigureExceptionTest extends CamelTestSupport {
+
+    private Predicate iAmNull;
+
+    @Override
+    public void setUp() throws Exception {
+        try {
+            super.setUp();
+            fail("Should have thrown exception");
+        } catch (Exception e) {
+            // expected
+        }
+    }
+
+    @Test
+    public void testFoo() throws Exception {
+    }
+
+    @Override
+    protected RouteBuilder createRouteBuilder() {
+        return new RouteBuilder() {
+            public void configure() {
+                from("direct:start")
+                    .choice()
+                        .when(iAmNull).to("mock:dead");
+            }
+        };
+    }
+}

Reply via email to