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/07 11:18:20 UTC

[camel] branch sandbox/camel-3.x updated (361446f -> 3810bc1)

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 361446f  Upgrade Braintree to version 2.89.0
     new aa0b89a  Added test based on user forum issue
     new 856763e  Added test based on user forum issue
     new 3810bc1  Upgrade Cglib and related bundle to version 3.2.9

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:
 ...derTest.java => RouteStartupOrderLastTest.java} | 17 +++++++---
 components/camel-mail/pom.xml                      |  2 +-
 .../component/mail/MailSplitAttachmentsTest.java   |  1 -
 ...st.java => SpringMailSplitAttachmentsTest.java} | 37 +++++++---------------
 .../mail/SpringMailSplitAttachmentsTest.xml}       | 18 ++++-------
 parent/pom.xml                                     |  4 +--
 6 files changed, 33 insertions(+), 46 deletions(-)
 copy camel-core/src/test/java/org/apache/camel/processor/{RouteStartupOrderTest.java => RouteStartupOrderLastTest.java} (80%)
 copy components/camel-mail/src/test/java/org/apache/camel/component/mail/{MailSplitAttachmentsTest.java => SpringMailSplitAttachmentsTest.java} (79%)
 copy components/{camel-spring/src/test/resources/org/apache/camel/spring/processor/SpringSplitTokenizerGroupDynamicTest.xml => camel-mail/src/test/resources/org/apache/camel/component/mail/SpringMailSplitAttachmentsTest.xml} (80%)


[camel] 01/03: Added test based on user forum issue

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 aa0b89a53c561ca17c75ebb5f283cad446125495
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Fri Dec 7 10:35:29 2018 +0100

    Added test based on user forum issue
---
 components/camel-mail/pom.xml                      |  2 +-
 .../component/mail/MailSplitAttachmentsTest.java   |  1 -
 ...st.java => SpringMailSplitAttachmentsTest.java} | 37 ++++++-------------
 .../mail/SpringMailSplitAttachmentsTest.xml        | 42 ++++++++++++++++++++++
 4 files changed, 54 insertions(+), 28 deletions(-)

diff --git a/components/camel-mail/pom.xml b/components/camel-mail/pom.xml
index 4812751..d9697d9 100644
--- a/components/camel-mail/pom.xml
+++ b/components/camel-mail/pom.xml
@@ -69,7 +69,7 @@
         <!-- testing -->
         <dependency>
             <groupId>org.apache.camel</groupId>
-            <artifactId>camel-test</artifactId>
+            <artifactId>camel-test-spring</artifactId>
             <scope>test</scope>
         </dependency>
         <dependency>
diff --git a/components/camel-mail/src/test/java/org/apache/camel/component/mail/MailSplitAttachmentsTest.java b/components/camel-mail/src/test/java/org/apache/camel/component/mail/MailSplitAttachmentsTest.java
index 9609280..6b86d1f 100644
--- a/components/camel-mail/src/test/java/org/apache/camel/component/mail/MailSplitAttachmentsTest.java
+++ b/components/camel-mail/src/test/java/org/apache/camel/component/mail/MailSplitAttachmentsTest.java
@@ -45,7 +45,6 @@ public class MailSplitAttachmentsTest extends CamelTestSupport {
         Mailbox.clearAll();
     }
 
