You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ac...@apache.org on 2018/12/13 11:09:55 UTC

[camel] branch sandbox/camel-3.x updated (2d4de6f -> ea20f1a)

This is an automated email from the ASF dual-hosted git repository.

acosentino pushed a change to branch sandbox/camel-3.x
in repository https://gitbox.apache.org/repos/asf/camel.git.


    from 2d4de6f  CAMEL-12954 - Regen
     new 4d7d8be  CAMEL-12947:MockEndpoint.expectedHeaderReceived should fail when no exchange received (#2669)
     new 6d5262c  Upgrade JackRabbit to version 2.18.0
     new ea20f1a  Upgrade JackRabbit to version 2.19.0

The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../apache/camel/component/mock/MockEndpoint.java  |  3 ++
 ...Test.java => MockEndpointFailNoHeaderTest.java} | 33 +++++++++-------------
 parent/pom.xml                                     |  2 +-
 3 files changed, 17 insertions(+), 21 deletions(-)
 copy components/camel-test/src/test/java/org/apache/camel/test/patterns/{FilterJUnit4Test.java => MockEndpointFailNoHeaderTest.java} (77%)


[camel] 01/03: CAMEL-12947:MockEndpoint.expectedHeaderReceived should fail when no exchange received (#2669)

Posted by ac...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

acosentino pushed a commit to branch sandbox/camel-3.x
in repository https://gitbox.apache.org/repos/asf/camel.git

commit 4d7d8be6ff693343207fb10f515a77fb7879224b
Author: ramu11 <kr...@gmail.com>
AuthorDate: Thu Dec 13 16:24:21 2018 +0530

    CAMEL-12947:MockEndpoint.expectedHeaderReceived should fail when no exchange received (#2669)
---
 .../apache/camel/component/mock/MockEndpoint.java  |  3 ++
 .../patterns/MockEndpointFailNoHeaderTest.java     | 62 ++++++++++++++++++++++
 2 files changed, 65 insertions(+)

diff --git a/camel-core/src/main/java/org/apache/camel/component/mock/MockEndpoint.java b/camel-core/src/main/java/org/apache/camel/component/mock/MockEndpoint.java
index a3088c7..2018df4 100644
--- a/camel-core/src/main/java/org/apache/camel/component/mock/MockEndpoint.java
+++ b/camel-core/src/main/java/org/apache/camel/component/mock/MockEndpoint.java
@@ -508,6 +508,9 @@ public class MockEndpoint extends DefaultEndpoint implements BrowsableEndpoint {
      * <b>Important:</b> This overrides any previous set value using {@link #expectedMessageCount(int)}
      */
     public void expectedHeaderReceived(final String name, final Object value) {
+        if (expectedCount == -1) {
+            expectedMessageCount(1);
+        }
         if (expectedHeaderValues == null) {
             expectedHeaderValues = getCamelContext().getHeadersMapFactory().newMap();
             // we just wants to expects to be called once
diff --git a/components/camel-test/src/test/java/org/apache/camel/test/patterns/MockEndpointFailNoHeaderTest.java b/components/camel-test/src/test/java/org/apache/camel/test/patterns/MockEndpointFailNoHeaderTest.java
new file mode 100644
index 0000000..931a472
--- /dev/null
+++ b/components/camel-test/src/test/java/org/apache/camel/test/patterns/MockEndpointFailNoHeaderTest.java
@@ -0,0 +1,62 @@
+/**
+ * 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.EndpointInject;
+import org.apache.camel.Produce;
+import org.apache.camel.ProducerTemplate;
+import org.apache.camel.builder.RouteBuilder;
+import org.apache.camel.component.mock.MockEndpoint;
+import org.apache.camel.test.junit4.CamelTestSupport;
+import org.junit.Test;
+public class MockEndpointFailNoHeaderTest extends CamelTestSupport {
+
+    @EndpointInject(uri = "mock:result")
+    protected MockEndpoint resultEndpoint;
+
+    @Produce(uri = "direct:start")
+    protected ProducerTemplate template;
+
+    @Override
+    public boolean isDumpRouteCoverage() {
+        return true;
+    }
+
+    @Test
+    public void withHeaderTestCase() throws InterruptedException {
+        String expectedBody = "<matched/>";
+        resultEndpoint.expectedHeaderReceived("foo", "bar");
+        template.sendBodyAndHeader(expectedBody, "foo", "bar");
+        resultEndpoint.assertIsSatisfied();
+    }
+    
+    
+    @Test
+    public void noHeaderTestCase() throws InterruptedException {
+        resultEndpoint.expectedHeaderReceived("foo", "bar");
+        resultEndpoint.assertIsNotSatisfied();
+    }
+
+    @Override
+    protected RouteBuilder createRouteBuilder() {
+        return new RouteBuilder() {
+            public void configure() {
+                from("direct:start").filter(header("foo").isEqualTo("bar")).to("mock:result");
+            }
+        };
+    }
+}


[camel] 02/03: Upgrade JackRabbit to version 2.18.0

Posted by ac...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

acosentino pushed a commit to branch sandbox/camel-3.x
in repository https://gitbox.apache.org/repos/asf/camel.git

commit 6d5262c3faa226c174859bac77d27787217a76ae
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Wed Dec 12 11:52:12 2018 +0100

    Upgrade JackRabbit to version 2.18.0
---
 parent/pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/parent/pom.xml b/parent/pom.xml
index 4952ea1..dab8ac6 100644
--- a/parent/pom.xml
+++ b/parent/pom.xml
@@ -332,7 +332,7 @@
     <jackson-spark-version>2.4.5</jackson-spark-version>
     <jackson2-scala-version>2.6.1</jackson2-scala-version>
     <jackson2-version>2.9.7</jackson2-version>
-    <jackrabbit-version>2.17.7</jackrabbit-version>
+    <jackrabbit-version>2.18.0</jackrabbit-version>
     <jackrabbit-guava-version>15.0</jackrabbit-guava-version>
     <jain-sip-ri-bundle-version>1.2.154_2</jain-sip-ri-bundle-version>
     <jasn1-version>1.10.0</jasn1-version>


[camel] 03/03: Upgrade JackRabbit to version 2.19.0

Posted by ac...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

acosentino pushed a commit to branch sandbox/camel-3.x
in repository https://gitbox.apache.org/repos/asf/camel.git

commit ea20f1a6f2a7e83bf5448a8d975464d042cff70e
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Thu Dec 13 12:04:32 2018 +0100

    Upgrade JackRabbit to version 2.19.0
---
 parent/pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/parent/pom.xml b/parent/pom.xml
index dab8ac6..60f61e2 100644
--- a/parent/pom.xml
+++ b/parent/pom.xml
@@ -332,7 +332,7 @@
     <jackson-spark-version>2.4.5</jackson-spark-version>
     <jackson2-scala-version>2.6.1</jackson2-scala-version>
     <jackson2-version>2.9.7</jackson2-version>
-    <jackrabbit-version>2.18.0</jackrabbit-version>
+    <jackrabbit-version>2.19.0</jackrabbit-version>
     <jackrabbit-guava-version>15.0</jackrabbit-guava-version>
     <jain-sip-ri-bundle-version>1.2.154_2</jain-sip-ri-bundle-version>
     <jasn1-version>1.10.0</jasn1-version>