camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject [2/5] camel git commit: Upgrade checkstyle for better lambda support.
Date Fri, 29 Apr 2016 06:47:02 GMT
Upgrade checkstyle for better lambda support.


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

Branch: refs/heads/master
Commit: 1151af446b089fc8839e6d5a289aee02d382d63c
Parents: 1569aa4
Author: Claus Ibsen <davsclaus@apache.org>
Authored: Fri Apr 29 07:40:45 2016 +0200
Committer: Claus Ibsen <davsclaus@apache.org>
Committed: Fri Apr 29 08:46:49 2016 +0200

----------------------------------------------------------------------
 .../component/directvm/DirectVmProducer.java    | 26 ++++++------
 .../builder/FluentProducerTemplateTest.java     | 44 ++++++++++----------
 .../DirectVmHeaderFilterStrategyTest.java       | 18 ++++----
 parent/pom.xml                                  |  2 +-
 4 files changed, 45 insertions(+), 45 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/1151af44/camel-core/src/main/java/org/apache/camel/component/directvm/DirectVmProducer.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/component/directvm/DirectVmProducer.java
b/camel-core/src/main/java/org/apache/camel/component/directvm/DirectVmProducer.java
index d93d849..60d6f59 100644
--- a/camel-core/src/main/java/org/apache/camel/component/directvm/DirectVmProducer.java
+++ b/camel-core/src/main/java/org/apache/camel/component/directvm/DirectVmProducer.java
@@ -64,19 +64,19 @@ public class DirectVmProducer extends DefaultAsyncProducer {
         }
         
         return consumer.getAsyncProcessor().process(submitted, done -> {
-                exchange.setException(submitted.getException());
-                exchange.getOut().copyFrom(submitted.hasOut() ? submitted.getOut() : submitted.getIn());
-            
-                if (headerFilterStrategy != null) {
-                    exchange.getOut().getHeaders().entrySet().removeIf(e -> headerFilterStrategy.applyFilterToExternalHeaders(e.getKey(),
e.getValue(), submitted));
-                }
-                
-                if (endpoint.isPropagateProperties()) {
-                    exchange.getProperties().putAll(submitted.getProperties());
-                }
-                
-                callback.done(done);
-            });
+            exchange.setException(submitted.getException());
+            exchange.getOut().copyFrom(submitted.hasOut() ? submitted.getOut() : submitted.getIn());
+
+            if (headerFilterStrategy != null) {
+                exchange.getOut().getHeaders().entrySet().removeIf(e -> headerFilterStrategy.applyFilterToExternalHeaders(e.getKey(),
e.getValue(), submitted));
+            }
+
+            if (endpoint.isPropagateProperties()) {
+                exchange.getProperties().putAll(submitted.getProperties());
+            }
+
+            callback.done(done);
+        });
     }
     
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/camel/blob/1151af44/camel-core/src/test/java/org/apache/camel/builder/FluentProducerTemplateTest.java
----------------------------------------------------------------------
diff --git a/camel-core/src/test/java/org/apache/camel/builder/FluentProducerTemplateTest.java
b/camel-core/src/test/java/org/apache/camel/builder/FluentProducerTemplateTest.java
index c25a1a1..c95a8ad 100644
--- a/camel-core/src/test/java/org/apache/camel/builder/FluentProducerTemplateTest.java
+++ b/camel-core/src/test/java/org/apache/camel/builder/FluentProducerTemplateTest.java
@@ -76,7 +76,7 @@ public class FluentProducerTemplateTest extends ContextTestSupport {
         MockEndpoint mock = getMockEndpoint("mock:result");
         mock.expectedMessageCount(0);
 
-        Exchange out =  FluentProducerTemplate.on(context)
+        Exchange out = FluentProducerTemplate.on(context)
             .withBody("Hello World")
             .to("direct:exception")
             .send();
@@ -124,14 +124,13 @@ public class FluentProducerTemplateTest extends ContextTestSupport {
         mock.expectedMessageCount(0);
 
         Exchange out = FluentProducerTemplate.on(context)
-            .withExchange(() -> {
+                .withExchange(() -> {
                     Exchange exchange = context.getEndpoint("direct:exception").createExchange();
                     exchange.getIn().setBody("Hello World");
-
                     return exchange;
                 })
-            .to("direct:exception")
-            .send();
+                .to("direct:exception")
+                .send();
 
         assertTrue(out.isFailed());
         assertEquals("Forced exception by unit test", out.getException().getMessage());
@@ -179,11 +178,10 @@ public class FluentProducerTemplateTest extends ContextTestSupport {
 
         Exchange out = FluentProducerTemplate.on(context)
             .withExchange(() -> {
-                    Exchange exchange = context.getEndpoint("direct:exception").createExchange(ExchangePattern.InOut);
-                    exchange.getIn().setBody("Hello World");
-
-                    return exchange;
-                })
+                Exchange exchange = context.getEndpoint("direct:exception").createExchange(ExchangePattern.InOut);
+                exchange.getIn().setBody("Hello World");
+                return exchange;
+            })
             .to("direct:exception")
             .send();
 
@@ -263,25 +261,25 @@ public class FluentProducerTemplateTest extends ContextTestSupport {
                 // for faster unit test
                 errorHandler(noErrorHandler());
 
-                from("direct:in").process(
-                        exchange -> exchange.getIn().setBody("Bye World"))
+                from("direct:in")
+                    .process(exchange -> exchange.getIn().setBody("Bye World"))
                     .to("mock:result");
 
-                from("direct:out").process(
-                        exchange -> exchange.getOut().setBody("Bye Bye World"))
+                from("direct:out")
+                    .process(exchange -> exchange.getOut().setBody("Bye Bye World"))
                     .to("mock:result");
 
-                from("direct:fault").process(
-                        exchange -> {
-                                exchange.getOut().setFault(true);
-                                exchange.getOut().setBody("Faulty World");
-                            })
+                from("direct:fault")
+                    .process(exchange -> {
+                        exchange.getOut().setFault(true);
+                        exchange.getOut().setBody("Faulty World");
+                    })
                     .to("mock:result");
 
-                from("direct:exception").process(
-                        exchange -> {
-                                throw new IllegalArgumentException("Forced exception by unit
test");
-                            })
+                from("direct:exception")
+                    .process(exchange -> {
+                        throw new IllegalArgumentException("Forced exception by unit test");
+                    })
                     .to("mock:result");
 
                 from("direct:inout").transform(constant(123));

http://git-wip-us.apache.org/repos/asf/camel/blob/1151af44/camel-core/src/test/java/org/apache/camel/component/directvm/DirectVmHeaderFilterStrategyTest.java
----------------------------------------------------------------------
diff --git a/camel-core/src/test/java/org/apache/camel/component/directvm/DirectVmHeaderFilterStrategyTest.java
b/camel-core/src/test/java/org/apache/camel/component/directvm/DirectVmHeaderFilterStrategyTest.java
index 40315d1..5386774 100644
--- a/camel-core/src/test/java/org/apache/camel/component/directvm/DirectVmHeaderFilterStrategyTest.java
+++ b/camel-core/src/test/java/org/apache/camel/component/directvm/DirectVmHeaderFilterStrategyTest.java
@@ -41,17 +41,17 @@ public class DirectVmHeaderFilterStrategyTest extends ContextTestSupport
{
         });
         
         Exchange response = template.request("direct-vm:start.filter?headerFilterStrategy=#headerFilterStrategy",
exchange -> {
-                exchange.getIn().setBody("Hello World");
-                exchange.getIn().setHeader("Header1", "Value1");
-            });
+            exchange.getIn().setBody("Hello World");
+            exchange.getIn().setHeader("Header1", "Value1");
+        });
         
         assertNull(response.getException());
         assertNull(response.getOut().getHeader("Header2"));
         
         response = template.request("direct-vm:start.nofilter", exchange -> {
-                exchange.getIn().setBody("Hello World");
-                exchange.getIn().setHeader("Header1", "Value1");
-            });
+            exchange.getIn().setBody("Hello World");
+            exchange.getIn().setHeader("Header1", "Value1");
+        });
         
         assertNull(response.getException());
         assertEquals("Value2", response.getOut().getHeader("Header2", String.class));
