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 2019/01/08 08:49:41 UTC
[camel] 06/06: Fixed CS in Billboard Example and regen
This is an automated email from the ASF dual-hosted git repository.
acosentino pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git
commit 2bf7091d7c852a7fe591d1822b4e19edeb6c3b38
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Tue Jan 8 09:48:17 2019 +0100
Fixed CS in Billboard Example and regen
---
examples/README.adoc | 6 +++---
.../apache/camel/example/billboard/BillboardAggrTest.java | 14 +++++++-------
2 files changed, 10 insertions(+), 10 deletions(-)
diff --git a/examples/README.adoc b/examples/README.adoc
index ded3ccd..e25c6b8 100644
--- a/examples/README.adoc
+++ b/examples/README.adoc
@@ -11,12 +11,14 @@ View the individual example READMEs for details.
### Examples
// examples: START
-Number of Examples: 102 (2 deprecated)
+Number of Examples: 103 (2 deprecated)
[width="100%",cols="4,2,4",options="header"]
|===
| Example | Category | Description
+| link:camel-example-billboard-aggr/README.md[Billboard Aggr] (camel-example-billboard-aggr) | | Billboard aggregation example
+
| link:camel-example-micrometer/README.md[Micrometer] (camel-example-micrometer) | Advanced | An example showing how to work with Camel, Spring Java Config and Micrometer monitoring
| link:camel-example-cdi/README.md[CDI] (camel-example-cdi) | Beginner | An example showing how to work with Camel and CDI for dependency injection
@@ -231,8 +233,6 @@ Number of Examples: 102 (2 deprecated)
| link:camel-example-cxf-ws-security-signature/README.md[CXF using WS-Security Signature] (camel-example-cxf-ws-security-signature) | WebService | CXF example using WS-Security Signature Action
| link:camel-example-spring-ws/README.md[Spring WebService] (camel-example-spring-ws) | WebService | An example showing how to work with Camel and Spring Web Services
-
-| link:camel-example-billboard-aggr/README.md[Aggregation Test] (camel-example-billboard-aggr) | Testing | Billboard TOP100 aggregation example
|===
// examples: END
diff --git a/examples/camel-example-billboard-aggr/src/test/java/org/apache/camel/example/billboard/BillboardAggrTest.java b/examples/camel-example-billboard-aggr/src/test/java/org/apache/camel/example/billboard/BillboardAggrTest.java
index 9d1ff4d..6991ce6 100644
--- a/examples/camel-example-billboard-aggr/src/test/java/org/apache/camel/example/billboard/BillboardAggrTest.java
+++ b/examples/camel-example-billboard-aggr/src/test/java/org/apache/camel/example/billboard/BillboardAggrTest.java
@@ -21,20 +21,20 @@ import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import java.util.stream.Collectors;
+import org.apache.camel.AggregationStrategy;
+import org.apache.camel.CamelContext;
import org.apache.camel.Exchange;
import org.apache.camel.Message;
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.component.mock.MockEndpoint;
import org.apache.camel.model.dataformat.BindyType;
-import org.apache.camel.AggregationStrategy;
-import org.apache.camel.CamelContext;
import org.apache.camel.test.junit4.CamelTestSupport;
import org.junit.Test;
public class BillboardAggrTest extends CamelTestSupport {
- private final static String basePath = System.getProperty("user.dir") + "/src/data";
+ private static final String BASEPATH = System.getProperty("user.dir") + "/src/data";
@Override
protected CamelContext createCamelContext() throws Exception {
@@ -56,7 +56,7 @@ public class BillboardAggrTest extends CamelTestSupport {
Map<String, Integer> top20 = ((MyAggregationStrategy)
mock.getReceivedExchanges().get(0).getIn().getHeader("myAggregation")).getTop20Artists();
- top20.forEach((k,v) -> log.info("{}, {}", k, v));
+ top20.forEach((k, v) -> log.info("{}, {}", k, v));
assertEquals(20, top20.size());
assertEquals(35, (int) top20.get("madonna"));
assertEquals(26, (int) top20.get("elton john"));
@@ -68,7 +68,7 @@ public class BillboardAggrTest extends CamelTestSupport {
return new RouteBuilder() {
@Override
public void configure() throws Exception {
- from("file:" + basePath + "?noop=true")
+ from("file:" + BASEPATH + "?noop=true")
.split(body().tokenize("\n")).streaming().parallelProcessing()
// skip first line with headers
.choice().when(simple("${property.CamelSplitIndex} > 0"))
@@ -79,7 +79,7 @@ public class BillboardAggrTest extends CamelTestSupport {
// malformed record trace
.setBody(simple("${property.CamelSplitIndex}:${body}"))
.transform(body().append("\n"))
- .to("file:" + basePath + "?fileName=waste.log&fileExist=append")
+ .to("file:" + BASEPATH + "?fileName=waste.log&fileExist=append")
.end();
from("seda:aggregate?concurrentConsumers=10")
@@ -114,7 +114,7 @@ public class BillboardAggrTest extends CamelTestSupport {
public Map<String, Integer> getTop20Artists() {
return map.entrySet()
.stream()
- .sorted((Map.Entry.<String, Integer>comparingByValue().reversed()))
+ .sorted(Map.Entry.<String, Integer>comparingByValue().reversed())
.limit(20)
.collect(Collectors.toMap(Map.Entry::getKey,
Map.Entry::getValue, (e1, e2) -> e1, LinkedHashMap::new));