You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by cs...@apache.org on 2017/04/05 10:28:57 UTC

camel git commit: [CAMEL-11109] Adding test to show the issue

Repository: camel
Updated Branches:
  refs/heads/master 9613eb46e -> f1fa214fd


[CAMEL-11109] Adding test to show the issue


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

Branch: refs/heads/master
Commit: f1fa214fdb188754482bf9f0c8514acbfa741312
Parents: 9613eb4
Author: Christian Schneider <ch...@die-schneider.net>
Authored: Wed Apr 5 12:28:28 2017 +0200
Committer: Christian Schneider <ch...@die-schneider.net>
Committed: Wed Apr 5 12:28:52 2017 +0200

----------------------------------------------------------------------
 .../jms/issues/JmsExclusiveConsumerTest.java    | 45 ++++++++++++++++++++
 1 file changed, 45 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/f1fa214f/components/camel-jms/src/test/java/org/apache/camel/component/jms/issues/JmsExclusiveConsumerTest.java
----------------------------------------------------------------------
diff --git a/components/camel-jms/src/test/java/org/apache/camel/component/jms/issues/JmsExclusiveConsumerTest.java b/components/camel-jms/src/test/java/org/apache/camel/component/jms/issues/JmsExclusiveConsumerTest.java
new file mode 100644
index 0000000..bbf1ace
--- /dev/null
+++ b/components/camel-jms/src/test/java/org/apache/camel/component/jms/issues/JmsExclusiveConsumerTest.java
@@ -0,0 +1,45 @@
+/**
+ * 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.component.jms.issues;
+
+import org.apache.camel.FailedToCreateRouteException;
+import org.apache.camel.builder.RouteBuilder;
+import org.apache.camel.component.jms.JmsComponent;
+import org.apache.camel.impl.DefaultCamelContext;
+import org.junit.Test;
+
+/**
+ * See https://issues.apache.org/jira/browse/CAMEL-11109
+ */
+public class JmsExclusiveConsumerTest {
+
+    /**
+     * @throws Exception as long as the issue is present the route creation will fail
+     */
+    @Test(expected=FailedToCreateRouteException.class)
+    public void testExclusiveConsumer() throws Exception {
+        DefaultCamelContext context = new DefaultCamelContext();
+        context.addComponent("activemq", JmsComponent.jmsComponent());
+        context.addRoutes(new RouteBuilder() {
+            public void configure() throws Exception {
+                from("activemq:queue:in?destination.consumer.exclusive=true").to("mock:result");
+            }
+        });
+        context.start();
+    }
+
+}