-
     @Before
     public void setup() {
         // create the exchange with the mail message that is multipart with a file and a Hello World text/plain message.
diff --git a/components/camel-mail/src/test/java/org/apache/camel/component/mail/MailSplitAttachmentsTest.java b/components/camel-mail/src/test/java/org/apache/camel/component/mail/SpringMailSplitAttachmentsTest.java
similarity index 79%
copy from components/camel-mail/src/test/java/org/apache/camel/component/mail/MailSplitAttachmentsTest.java
copy to components/camel-mail/src/test/java/org/apache/camel/component/mail/SpringMailSplitAttachmentsTest.java
index 9609280..8a055e2 100644
--- a/components/camel-mail/src/test/java/org/apache/camel/component/mail/MailSplitAttachmentsTest.java
+++ b/components/camel-mail/src/test/java/org/apache/camel/component/mail/SpringMailSplitAttachmentsTest.java
@@ -23,29 +23,33 @@ import org.apache.camel.Endpoint;
 import org.apache.camel.Exchange;
 import org.apache.camel.Message;
 import org.apache.camel.Producer;
-import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.component.mock.MockEndpoint;
-import org.apache.camel.test.junit4.CamelTestSupport;
+import org.apache.camel.test.spring.CamelSpringTestSupport;
 import org.apache.commons.io.IOUtils;
 import org.junit.Before;
 import org.junit.Test;
 import org.jvnet.mock_javamail.Mailbox;
+import org.springframework.context.support.AbstractApplicationContext;
+import org.springframework.context.support.ClassPathXmlApplicationContext;
 
 /**
- *  Tests the {@link SplitAttachmentsExpression}.
+ *  Spring XML version of {@link MailSplitAttachmentsTest}
  */
-public class MailSplitAttachmentsTest extends CamelTestSupport {
+public class SpringMailSplitAttachmentsTest extends CamelSpringTestSupport {
 
     private Endpoint endpoint;
-    private SplitAttachmentsExpression splitAttachmentsExpression;
     private Exchange exchange;
 
+    @Override
+    protected AbstractApplicationContext createApplicationContext() {
+        return new ClassPathXmlApplicationContext("org/apache/camel/component/mail/SpringMailSplitAttachmentsTest.xml");
+    }
+
     @Before
     public void clearMailBox() {
         Mailbox.clearAll();
     }
 
-
     @Before
     public void setup() {
         // create the exchange with the mail message that is multipart with a file and a Hello World text/plain message.
@@ -90,6 +94,7 @@ public class MailSplitAttachmentsTest extends CamelTestSupport {
         mock.expectedMessageCount(2);
 
         // set the expression to extract the attachments as byte[]s
+        SplitAttachmentsExpression splitAttachmentsExpression = context.getRegistry().findByType(SplitAttachmentsExpression.class).iterator().next();
         splitAttachmentsExpression.setExtractAttachments(true);
 
         Producer producer = endpoint.createProducer();
@@ -115,24 +120,4 @@ public class MailSplitAttachmentsTest extends CamelTestSupport {
         assertArrayEquals(expected2, second.getBody(byte[].class));
     }
 
-    @Override
-    protected RouteBuilder createRouteBuilder() throws Exception {
-
-        splitAttachmentsExpression = new SplitAttachmentsExpression(false);
-
-        return new RouteBuilder() {
-            @Override
-            public void configure() throws Exception {
-                // START SNIPPET: e1
-                from("pop3://james@mymailserver.com?password=secret&consumer.initialDelay=100&consumer.delay=100")
-                    .to("log:email")
-                    // use the SplitAttachmentsExpression which will split the message per attachment
-                    .split(splitAttachmentsExpression)
-                        // each message going to this mock has a single attachment
-                        .to("mock:split")
-                    .end();
-                // END SNIPPET: e1
-            }
-        };
-    }
 }
diff --git a/components/camel-mail/src/test/resources/org/apache/camel/component/mail/SpringMailSplitAttachmentsTest.xml b/components/camel-mail/src/test/resources/org/apache/camel/component/mail/SpringMailSplitAttachmentsTest.xml
new file mode 100644
index 0000000..a3d1276
--- /dev/null
+++ b/components/camel-mail/src/test/resources/org/apache/camel/component/mail/SpringMailSplitAttachmentsTest.xml
@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+    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.
+
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xsi:schemaLocation="
+       http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
+       http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd
+    ">
+
+  <bean id="splitAttachments" class="org.apache.camel.component.mail.SplitAttachmentsExpression">
+    <constructor-arg index="0" value="false"/>
+  </bean>
+
+  <camelContext xmlns="http://camel.apache.org/schema/spring">
+    <route>
+      <from uri="pop3://james@mymailserver.com?password=secret&amp;consumer.initialDelay=100&amp;consumer.delay=100"/>
+      <to uri="log:email"/>
+      <split>
+        <ref>splitAttachments</ref>
+        <to uri="mock:split"/>
+      </split>
+    </route>
+  </camelContext>
+
+</beans>


[camel] 02/03: Added test based on user forum issue

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 856763edf682f6fae2a89948f6418812f69ff725
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Fri Dec 7 10:57:04 2018 +0100

    Added test based on user forum issue
---
 .../camel/processor/RouteStartupOrderLastTest.java | 72 ++++++++++++++++++++++
 1 file changed, 72 insertions(+)

diff --git a/camel-core/src/test/java/org/apache/camel/processor/RouteStartupOrderLastTest.java b/camel-core/src/test/java/org/apache/camel/processor/RouteStartupOrderLastTest.java
new file mode 100644
index 0000000..106745c
--- /dev/null
+++ b/camel-core/src/test/java/org/apache/camel/processor/RouteStartupOrderLastTest.java
@@ -0,0 +1,72 @@
+/**
+ * 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.processor;
+
+import java.util.List;
+
+import org.apache.camel.ContextTestSupport;
+import org.apache.camel.builder.RouteBuilder;
+import org.apache.camel.component.mock.MockEndpoint;
+import org.apache.camel.impl.DefaultCamelContext;
+import org.apache.camel.spi.RouteStartupOrder;
+import org.junit.Test;
+
+/**
+ * @version 
+ */
+public class RouteStartupOrderLastTest extends ContextTestSupport {
+
+    @Test
+    public void testRouteStartupOrderLast() throws Exception {
+        MockEndpoint mock = getMockEndpoint("mock:result");
+        mock.expectedMessageCount(1);
+
+        template.sendBody("direct:start", "Hello World");
+
+        assertMockEndpointsSatisfied();
+
+        // assert correct order
+        DefaultCamelContext dcc = (DefaultCamelContext) context;
+        List<RouteStartupOrder> order = dcc.getRouteStartupOrder();
+
+        assertEquals(4, order.size());
+        assertEquals("seda://foo", order.get(0).getRoute().getEndpoint().getEndpointUri());
+        assertEquals("direct://start", order.get(1).getRoute().getEndpoint().getEndpointUri());
+        assertEquals("seda://bar", order.get(2).getRoute().getEndpoint().getEndpointUri());
+        assertEquals("direct://bar", order.get(3).getRoute().getEndpoint().getEndpointUri());
+    }
+
+    @Override
+    protected RouteBuilder createRouteBuilder() throws Exception {
+        return new RouteBuilder() {
+            @Override
+            public void configure() throws Exception {
+                // use auto assigned startup ordering
+                from("direct:start").to("seda:foo");
+
+                // should start first
+                from("seda:foo").startupOrder(1).to("mock:result");
+
+                // should start last after the default routes route
+                from("direct:bar").startupOrder(12345).to("seda:bar");
+
+                // use auto assigned startup ordering
+                from("seda:bar").to("mock:other");
+            }
+        };
+    }
+}
\ No newline at end of file


[camel] 03/03: Upgrade Cglib and related bundle to version 3.2.9

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 3810bc12a622a5c3f3b2cc0a2a79c98089fc6f1c
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Fri Dec 7 12:07:58 2018 +0100

    Upgrade Cglib and related bundle to version 3.2.9
---
 parent/pom.xml | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/parent/pom.xml b/parent/pom.xml
index 8118125..ce58c19 100644
--- a/parent/pom.xml
+++ b/parent/pom.xml
@@ -116,8 +116,8 @@
     <cdi-api-1.2-version>1.2</cdi-api-1.2-version>
     <cdi-api-2.0-version>2.0</cdi-api-2.0-version>
     <jta-api-1.2-version>1.2</jta-api-1.2-version>
-    <cglib-bundle-version>3.2.8_1</cglib-bundle-version>
-    <cglib-version>3.2.8</cglib-version>
+    <cglib-bundle-version>3.2.9_1</cglib-bundle-version>
+    <cglib-version>3.2.9</cglib-version>
     <chronicle-bytes-version>1.16.29</chronicle-bytes-version>
     <chronicle-core-version>1.16.29</chronicle-core-version>
     <chronicle-engine-version>1.13.27</chronicle-engine-version>