You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by gn...@apache.org on 2019/06/07 08:36:17 UTC

[camel] branch endpoint-dsl updated: Add an EndpointRouteBuilder to access the DSL directly

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

gnodet pushed a commit to branch endpoint-dsl
in repository https://gitbox.apache.org/repos/asf/camel.git


The following commit(s) were added to refs/heads/endpoint-dsl by this push:
     new 011e7fd  Add an EndpointRouteBuilder to access the DSL directly
011e7fd is described below

commit 011e7fdfcf34ebab1843df5c80c1db534e1a51df
Author: Guillaume Nodet <gn...@gmail.com>
AuthorDate: Fri Jun 7 10:35:58 2019 +0200

    Add an EndpointRouteBuilder to access the DSL directly
---
 .../apache/camel/builder/EndpointRouteBuilder.java | 26 ++++++++++++++++++++++
 .../component/file/FileConsumeCharsetTest.java     |  4 ++--
 2 files changed, 28 insertions(+), 2 deletions(-)

diff --git a/core/camel-core/src/main/java/org/apache/camel/builder/EndpointRouteBuilder.java b/core/camel-core/src/main/java/org/apache/camel/builder/EndpointRouteBuilder.java
new file mode 100644
index 0000000..8bad83f
--- /dev/null
+++ b/core/camel-core/src/main/java/org/apache/camel/builder/EndpointRouteBuilder.java
@@ -0,0 +1,26 @@
+/*
+ * 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.builder;
+
+import org.apache.camel.model.endpoint.EndpointBuilder;
+
+/**
+ * A route builder which gives access to the endpoint DSL
+ */
+public abstract class EndpointRouteBuilder extends RouteBuilder implements EndpointBuilder {
+
+}
diff --git a/core/camel-core/src/test/java/org/apache/camel/component/file/FileConsumeCharsetTest.java b/core/camel-core/src/test/java/org/apache/camel/component/file/FileConsumeCharsetTest.java
index c69ad65..3fa907b 100644
--- a/core/camel-core/src/test/java/org/apache/camel/component/file/FileConsumeCharsetTest.java
+++ b/core/camel-core/src/test/java/org/apache/camel/component/file/FileConsumeCharsetTest.java
@@ -19,6 +19,7 @@ import java.io.File;
 
 import org.apache.camel.ContextTestSupport;
 import org.apache.camel.Exchange;
+import org.apache.camel.builder.EndpointRouteBuilder;
 import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.component.mock.MockEndpoint;
 import org.apache.camel.model.endpoint.EndpointBuilder;
@@ -29,7 +30,6 @@ import org.junit.Test;
  *
  */
 public class FileConsumeCharsetTest extends ContextTestSupport
-    implements EndpointBuilder
         {
 
     @Override
@@ -55,7 +55,7 @@ public class FileConsumeCharsetTest extends ContextTestSupport
 
     @Override
     protected RouteBuilder createRouteBuilder() throws Exception {
-        return new RouteBuilder() {
+        return new EndpointRouteBuilder() {
             public void configure() throws Exception {
                 from(fromFile("target/data/files/").initialDelay(0).delay(10).fileName(constant("report.txt")).delete(true).charset("UTF-8"))
                     .convertBodyTo(String.class)