@@ -61,12 +61,14 @@ public class DirectVmHeaderFilterStrategyTest extends ContextTestSupport
{
     protected RouteBuilder createRouteBuilder() throws Exception {
         return new RouteBuilder() {
             public void configure() throws Exception {
-                from("direct-vm:start.filter").process(exchange -> {
+                from("direct-vm:start.filter")
+                    .process(exchange -> {
                         assertNull(exchange.getIn().getHeader("Header1"));
                         exchange.getIn().setHeader("Header2", "Value2");
                     });
                 
-                from("direct-vm:start.nofilter").process(exchange -> {
+                from("direct-vm:start.nofilter")
+                    .process(exchange -> {
                         assertEquals("Value1", exchange.getIn().getHeader("Header1"));
                         exchange.getIn().setHeader("Header2", "Value2");
                     });

http://git-wip-us.apache.org/repos/asf/camel/blob/1151af44/parent/pom.xml
----------------------------------------------------------------------
diff --git a/parent/pom.xml b/parent/pom.xml
index d102c5c..d6dfde0 100644
--- a/parent/pom.xml
+++ b/parent/pom.xml
@@ -385,7 +385,7 @@
     <!-- AtomicException.java causes a problem with Checksyle > 6.6 due to 
         https://github.com/checkstyle/checkstyle/issues/1903
      -->
-    <maven-checkstyle-version>6.6</maven-checkstyle-version>
+    <maven-checkstyle-version>6.17</maven-checkstyle-version>
     <maven-eclipse-plugin-version>2.10</maven-eclipse-plugin-version>
     <maven-jar-plugin-version>2.6</maven-jar-plugin-version>
     <maven-javadoc-plugin-version>2.9.1</maven-javadoc-plugin-version>


Mime
View raw message