You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2016/10/14 08:14:01 UTC
[1/8] camel git commit: CAMEL-10385: capture all structures of type
collection
Repository: camel
Updated Branches:
refs/heads/camel-2.18.x 92630afb2 -> 8092484fc
refs/heads/master 2dda57ef9 -> abb08fa9b
CAMEL-10385: capture all structures of type collection
Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/8092484f
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/8092484f
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/8092484f
Branch: refs/heads/camel-2.18.x
Commit: 8092484fc0561811f962463b65e42907b0e18ba2
Parents: 22816c5
Author: dmitriy <xh...@gmail.com>
Authored: Thu Oct 13 17:28:55 2016 -0400
Committer: Claus Ibsen <da...@apache.org>
Committed: Fri Oct 14 09:32:47 2016 +0200
----------------------------------------------------------------------
.../java/org/apache/camel/spring/boot/SpringTypeConverter.java | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/camel/blob/8092484f/components/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/SpringTypeConverter.java
----------------------------------------------------------------------
diff --git a/components/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/SpringTypeConverter.java b/components/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/SpringTypeConverter.java
index 3818148..5f4021a 100644
--- a/components/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/SpringTypeConverter.java
+++ b/components/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/SpringTypeConverter.java
@@ -16,11 +16,11 @@
*/
package org.apache.camel.spring.boot;
+import java.util.Collection;
import java.util.List;
import java.util.Map;
import org.apache.camel.Exchange;
-import org.apache.camel.StreamCache;
import org.apache.camel.TypeConversionException;
import org.apache.camel.support.TypeConverterSupport;
import org.springframework.beans.factory.annotation.Autowired;
@@ -43,7 +43,7 @@ public class SpringTypeConverter extends TypeConverterSupport {
}
// do not attempt to convert List -> Map. Ognl expression may use this converter as a fallback expecting null
- if (type.isAssignableFrom(Map.class) && (value.getClass().isArray() || value instanceof List)) {
+ if (type.isAssignableFrom(Map.class) && (value.getClass().isArray() || value instanceof Collection)) {
return null;
}
[3/8] camel git commit: CAMEL-10385: fix checkstyle errors
Posted by da...@apache.org.
CAMEL-10385: fix checkstyle errors
Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/22816c5e
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/22816c5e
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/22816c5e
Branch: refs/heads/camel-2.18.x
Commit: 22816c5e7f0f5c4a4a0ecc21378730524bd121e2
Parents: 9ae7ebe
Author: dmitriy <xh...@gmail.com>
Authored: Thu Oct 13 09:52:29 2016 -0400
Committer: Claus Ibsen <da...@apache.org>
Committed: Fri Oct 14 09:32:47 2016 +0200
----------------------------------------------------------------------
.../camel/spring/boot/SpringTypeConverter.java | 2 +-
.../spring/boot/issues/SimpleOgnlTest.java | 48 ++++++++++----------
2 files changed, 25 insertions(+), 25 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/camel/blob/22816c5e/components/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/SpringTypeConverter.java
----------------------------------------------------------------------
diff --git a/components/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/SpringTypeConverter.java b/components/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/SpringTypeConverter.java
index c4aff73..3818148 100644
--- a/components/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/SpringTypeConverter.java
+++ b/components/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/SpringTypeConverter.java
@@ -44,7 +44,7 @@ public class SpringTypeConverter extends TypeConverterSupport {
// do not attempt to convert List -> Map. Ognl expression may use this converter as a fallback expecting null
if (type.isAssignableFrom(Map.class) && (value.getClass().isArray() || value instanceof List)) {
- return null;
+ return null;
}
for (ConversionService conversionService : conversionServices) {
http://git-wip-us.apache.org/repos/asf/camel/blob/22816c5e/components/camel-spring-boot/src/test/java/org/apache/camel/spring/boot/issues/SimpleOgnlTest.java
----------------------------------------------------------------------
diff --git a/components/camel-spring-boot/src/test/java/org/apache/camel/spring/boot/issues/SimpleOgnlTest.java b/components/camel-spring-boot/src/test/java/org/apache/camel/spring/boot/issues/SimpleOgnlTest.java
index 969ad50..72024e2 100644
--- a/components/camel-spring-boot/src/test/java/org/apache/camel/spring/boot/issues/SimpleOgnlTest.java
+++ b/components/camel-spring-boot/src/test/java/org/apache/camel/spring/boot/issues/SimpleOgnlTest.java
@@ -36,34 +36,34 @@ import org.springframework.test.context.junit4.SpringRunner;
@EnableAutoConfiguration
@SpringBootTest(classes = { SimpleOgnlTest.class })
public class SimpleOgnlTest {
- @EndpointInject(uri = "mock:result")
- protected MockEndpoint resultEndpoint;
+ @EndpointInject(uri = "mock:result")
+ protected MockEndpoint resultEndpoint;
- @Produce(uri = "direct:start")
- protected ProducerTemplate template;
+ @Produce(uri = "direct:start")
+ protected ProducerTemplate template;
- @Test
- public void testSimpleOgnlListExpression() throws Exception {
- List<String> list = new ArrayList<String>();
- list.add("one");
- list.add("two");
+ @Test
+ public void testSimpleOgnlListExpression() throws Exception {
+ List<String> list = new ArrayList<String>();
+ list.add("one");
+ list.add("two");
- resultEndpoint.expectedBodiesReceived(list.get(0));
+ resultEndpoint.expectedBodiesReceived(list.get(0));
- template.sendBody(list);
+ template.sendBody(list);
- resultEndpoint.assertIsSatisfied();
- }
+ resultEndpoint.assertIsSatisfied();
+ }
- @Configuration
- public static class ContextConfig {
- @Bean
- public RouteBuilder route() {
- return new RouteBuilder() {
- public void configure() {
- from("direct:start").setBody(simple("${body[0]}")).to("mock:result");
- }
- };
- }
- }
+ @Configuration
+ public static class ContextConfig {
+ @Bean
+ public RouteBuilder route() {
+ return new RouteBuilder() {
+ public void configure() {
+ from("direct:start").setBody(simple("${body[0]}")).to("mock:result");
+ }
+ };
+ }
+ }
}
[2/8] camel git commit: CAMEL-10385: fix checkstyle errors
Posted by da...@apache.org.
CAMEL-10385: fix checkstyle errors
Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/9ae7ebea
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/9ae7ebea
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/9ae7ebea
Branch: refs/heads/camel-2.18.x
Commit: 9ae7ebea7d9f6c0723b9d44057b937bf83b65e16
Parents: dc64003
Author: dmitriy <xh...@gmail.com>
Authored: Thu Oct 13 09:44:17 2016 -0400
Committer: Claus Ibsen <da...@apache.org>
Committed: Fri Oct 14 09:32:47 2016 +0200
----------------------------------------------------------------------
.../spring/boot/issues/SimpleOgnlTest.java | 66 ++++++++++++--------
1 file changed, 41 insertions(+), 25 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/camel/blob/9ae7ebea/components/camel-spring-boot/src/test/java/org/apache/camel/spring/boot/issues/SimpleOgnlTest.java
----------------------------------------------------------------------
diff --git a/components/camel-spring-boot/src/test/java/org/apache/camel/spring/boot/issues/SimpleOgnlTest.java b/components/camel-spring-boot/src/test/java/org/apache/camel/spring/boot/issues/SimpleOgnlTest.java
index 99fcd66..969ad50 100644
--- a/components/camel-spring-boot/src/test/java/org/apache/camel/spring/boot/issues/SimpleOgnlTest.java
+++ b/components/camel-spring-boot/src/test/java/org/apache/camel/spring/boot/issues/SimpleOgnlTest.java
@@ -1,3 +1,19 @@
+/**
+ * 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.spring.boot.issues;
import java.util.ArrayList;
@@ -18,36 +34,36 @@ import org.springframework.test.context.junit4.SpringRunner;
@RunWith(SpringRunner.class)
@EnableAutoConfiguration
-@SpringBootTest(classes = {SimpleOgnlTest.class})
+@SpringBootTest(classes = { SimpleOgnlTest.class })
public class SimpleOgnlTest {
@EndpointInject(uri = "mock:result")
- protected MockEndpoint resultEndpoint;
-
- @Produce(uri = "direct:start")
- protected ProducerTemplate template;
-
+ protected MockEndpoint resultEndpoint;
+
+ @Produce(uri = "direct:start")
+ protected ProducerTemplate template;
+
@Test
- public void testSimpleOgnlListExpression() throws Exception {
+ public void testSimpleOgnlListExpression() throws Exception {
List<String> list = new ArrayList<String>();
list.add("one");
list.add("two");
-
- resultEndpoint.expectedBodiesReceived(list.get(0));
-
- template.sendBody(list);
-
- resultEndpoint.assertIsSatisfied();
- }
-
+
+ resultEndpoint.expectedBodiesReceived(list.get(0));
+
+ template.sendBody(list);
+
+ resultEndpoint.assertIsSatisfied();
+ }
+
@Configuration
- public static class ContextConfig {
- @Bean
- public RouteBuilder route() {
- return new RouteBuilder() {
- public void configure() {
- from("direct:start").setBody(simple("${body[0]}")).to("mock:result");
- }
- };
- }
- }
+ public static class ContextConfig {
+ @Bean
+ public RouteBuilder route() {
+ return new RouteBuilder() {
+ public void configure() {
+ from("direct:start").setBody(simple("${body[0]}")).to("mock:result");
+ }
+ };
+ }
+ }
}
[4/8] camel git commit: CAMEL-10385: springtypeconverter return null
on list -> map
Posted by da...@apache.org.
CAMEL-10385: springtypeconverter return null on list -> map
Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/dc640034
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/dc640034
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/dc640034
Branch: refs/heads/camel-2.18.x
Commit: dc640034ce71ae30dfd4058992897969bc3835d7
Parents: 92630af
Author: dmitriy <xh...@gmail.com>
Authored: Thu Oct 13 01:37:50 2016 -0400
Committer: Claus Ibsen <da...@apache.org>
Committed: Fri Oct 14 09:32:47 2016 +0200
----------------------------------------------------------------------
.../camel/spring/boot/SpringTypeConverter.java | 6 +++
.../spring/boot/issues/SimpleOgnlTest.java | 53 ++++++++++++++++++++
2 files changed, 59 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/camel/blob/dc640034/components/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/SpringTypeConverter.java
----------------------------------------------------------------------
diff --git a/components/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/SpringTypeConverter.java b/components/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/SpringTypeConverter.java
index d7020e5..c4aff73 100644
--- a/components/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/SpringTypeConverter.java
+++ b/components/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/SpringTypeConverter.java
@@ -17,6 +17,7 @@
package org.apache.camel.spring.boot;
import java.util.List;
+import java.util.Map;
import org.apache.camel.Exchange;
import org.apache.camel.StreamCache;
@@ -40,6 +41,11 @@ public class SpringTypeConverter extends TypeConverterSupport {
if (type.getCanonicalName().startsWith("org.apache")) {
return null;
}
+
+ // do not attempt to convert List -> Map. Ognl expression may use this converter as a fallback expecting null
+ if (type.isAssignableFrom(Map.class) && (value.getClass().isArray() || value instanceof List)) {
+ return null;
+ }
for (ConversionService conversionService : conversionServices) {
if (conversionService.canConvert(value.getClass(), type)) {
http://git-wip-us.apache.org/repos/asf/camel/blob/dc640034/components/camel-spring-boot/src/test/java/org/apache/camel/spring/boot/issues/SimpleOgnlTest.java
----------------------------------------------------------------------
diff --git a/components/camel-spring-boot/src/test/java/org/apache/camel/spring/boot/issues/SimpleOgnlTest.java b/components/camel-spring-boot/src/test/java/org/apache/camel/spring/boot/issues/SimpleOgnlTest.java
new file mode 100644
index 0000000..99fcd66
--- /dev/null
+++ b/components/camel-spring-boot/src/test/java/org/apache/camel/spring/boot/issues/SimpleOgnlTest.java
@@ -0,0 +1,53 @@
+package org.apache.camel.spring.boot.issues;
+
+import java.util.ArrayList;
+import java.util.List;
+
+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.junit.Test;
+import org.junit.runner.RunWith;
+import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
+import org.springframework.boot.test.context.SpringBootTest;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.test.context.junit4.SpringRunner;
+
+@RunWith(SpringRunner.class)
+@EnableAutoConfiguration
+@SpringBootTest(classes = {SimpleOgnlTest.class})
+public class SimpleOgnlTest {
+ @EndpointInject(uri = "mock:result")
+ protected MockEndpoint resultEndpoint;
+
+ @Produce(uri = "direct:start")
+ protected ProducerTemplate template;
+
+ @Test
+ public void testSimpleOgnlListExpression() throws Exception {
+ List<String> list = new ArrayList<String>();
+ list.add("one");
+ list.add("two");
+
+ resultEndpoint.expectedBodiesReceived(list.get(0));
+
+ template.sendBody(list);
+
+ resultEndpoint.assertIsSatisfied();
+ }
+
+ @Configuration
+ public static class ContextConfig {
+ @Bean
+ public RouteBuilder route() {
+ return new RouteBuilder() {
+ public void configure() {
+ from("direct:start").setBody(simple("${body[0]}")).to("mock:result");
+ }
+ };
+ }
+ }
+}
[5/8] camel git commit: CAMEL-10385: springtypeconverter return null
on list -> map
Posted by da...@apache.org.
CAMEL-10385: springtypeconverter return null on list -> map
Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/50ea01a5
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/50ea01a5
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/50ea01a5
Branch: refs/heads/master
Commit: 50ea01a50f8daa0745a55d0017afac63ec82e1b8
Parents: 2dda57e
Author: dmitriy <xh...@gmail.com>
Authored: Thu Oct 13 01:37:50 2016 -0400
Committer: Claus Ibsen <da...@apache.org>
Committed: Fri Oct 14 09:33:09 2016 +0200
----------------------------------------------------------------------
.../camel/spring/boot/SpringTypeConverter.java | 6 +++
.../spring/boot/issues/SimpleOgnlTest.java | 53 ++++++++++++++++++++
2 files changed, 59 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/camel/blob/50ea01a5/components/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/SpringTypeConverter.java
----------------------------------------------------------------------
diff --git a/components/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/SpringTypeConverter.java b/components/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/SpringTypeConverter.java
index d7020e5..c4aff73 100644
--- a/components/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/SpringTypeConverter.java
+++ b/components/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/SpringTypeConverter.java
@@ -17,6 +17,7 @@
package org.apache.camel.spring.boot;
import java.util.List;
+import java.util.Map;
import org.apache.camel.Exchange;
import org.apache.camel.StreamCache;
@@ -40,6 +41,11 @@ public class SpringTypeConverter extends TypeConverterSupport {
if (type.getCanonicalName().startsWith("org.apache")) {
return null;
}
+
+ // do not attempt to convert List -> Map. Ognl expression may use this converter as a fallback expecting null
+ if (type.isAssignableFrom(Map.class) && (value.getClass().isArray() || value instanceof List)) {
+ return null;
+ }
for (ConversionService conversionService : conversionServices) {
if (conversionService.canConvert(value.getClass(), type)) {
http://git-wip-us.apache.org/repos/asf/camel/blob/50ea01a5/components/camel-spring-boot/src/test/java/org/apache/camel/spring/boot/issues/SimpleOgnlTest.java
----------------------------------------------------------------------
diff --git a/components/camel-spring-boot/src/test/java/org/apache/camel/spring/boot/issues/SimpleOgnlTest.java b/components/camel-spring-boot/src/test/java/org/apache/camel/spring/boot/issues/SimpleOgnlTest.java
new file mode 100644
index 0000000..99fcd66
--- /dev/null
+++ b/components/camel-spring-boot/src/test/java/org/apache/camel/spring/boot/issues/SimpleOgnlTest.java
@@ -0,0 +1,53 @@
+package org.apache.camel.spring.boot.issues;
+
+import java.util.ArrayList;
+import java.util.List;
+
+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.junit.Test;
+import org.junit.runner.RunWith;
+import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
+import org.springframework.boot.test.context.SpringBootTest;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.test.context.junit4.SpringRunner;
+
+@RunWith(SpringRunner.class)
+@EnableAutoConfiguration
+@SpringBootTest(classes = {SimpleOgnlTest.class})
+public class SimpleOgnlTest {
+ @EndpointInject(uri = "mock:result")
+ protected MockEndpoint resultEndpoint;
+
+ @Produce(uri = "direct:start")
+ protected ProducerTemplate template;
+
+ @Test
+ public void testSimpleOgnlListExpression() throws Exception {
+ List<String> list = new ArrayList<String>();
+ list.add("one");
+ list.add("two");
+
+ resultEndpoint.expectedBodiesReceived(list.get(0));
+
+ template.sendBody(list);
+
+ resultEndpoint.assertIsSatisfied();
+ }
+
+ @Configuration
+ public static class ContextConfig {
+ @Bean
+ public RouteBuilder route() {
+ return new RouteBuilder() {
+ public void configure() {
+ from("direct:start").setBody(simple("${body[0]}")).to("mock:result");
+ }
+ };
+ }
+ }
+}
[7/8] camel git commit: CAMEL-10385: fix checkstyle errors
Posted by da...@apache.org.
CAMEL-10385: fix checkstyle errors
Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/ca3d735b
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/ca3d735b
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/ca3d735b
Branch: refs/heads/master
Commit: ca3d735b8f02c7fe545483c579b1f696e8054b1f
Parents: b3848d6
Author: dmitriy <xh...@gmail.com>
Authored: Thu Oct 13 09:52:29 2016 -0400
Committer: Claus Ibsen <da...@apache.org>
Committed: Fri Oct 14 09:33:22 2016 +0200
----------------------------------------------------------------------
.../camel/spring/boot/SpringTypeConverter.java | 2 +-
.../spring/boot/issues/SimpleOgnlTest.java | 48 ++++++++++----------
2 files changed, 25 insertions(+), 25 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/camel/blob/ca3d735b/components/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/SpringTypeConverter.java
----------------------------------------------------------------------
diff --git a/components/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/SpringTypeConverter.java b/components/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/SpringTypeConverter.java
index c4aff73..3818148 100644
--- a/components/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/SpringTypeConverter.java
+++ b/components/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/SpringTypeConverter.java
@@ -44,7 +44,7 @@ public class SpringTypeConverter extends TypeConverterSupport {
// do not attempt to convert List -> Map. Ognl expression may use this converter as a fallback expecting null
if (type.isAssignableFrom(Map.class) && (value.getClass().isArray() || value instanceof List)) {
- return null;
+ return null;
}
for (ConversionService conversionService : conversionServices) {
http://git-wip-us.apache.org/repos/asf/camel/blob/ca3d735b/components/camel-spring-boot/src/test/java/org/apache/camel/spring/boot/issues/SimpleOgnlTest.java
----------------------------------------------------------------------
diff --git a/components/camel-spring-boot/src/test/java/org/apache/camel/spring/boot/issues/SimpleOgnlTest.java b/components/camel-spring-boot/src/test/java/org/apache/camel/spring/boot/issues/SimpleOgnlTest.java
index 969ad50..72024e2 100644
--- a/components/camel-spring-boot/src/test/java/org/apache/camel/spring/boot/issues/SimpleOgnlTest.java
+++ b/components/camel-spring-boot/src/test/java/org/apache/camel/spring/boot/issues/SimpleOgnlTest.java
@@ -36,34 +36,34 @@ import org.springframework.test.context.junit4.SpringRunner;
@EnableAutoConfiguration
@SpringBootTest(classes = { SimpleOgnlTest.class })
public class SimpleOgnlTest {
- @EndpointInject(uri = "mock:result")
- protected MockEndpoint resultEndpoint;
+ @EndpointInject(uri = "mock:result")
+ protected MockEndpoint resultEndpoint;
- @Produce(uri = "direct:start")
- protected ProducerTemplate template;
+ @Produce(uri = "direct:start")
+ protected ProducerTemplate template;
- @Test
- public void testSimpleOgnlListExpression() throws Exception {
- List<String> list = new ArrayList<String>();
- list.add("one");
- list.add("two");
+ @Test
+ public void testSimpleOgnlListExpression() throws Exception {
+ List<String> list = new ArrayList<String>();
+ list.add("one");
+ list.add("two");
- resultEndpoint.expectedBodiesReceived(list.get(0));
+ resultEndpoint.expectedBodiesReceived(list.get(0));
- template.sendBody(list);
+ template.sendBody(list);
- resultEndpoint.assertIsSatisfied();
- }
+ resultEndpoint.assertIsSatisfied();
+ }
- @Configuration
- public static class ContextConfig {
- @Bean
- public RouteBuilder route() {
- return new RouteBuilder() {
- public void configure() {
- from("direct:start").setBody(simple("${body[0]}")).to("mock:result");
- }
- };
- }
- }
+ @Configuration
+ public static class ContextConfig {
+ @Bean
+ public RouteBuilder route() {
+ return new RouteBuilder() {
+ public void configure() {
+ from("direct:start").setBody(simple("${body[0]}")).to("mock:result");
+ }
+ };
+ }
+ }
}
[6/8] camel git commit: CAMEL-10385: fix checkstyle errors
Posted by da...@apache.org.
CAMEL-10385: fix checkstyle errors
Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/b3848d6f
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/b3848d6f
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/b3848d6f
Branch: refs/heads/master
Commit: b3848d6f5c011673f81519e4c7fc71cedc87c5a3
Parents: 50ea01a
Author: dmitriy <xh...@gmail.com>
Authored: Thu Oct 13 09:44:17 2016 -0400
Committer: Claus Ibsen <da...@apache.org>
Committed: Fri Oct 14 09:33:15 2016 +0200
----------------------------------------------------------------------
.../spring/boot/issues/SimpleOgnlTest.java | 66 ++++++++++++--------
1 file changed, 41 insertions(+), 25 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/camel/blob/b3848d6f/components/camel-spring-boot/src/test/java/org/apache/camel/spring/boot/issues/SimpleOgnlTest.java
----------------------------------------------------------------------
diff --git a/components/camel-spring-boot/src/test/java/org/apache/camel/spring/boot/issues/SimpleOgnlTest.java b/components/camel-spring-boot/src/test/java/org/apache/camel/spring/boot/issues/SimpleOgnlTest.java
index 99fcd66..969ad50 100644
--- a/components/camel-spring-boot/src/test/java/org/apache/camel/spring/boot/issues/SimpleOgnlTest.java
+++ b/components/camel-spring-boot/src/test/java/org/apache/camel/spring/boot/issues/SimpleOgnlTest.java
@@ -1,3 +1,19 @@
+/**
+ * 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.spring.boot.issues;
import java.util.ArrayList;
@@ -18,36 +34,36 @@ import org.springframework.test.context.junit4.SpringRunner;
@RunWith(SpringRunner.class)
@EnableAutoConfiguration
-@SpringBootTest(classes = {SimpleOgnlTest.class})
+@SpringBootTest(classes = { SimpleOgnlTest.class })
public class SimpleOgnlTest {
@EndpointInject(uri = "mock:result")
- protected MockEndpoint resultEndpoint;
-
- @Produce(uri = "direct:start")
- protected ProducerTemplate template;
-
+ protected MockEndpoint resultEndpoint;
+
+ @Produce(uri = "direct:start")
+ protected ProducerTemplate template;
+
@Test
- public void testSimpleOgnlListExpression() throws Exception {
+ public void testSimpleOgnlListExpression() throws Exception {
List<String> list = new ArrayList<String>();
list.add("one");
list.add("two");
-
- resultEndpoint.expectedBodiesReceived(list.get(0));
-
- template.sendBody(list);
-
- resultEndpoint.assertIsSatisfied();
- }
-
+
+ resultEndpoint.expectedBodiesReceived(list.get(0));
+
+ template.sendBody(list);
+
+ resultEndpoint.assertIsSatisfied();
+ }
+
@Configuration
- public static class ContextConfig {
- @Bean
- public RouteBuilder route() {
- return new RouteBuilder() {
- public void configure() {
- from("direct:start").setBody(simple("${body[0]}")).to("mock:result");
- }
- };
- }
- }
+ public static class ContextConfig {
+ @Bean
+ public RouteBuilder route() {
+ return new RouteBuilder() {
+ public void configure() {
+ from("direct:start").setBody(simple("${body[0]}")).to("mock:result");
+ }
+ };
+ }
+ }
}
[8/8] camel git commit: CAMEL-10385: capture all structures of type
collection
Posted by da...@apache.org.
CAMEL-10385: capture all structures of type collection
Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/abb08fa9
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/abb08fa9
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/abb08fa9
Branch: refs/heads/master
Commit: abb08fa9bb18c3d36519e6b136bc07fbc7a210b7
Parents: ca3d735
Author: dmitriy <xh...@gmail.com>
Authored: Thu Oct 13 17:28:55 2016 -0400
Committer: Claus Ibsen <da...@apache.org>
Committed: Fri Oct 14 09:33:34 2016 +0200
----------------------------------------------------------------------
.../java/org/apache/camel/spring/boot/SpringTypeConverter.java | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/camel/blob/abb08fa9/components/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/SpringTypeConverter.java
----------------------------------------------------------------------
diff --git a/components/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/SpringTypeConverter.java b/components/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/SpringTypeConverter.java
index 3818148..5f4021a 100644
--- a/components/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/SpringTypeConverter.java
+++ b/components/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/SpringTypeConverter.java
@@ -16,11 +16,11 @@
*/
package org.apache.camel.spring.boot;
+import java.util.Collection;
import java.util.List;
import java.util.Map;
import org.apache.camel.Exchange;
-import org.apache.camel.StreamCache;
import org.apache.camel.TypeConversionException;
import org.apache.camel.support.TypeConverterSupport;
import org.springframework.beans.factory.annotation.Autowired;
@@ -43,7 +43,7 @@ public class SpringTypeConverter extends TypeConverterSupport {
}
// do not attempt to convert List -> Map. Ognl expression may use this converter as a fallback expecting null
- if (type.isAssignableFrom(Map.class) && (value.getClass().isArray() || value instanceof List)) {
+ if (type.isAssignableFrom(Map.class) && (value.getClass().isArray() || value instanceof Collection)) {
return null;
}