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/12/05 13:12:50 UTC
[17/25] camel git commit: CAMEL-10559: route parser for java and xml
to parse source code. Donated from fabric8 project.
http://git-wip-us.apache.org/repos/asf/camel/blob/88ba9063/tooling/route-parser/src/test/java/org/apache/camel/parser/java/RoasterMyNettyTest.java
----------------------------------------------------------------------
diff --git a/tooling/route-parser/src/test/java/org/apache/camel/parser/java/RoasterMyNettyTest.java b/tooling/route-parser/src/test/java/org/apache/camel/parser/java/RoasterMyNettyTest.java
deleted file mode 100644
index 603d96f..0000000
--- a/tooling/route-parser/src/test/java/org/apache/camel/parser/java/RoasterMyNettyTest.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/**
- * 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.parser.java;
-
-import java.io.File;
-import java.util.List;
-
-import org.apache.camel.parser.ParserResult;
-import org.apache.camel.parser.helper.CamelJavaParserHelper;
-import org.jboss.forge.roaster.Roaster;
-import org.jboss.forge.roaster.model.source.JavaClassSource;
-import org.jboss.forge.roaster.model.source.MethodSource;
-import org.junit.Assert;
-import org.junit.Test;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class RoasterMyNettyTest {
-
- private static final Logger LOG = LoggerFactory.getLogger(RoasterMyNettyTest.class);
-
- @Test
- public void parse() throws Exception {
- JavaClassSource clazz = (JavaClassSource) Roaster.parse(new File("src/test/java/org/apache/camel/parser/java/MyNettyTest.java"));
- MethodSource<JavaClassSource> method = CamelJavaParserHelper.findConfigureMethod(clazz);
-
- List<ParserResult> list = CamelJavaParserHelper.parseCamelConsumerUris(method, true, true);
- for (ParserResult result : list) {
- LOG.info("Consumer: " + result.getElement());
- }
- Assert.assertEquals("netty-http:http://0.0.0.0:{{port}}/foo", list.get(0).getElement());
- Assert.assertEquals("netty-http:http://0.0.0.0:{{getNextPort}}/bar", list.get(1).getElement());
-
- list = CamelJavaParserHelper.parseCamelProducerUris(method, true, true);
- for (ParserResult result : list) {
- LOG.info("Producer: " + result.getElement());
- }
- Assert.assertEquals("mock:input1", list.get(0).getElement());
- Assert.assertEquals("netty-http:http://0.0.0.0:{{getNextPort}}/bar", list.get(1).getElement());
- Assert.assertEquals("mock:input2", list.get(2).getElement());
- }
-
-}
http://git-wip-us.apache.org/repos/asf/camel/blob/88ba9063/tooling/route-parser/src/test/java/org/apache/camel/parser/java/RoasterNewLineConstRouteBuilderConfigureTest.java
----------------------------------------------------------------------
diff --git a/tooling/route-parser/src/test/java/org/apache/camel/parser/java/RoasterNewLineConstRouteBuilderConfigureTest.java b/tooling/route-parser/src/test/java/org/apache/camel/parser/java/RoasterNewLineConstRouteBuilderConfigureTest.java
deleted file mode 100644
index 3b7cb69..0000000
--- a/tooling/route-parser/src/test/java/org/apache/camel/parser/java/RoasterNewLineConstRouteBuilderConfigureTest.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/**
- * 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.parser.java;
-
-import java.io.File;
-import java.util.List;
-
-import org.apache.camel.parser.ParserResult;
-import org.apache.camel.parser.helper.CamelJavaParserHelper;
-import org.jboss.forge.roaster.Roaster;
-import org.jboss.forge.roaster.model.source.JavaClassSource;
-import org.jboss.forge.roaster.model.source.MethodSource;
-import org.junit.Assert;
-import org.junit.Test;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class RoasterNewLineConstRouteBuilderConfigureTest {
-
- private static final Logger LOG = LoggerFactory.getLogger(RoasterNewLineConstRouteBuilderConfigureTest.class);
-
- @Test
- public void parse() throws Exception {
- JavaClassSource clazz = (JavaClassSource) Roaster.parse(new File("src/test/java/org/apache/camel/parser/java/MyNewLineConstRouteBuilder.java"));
- MethodSource<JavaClassSource> method = clazz.getMethod("configure");
-
- List<ParserResult> list = CamelJavaParserHelper.parseCamelConsumerUris(method, true, false);
- for (ParserResult result : list) {
- LOG.info("Consumer: " + result.getElement());
- }
- Assert.assertEquals("timer:foo", list.get(0).getElement());
-
- list = CamelJavaParserHelper.parseCamelProducerUris(method, true, false);
- for (ParserResult result : list) {
- LOG.info("Producer: " + result.getElement());
- }
- Assert.assertEquals("file:output?fileExist=Append&chmod=777&allowNullBody=true", list.get(0).getElement());
- Assert.assertEquals("log:b", list.get(1).getElement());
- }
-
-}
http://git-wip-us.apache.org/repos/asf/camel/blob/88ba9063/tooling/route-parser/src/test/java/org/apache/camel/parser/java/RoasterNewLineRouteBuilderConfigureTest.java
----------------------------------------------------------------------
diff --git a/tooling/route-parser/src/test/java/org/apache/camel/parser/java/RoasterNewLineRouteBuilderConfigureTest.java b/tooling/route-parser/src/test/java/org/apache/camel/parser/java/RoasterNewLineRouteBuilderConfigureTest.java
deleted file mode 100644
index eeb320f..0000000
--- a/tooling/route-parser/src/test/java/org/apache/camel/parser/java/RoasterNewLineRouteBuilderConfigureTest.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/**
- * 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.parser.java;
-
-import java.io.File;
-import java.util.List;
-
-import org.apache.camel.parser.ParserResult;
-import org.apache.camel.parser.helper.CamelJavaParserHelper;
-import org.jboss.forge.roaster.Roaster;
-import org.jboss.forge.roaster.model.source.JavaClassSource;
-import org.jboss.forge.roaster.model.source.MethodSource;
-import org.junit.Assert;
-import org.junit.Test;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class RoasterNewLineRouteBuilderConfigureTest {
-
- private static final Logger LOG = LoggerFactory.getLogger(RoasterNewLineRouteBuilderConfigureTest.class);
-
- @Test
- public void parse() throws Exception {
- JavaClassSource clazz = (JavaClassSource) Roaster.parse(new File("src/test/java/org/apache/camel/parser/java/MyNewLineRouteBuilder.java"));
- MethodSource<JavaClassSource> method = clazz.getMethod("configure");
-
- List<ParserResult> list = CamelJavaParserHelper.parseCamelConsumerUris(method, true, false);
- for (ParserResult result : list) {
- LOG.info("Consumer: " + result.getElement());
- }
- Assert.assertEquals("timer:foo", list.get(0).getElement());
-
- list = CamelJavaParserHelper.parseCamelProducerUris(method, true, false);
- for (ParserResult result : list) {
- LOG.info("Producer: " + result.getElement());
- }
- Assert.assertEquals("file:output?fileExist=Append&chmod=777&allowNullBody=true", list.get(0).getElement());
- Assert.assertEquals("log:b", list.get(1).getElement());
- }
-
-}
http://git-wip-us.apache.org/repos/asf/camel/blob/88ba9063/tooling/route-parser/src/test/java/org/apache/camel/parser/java/RoasterRouteBuilderCamelTestSupportTest.java
----------------------------------------------------------------------
diff --git a/tooling/route-parser/src/test/java/org/apache/camel/parser/java/RoasterRouteBuilderCamelTestSupportTest.java b/tooling/route-parser/src/test/java/org/apache/camel/parser/java/RoasterRouteBuilderCamelTestSupportTest.java
deleted file mode 100644
index 9760f66..0000000
--- a/tooling/route-parser/src/test/java/org/apache/camel/parser/java/RoasterRouteBuilderCamelTestSupportTest.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/**
- * 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.parser.java;
-
-import java.io.File;
-import java.util.List;
-
-import org.apache.camel.parser.ParserResult;
-import org.apache.camel.parser.helper.CamelJavaParserHelper;
-import org.jboss.forge.roaster.Roaster;
-import org.jboss.forge.roaster.model.source.JavaClassSource;
-import org.jboss.forge.roaster.model.source.MethodSource;
-import org.junit.Assert;
-import org.junit.Test;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class RoasterRouteBuilderCamelTestSupportTest {
-
- private static final Logger LOG = LoggerFactory.getLogger(RoasterRouteBuilderCamelTestSupportTest.class);
-
- @Test
- public void parse() throws Exception {
- JavaClassSource clazz = (JavaClassSource) Roaster.parse(new File("src/test/java/org/apache/camel/parser/java/MyRouteTest.java"));
- MethodSource<JavaClassSource> method = CamelJavaParserHelper.findConfigureMethod(clazz);
-
- List<ParserResult> list = CamelJavaParserHelper.parseCamelConsumerUris(method, true, false);
- for (ParserResult result : list) {
- LOG.info("Consumer: " + result.getElement());
- }
- Assert.assertEquals("direct:foo", list.get(0).getElement());
-
- list = CamelJavaParserHelper.parseCamelProducerUris(method, true, false);
- for (ParserResult result : list) {
- LOG.info("Producer: " + result.getElement());
- }
- Assert.assertEquals("mock:foo", list.get(0).getElement());
- }
-
-}
http://git-wip-us.apache.org/repos/asf/camel/blob/88ba9063/tooling/route-parser/src/test/java/org/apache/camel/parser/java/RoasterRouteBuilderConfigureTest.java
----------------------------------------------------------------------
diff --git a/tooling/route-parser/src/test/java/org/apache/camel/parser/java/RoasterRouteBuilderConfigureTest.java b/tooling/route-parser/src/test/java/org/apache/camel/parser/java/RoasterRouteBuilderConfigureTest.java
deleted file mode 100644
index af9cb2e..0000000
--- a/tooling/route-parser/src/test/java/org/apache/camel/parser/java/RoasterRouteBuilderConfigureTest.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/**
- * 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.parser.java;
-
-import java.io.File;
-import java.util.List;
-
-import org.apache.camel.parser.ParserResult;
-import org.apache.camel.parser.helper.CamelJavaParserHelper;
-import org.jboss.forge.roaster.Roaster;
-import org.jboss.forge.roaster.model.source.JavaClassSource;
-import org.jboss.forge.roaster.model.source.MethodSource;
-import org.junit.Assert;
-import org.junit.Test;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class RoasterRouteBuilderConfigureTest {
-
- private static final Logger LOG = LoggerFactory.getLogger(RoasterRouteBuilderConfigureTest.class);
-
- @Test
- public void parse() throws Exception {
- JavaClassSource clazz = (JavaClassSource) Roaster.parse(new File("src/test/java/org/apache/camel/parser/java/MyRouteBuilder.java"));
- MethodSource<JavaClassSource> method = clazz.getMethod("configure");
-
- List<ParserResult> list = CamelJavaParserHelper.parseCamelConsumerUris(method, true, false);
- for (ParserResult result : list) {
- LOG.info("Consumer: " + result.getElement());
- }
- Assert.assertEquals("timer:foo", list.get(0).getElement());
-
- list = CamelJavaParserHelper.parseCamelProducerUris(method, true, false);
- for (ParserResult result : list) {
- LOG.info("Producer: " + result.getElement());
- }
- Assert.assertEquals("log:a", list.get(0).getElement());
- Assert.assertEquals("mock:tap", list.get(1).getElement());
- Assert.assertEquals("log:b", list.get(2).getElement());
- }
-
-}
http://git-wip-us.apache.org/repos/asf/camel/blob/88ba9063/tooling/route-parser/src/test/java/org/apache/camel/parser/java/RoasterRouteBuilderEmptyUriTest.java
----------------------------------------------------------------------
diff --git a/tooling/route-parser/src/test/java/org/apache/camel/parser/java/RoasterRouteBuilderEmptyUriTest.java b/tooling/route-parser/src/test/java/org/apache/camel/parser/java/RoasterRouteBuilderEmptyUriTest.java
deleted file mode 100644
index 3d97c65..0000000
--- a/tooling/route-parser/src/test/java/org/apache/camel/parser/java/RoasterRouteBuilderEmptyUriTest.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/**
- * 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.parser.java;
-
-import java.io.File;
-import java.util.List;
-
-import org.apache.camel.parser.ParserResult;
-import org.apache.camel.parser.helper.CamelJavaParserHelper;
-import org.jboss.forge.roaster.Roaster;
-import org.jboss.forge.roaster.model.source.JavaClassSource;
-import org.jboss.forge.roaster.model.source.MethodSource;
-import org.junit.Assert;
-import org.junit.Test;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class RoasterRouteBuilderEmptyUriTest {
-
- private static final Logger LOG = LoggerFactory.getLogger(RoasterRouteBuilderEmptyUriTest.class);
-
- @Test
- public void parse() throws Exception {
- JavaClassSource clazz = (JavaClassSource) Roaster.parse(new File("src/test/java/org/apache/camel/parser/java/MyRouteEmptyUriTest.java"));
- MethodSource<JavaClassSource> method = CamelJavaParserHelper.findConfigureMethod(clazz);
-
- List<ParserResult> list = CamelJavaParserHelper.parseCamelConsumerUris(method, true, false);
- for (ParserResult result : list) {
- LOG.info("Consumer: " + result.getElement());
- }
- Assert.assertEquals("direct:foo", list.get(0).getElement());
-
- list = CamelJavaParserHelper.parseCamelProducerUris(method, true, false);
- Assert.assertEquals(1, list.size());
- for (ParserResult result : list) {
- LOG.info("Producer: " + result.getElement());
- Assert.assertFalse("Should be invalid", result.isParsed());
- }
- }
-
-}
http://git-wip-us.apache.org/repos/asf/camel/blob/88ba9063/tooling/route-parser/src/test/java/org/apache/camel/parser/java/RoasterSimpleProcessorTest.java
----------------------------------------------------------------------
diff --git a/tooling/route-parser/src/test/java/org/apache/camel/parser/java/RoasterSimpleProcessorTest.java b/tooling/route-parser/src/test/java/org/apache/camel/parser/java/RoasterSimpleProcessorTest.java
deleted file mode 100644
index c83d89a..0000000
--- a/tooling/route-parser/src/test/java/org/apache/camel/parser/java/RoasterSimpleProcessorTest.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/**
- * 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.parser.java;
-
-import java.io.File;
-import java.util.ArrayList;
-import java.util.List;
-
-import org.apache.camel.parser.ParserResult;
-import org.apache.camel.parser.RouteBuilderParser;
-import org.apache.camel.parser.helper.CamelJavaParserHelper;
-import org.apache.camel.parser.model.CamelEndpointDetails;
-import org.jboss.forge.roaster.Roaster;
-import org.jboss.forge.roaster.model.source.JavaClassSource;
-import org.jboss.forge.roaster.model.source.MethodSource;
-import org.junit.Assert;
-import org.junit.Test;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class RoasterSimpleProcessorTest {
-
- private static final Logger LOG = LoggerFactory.getLogger(RoasterSimpleProcessorTest.class);
-
- @Test
- public void parse() throws Exception {
- JavaClassSource clazz = (JavaClassSource) Roaster.parse(new File("src/test/java/org/apache/camel/parser/java/SimpleProcessorTest.java"));
- MethodSource<JavaClassSource> method = CamelJavaParserHelper.findConfigureMethod(clazz);
-
- List<CamelEndpointDetails> details = new ArrayList<CamelEndpointDetails>();
- RouteBuilderParser.parseRouteBuilderEndpoints(clazz, ".", "src/test/java/org/apache/camel/parser/java/SimpleProcessorTest.java", details);
- LOG.info("{}", details);
-
- List<ParserResult> list = CamelJavaParserHelper.parseCamelConsumerUris(method, true, true);
- for (ParserResult result : list) {
- LOG.info("Consumer: " + result.getElement());
- }
- Assert.assertEquals("direct:start", list.get(0).getElement());
-
- list = CamelJavaParserHelper.parseCamelProducerUris(method, true, true);
- for (ParserResult result : list) {
- LOG.info("Producer: " + result.getElement());
- }
- Assert.assertEquals(0, list.size());
-
- Assert.assertEquals(1, details.size());
- Assert.assertEquals("direct:start", details.get(0).getEndpointUri());
- }
-
-}
http://git-wip-us.apache.org/repos/asf/camel/blob/88ba9063/tooling/route-parser/src/test/java/org/apache/camel/parser/java/RoasterSimpleRouteBuilderConfigureTest.java
----------------------------------------------------------------------
diff --git a/tooling/route-parser/src/test/java/org/apache/camel/parser/java/RoasterSimpleRouteBuilderConfigureTest.java b/tooling/route-parser/src/test/java/org/apache/camel/parser/java/RoasterSimpleRouteBuilderConfigureTest.java
deleted file mode 100644
index 14d63af..0000000
--- a/tooling/route-parser/src/test/java/org/apache/camel/parser/java/RoasterSimpleRouteBuilderConfigureTest.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/**
- * 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.parser.java;
-
-import java.io.BufferedReader;
-import java.io.File;
-import java.io.FileReader;
-import java.util.List;
-
-import org.apache.camel.parser.ParserResult;
-import org.apache.camel.parser.helper.CamelJavaParserHelper;
-import org.jboss.forge.roaster.Roaster;
-import org.jboss.forge.roaster.model.source.JavaClassSource;
-import org.jboss.forge.roaster.model.source.MethodSource;
-import org.junit.Assert;
-import org.junit.Test;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class RoasterSimpleRouteBuilderConfigureTest {
-
- private static final Logger LOG = LoggerFactory.getLogger(RoasterSimpleRouteBuilderConfigureTest.class);
-
- @Test
- public void parse() throws Exception {
- JavaClassSource clazz = (JavaClassSource) Roaster.parse(new File("src/test/java/org/apache/camel/parser/java/MySimpleRouteBuilder.java"));
- MethodSource<JavaClassSource> method = clazz.getMethod("configure");
-
- List<ParserResult> list = CamelJavaParserHelper.parseCamelSimpleExpressions(method);
- for (ParserResult simple : list) {
- LOG.info("Simple: " + simple.getElement());
- LOG.info(" Line: " + findLineNumber(simple.getPosition()));
- }
- Assert.assertEquals("${body} > 100", list.get(0).getElement());
- Assert.assertEquals(27, findLineNumber(list.get(0).getPosition()));
- Assert.assertEquals("${body} > 200", list.get(1).getElement());
- Assert.assertEquals(30, findLineNumber(list.get(1).getPosition()));
- }
-
- public static int findLineNumber(int pos) throws Exception {
- int lines = 0;
- int current = 0;
- File file = new File("src/test/java/org/apache/camel/parser/java/MySimpleRouteBuilder.java");
- try (BufferedReader br = new BufferedReader(new FileReader(file))) {
- String line;
- while ((line = br.readLine()) != null) {
- lines++;
- current += line.length();
- if (current > pos) {
- return lines;
- }
- }
- }
- return -1;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/camel/blob/88ba9063/tooling/route-parser/src/test/java/org/apache/camel/parser/java/RoasterSimpleToDTest.java
----------------------------------------------------------------------
diff --git a/tooling/route-parser/src/test/java/org/apache/camel/parser/java/RoasterSimpleToDTest.java b/tooling/route-parser/src/test/java/org/apache/camel/parser/java/RoasterSimpleToDTest.java
deleted file mode 100644
index aeea6cf..0000000
--- a/tooling/route-parser/src/test/java/org/apache/camel/parser/java/RoasterSimpleToDTest.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/**
- * 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.parser.java;
-
-import java.io.File;
-import java.util.ArrayList;
-import java.util.List;
-
-import org.apache.camel.parser.ParserResult;
-import org.apache.camel.parser.RouteBuilderParser;
-import org.apache.camel.parser.helper.CamelJavaParserHelper;
-import org.apache.camel.parser.model.CamelEndpointDetails;
-import org.jboss.forge.roaster.Roaster;
-import org.jboss.forge.roaster.model.source.JavaClassSource;
-import org.jboss.forge.roaster.model.source.MethodSource;
-import org.junit.Assert;
-import org.junit.Test;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class RoasterSimpleToDTest {
-
- private static final Logger LOG = LoggerFactory.getLogger(RoasterSimpleToDTest.class);
-
- @Test
- public void parse() throws Exception {
- JavaClassSource clazz = (JavaClassSource) Roaster.parse(new File("src/test/java/org/apache/camel/parser/java/MySimpleToDRoute.java"));
- MethodSource<JavaClassSource> method = CamelJavaParserHelper.findConfigureMethod(clazz);
-
- List<CamelEndpointDetails> details = new ArrayList<>();
- RouteBuilderParser.parseRouteBuilderEndpoints(clazz, ".", "src/test/java/org/apache/camel/parser/java/MySimpleToDRoute.java", details);
- LOG.info("{}", details);
-
- List<ParserResult> list = CamelJavaParserHelper.parseCamelConsumerUris(method, true, true);
- for (ParserResult result : list) {
- LOG.info("Consumer: " + result.getElement());
- }
- Assert.assertEquals("direct:start", list.get(0).getElement());
-
- list = CamelJavaParserHelper.parseCamelProducerUris(method, true, true);
- for (ParserResult result : list) {
- LOG.info("Producer: " + result.getElement());
- }
- Assert.assertEquals("toD", list.get(0).getNode());
- Assert.assertEquals("log:a", list.get(0).getElement());
- Assert.assertEquals("to", list.get(1).getNode());
- Assert.assertEquals("log:b", list.get(1).getElement());
- Assert.assertEquals("to", list.get(2).getNode());
- Assert.assertEquals("log:c", list.get(2).getElement());
- Assert.assertEquals(3, list.size());
-
- Assert.assertEquals(4, details.size());
- Assert.assertEquals("direct:start", details.get(0).getEndpointUri());
- Assert.assertEquals("log:a", details.get(1).getEndpointUri());
- Assert.assertEquals("log:b", details.get(2).getEndpointUri());
- Assert.assertEquals("log:c", details.get(3).getEndpointUri());
- }
-
-}
http://git-wip-us.apache.org/repos/asf/camel/blob/88ba9063/tooling/route-parser/src/test/java/org/apache/camel/parser/java/RoasterSimpleToFTest.java
----------------------------------------------------------------------
diff --git a/tooling/route-parser/src/test/java/org/apache/camel/parser/java/RoasterSimpleToFTest.java b/tooling/route-parser/src/test/java/org/apache/camel/parser/java/RoasterSimpleToFTest.java
deleted file mode 100644
index 82d9f75..0000000
--- a/tooling/route-parser/src/test/java/org/apache/camel/parser/java/RoasterSimpleToFTest.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/**
- * 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.parser.java;
-
-import java.io.File;
-import java.util.ArrayList;
-import java.util.List;
-
-import org.apache.camel.parser.ParserResult;
-import org.apache.camel.parser.RouteBuilderParser;
-import org.apache.camel.parser.helper.CamelJavaParserHelper;
-import org.apache.camel.parser.model.CamelEndpointDetails;
-import org.jboss.forge.roaster.Roaster;
-import org.jboss.forge.roaster.model.source.JavaClassSource;
-import org.jboss.forge.roaster.model.source.MethodSource;
-import org.junit.Assert;
-import org.junit.Test;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class RoasterSimpleToFTest {
-
- private static final Logger LOG = LoggerFactory.getLogger(RoasterSimpleToFTest.class);
-
- @Test
- public void parse() throws Exception {
- JavaClassSource clazz = (JavaClassSource) Roaster.parse(new File("src/test/java/org/apache/camel/parser/java/MySimpleToFRoute.java"));
- MethodSource<JavaClassSource> method = CamelJavaParserHelper.findConfigureMethod(clazz);
-
- List<CamelEndpointDetails> details = new ArrayList<>();
- RouteBuilderParser.parseRouteBuilderEndpoints(clazz, ".", "src/test/java/org/apache/camel/parser/java/MySimpleToFRoute.java", details);
- LOG.info("{}", details);
-
- List<ParserResult> list = CamelJavaParserHelper.parseCamelConsumerUris(method, true, true);
- for (ParserResult result : list) {
- LOG.info("Consumer: " + result.getElement());
- }
- Assert.assertEquals("direct:start", list.get(0).getElement());
-
- list = CamelJavaParserHelper.parseCamelProducerUris(method, true, true);
- for (ParserResult result : list) {
- LOG.info("Producer: " + result.getElement());
- }
- Assert.assertEquals("toF", list.get(0).getNode());
- Assert.assertEquals("log:a?level={{%s}}", list.get(0).getElement());
- Assert.assertEquals(1, list.size());
-
- Assert.assertEquals(2, details.size());
- Assert.assertEquals("direct:start", details.get(0).getEndpointUri());
- Assert.assertEquals("log:a?level={{%s}}", details.get(1).getEndpointUri());
- }
-
-}
http://git-wip-us.apache.org/repos/asf/camel/blob/88ba9063/tooling/route-parser/src/test/java/org/apache/camel/parser/java/RoasterSplitTokenizeTest.java
----------------------------------------------------------------------
diff --git a/tooling/route-parser/src/test/java/org/apache/camel/parser/java/RoasterSplitTokenizeTest.java b/tooling/route-parser/src/test/java/org/apache/camel/parser/java/RoasterSplitTokenizeTest.java
deleted file mode 100644
index ef8bde8..0000000
--- a/tooling/route-parser/src/test/java/org/apache/camel/parser/java/RoasterSplitTokenizeTest.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/**
- * 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.parser.java;
-
-import java.io.File;
-import java.util.ArrayList;
-import java.util.List;
-
-import org.apache.camel.parser.ParserResult;
-import org.apache.camel.parser.RouteBuilderParser;
-import org.apache.camel.parser.helper.CamelJavaParserHelper;
-import org.apache.camel.parser.model.CamelEndpointDetails;
-import org.jboss.forge.roaster.Roaster;
-import org.jboss.forge.roaster.model.source.JavaClassSource;
-import org.jboss.forge.roaster.model.source.MethodSource;
-import org.junit.Assert;
-import org.junit.Test;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class RoasterSplitTokenizeTest {
-
- private static final Logger LOG = LoggerFactory.getLogger(RoasterSplitTokenizeTest.class);
-
- @Test
- public void parse() throws Exception {
- JavaClassSource clazz = (JavaClassSource) Roaster.parse(new File("src/test/java/org/apache/camel/parser/java/SplitTokenizeTest.java"));
- MethodSource<JavaClassSource> method = CamelJavaParserHelper.findConfigureMethod(clazz);
-
- List<CamelEndpointDetails> details = new ArrayList<>();
- RouteBuilderParser.parseRouteBuilderEndpoints(clazz, "src/test/java", "org/apache/camel/parser/SplitTokenizeTest.java", details);
- LOG.info("{}", details);
-
- List<ParserResult> list = CamelJavaParserHelper.parseCamelConsumerUris(method, true, true);
- for (ParserResult result : list) {
- LOG.info("Consumer: " + result.getElement());
- }
- Assert.assertEquals("direct:a", list.get(0).getElement());
- Assert.assertEquals("direct:b", list.get(1).getElement());
- Assert.assertEquals("direct:c", list.get(2).getElement());
- Assert.assertEquals("direct:d", list.get(3).getElement());
- Assert.assertEquals("direct:e", list.get(4).getElement());
- Assert.assertEquals("direct:f", list.get(5).getElement());
-
- list = CamelJavaParserHelper.parseCamelProducerUris(method, true, true);
- for (ParserResult result : list) {
- LOG.info("Producer: " + result.getElement());
- }
- Assert.assertEquals("mock:split", list.get(0).getElement());
- Assert.assertEquals("mock:split", list.get(1).getElement());
- Assert.assertEquals("mock:split", list.get(2).getElement());
- Assert.assertEquals("mock:split", list.get(3).getElement());
- Assert.assertEquals("mock:split", list.get(4).getElement());
- Assert.assertEquals("mock:split", list.get(5).getElement());
-
- Assert.assertEquals(12, details.size());
- Assert.assertEquals("direct:a", details.get(0).getEndpointUri());
- Assert.assertEquals("mock:split", details.get(11).getEndpointUri());
- }
-
-}
http://git-wip-us.apache.org/repos/asf/camel/blob/88ba9063/tooling/route-parser/src/test/java/org/apache/camel/parser/java/SimpleProcessorTest.java
----------------------------------------------------------------------
diff --git a/tooling/route-parser/src/test/java/org/apache/camel/parser/java/SimpleProcessorTest.java b/tooling/route-parser/src/test/java/org/apache/camel/parser/java/SimpleProcessorTest.java
deleted file mode 100644
index de37bf8..0000000
--- a/tooling/route-parser/src/test/java/org/apache/camel/parser/java/SimpleProcessorTest.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/**
- * 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.parser.java;
-
-import org.apache.camel.Exchange;
-import org.apache.camel.Processor;
-import org.apache.camel.builder.RouteBuilder;
-import org.apache.camel.test.junit4.CamelTestSupport;
-
-public class SimpleProcessorTest extends CamelTestSupport {
-
- public void testProcess() throws Exception {
- String out = template.requestBody("direct:start", "Hello World", String.class);
- assertEquals("Bye World", out);
- }
-
- @Override
- protected RouteBuilder createRouteBuilder() throws Exception {
- return new RouteBuilder() {
- @Override
- public void configure() throws Exception {
- from("direct:start").process(new Processor() {
- public void process(Exchange exchange) throws Exception {
- exchange.getOut().setBody("Bye World");
- }
- });
- }
- };
- }
-
-}
http://git-wip-us.apache.org/repos/asf/camel/blob/88ba9063/tooling/route-parser/src/test/java/org/apache/camel/parser/java/SplitTokenizeTest.java
----------------------------------------------------------------------
diff --git a/tooling/route-parser/src/test/java/org/apache/camel/parser/java/SplitTokenizeTest.java b/tooling/route-parser/src/test/java/org/apache/camel/parser/java/SplitTokenizeTest.java
deleted file mode 100644
index 4243dff..0000000
--- a/tooling/route-parser/src/test/java/org/apache/camel/parser/java/SplitTokenizeTest.java
+++ /dev/null
@@ -1,126 +0,0 @@
-/**
- * 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.parser.java;
-
-import org.apache.camel.builder.RouteBuilder;
-import org.apache.camel.component.mock.MockEndpoint;
-import org.apache.camel.test.junit4.CamelTestSupport;
-
-public class SplitTokenizeTest extends CamelTestSupport {
-
- public void testSplitTokenizerA() throws Exception {
- MockEndpoint mock = getMockEndpoint("mock:split");
- mock.expectedBodiesReceived("Claus", "James", "Willem");
-
- template.sendBody("direct:a", "Claus,James,Willem");
-
- assertMockEndpointsSatisfied();
- }
-
- public void testSplitTokenizerB() throws Exception {
- MockEndpoint mock = getMockEndpoint("mock:split");
- mock.expectedBodiesReceived("Claus", "James", "Willem");
-
- template.sendBodyAndHeader("direct:b", "Hello World", "myHeader", "Claus,James,Willem");
-
- assertMockEndpointsSatisfied();
- }
-
- public void testSplitTokenizerC() throws Exception {
- MockEndpoint mock = getMockEndpoint("mock:split");
- mock.expectedBodiesReceived("Claus", "James", "Willem");
-
- template.sendBody("direct:c", "Claus James Willem");
-
- assertMockEndpointsSatisfied();
- }
-
- public void testSplitTokenizerD() throws Exception {
- MockEndpoint mock = getMockEndpoint("mock:split");
- mock.expectedBodiesReceived("[Claus]", "[James]", "[Willem]");
-
- template.sendBody("direct:d", "[Claus][James][Willem]");
-
- assertMockEndpointsSatisfied();
- }
-
- public void testSplitTokenizerE() throws Exception {
- MockEndpoint mock = getMockEndpoint("mock:split");
- mock.expectedBodiesReceived("<person>Claus</person>", "<person>James</person>", "<person>Willem</person>");
-
- String xml = "<persons><person>Claus</person><person>James</person><person>Willem</person></persons>";
- template.sendBody("direct:e", xml);
-
- assertMockEndpointsSatisfied();
- }
-
- public void testSplitTokenizerEWithSlash() throws Exception {
- MockEndpoint mock = getMockEndpoint("mock:split");
- String xml = "<persons><person attr='/' /></persons>";
- mock.expectedBodiesReceived("<person attr='/' />");
- template.sendBody("direct:e", xml);
- mock.assertIsSatisfied();
- assertMockEndpointsSatisfied();
- }
-
- public void testSplitTokenizerF() throws Exception {
- MockEndpoint mock = getMockEndpoint("mock:split");
- mock.expectedBodiesReceived("<person name=\"Claus\"/>", "<person>James</person>", "<person>Willem</person>");
-
- String xml = "<persons><person/><person name=\"Claus\"/><person>James</person><person>Willem</person></persons>";
- template.sendBody("direct:f", xml);
-
- assertMockEndpointsSatisfied();
- }
-
- @Override
- protected RouteBuilder createRouteBuilder() throws Exception {
- return new RouteBuilder() {
- @Override
- public void configure() throws Exception {
-
- from("direct:a")
- .split().tokenize(",")
- .to("mock:split");
-
- from("direct:b")
- .split().tokenize(",", "myHeader")
- .to("mock:split");
-
- from("direct:c")
- .split().tokenize("(\\W+)\\s*", null, true)
- .to("mock:split");
-
- from("direct:d")
- .split().tokenizePair("[", "]", true)
- .to("mock:split");
-
- from("direct:e")
- .split().tokenizeXML("person")
- .to("mock:split");
-
- from("direct:f")
- .split().xpath("//person")
- // To test the body is not empty
- // it will call the ObjectHelper.evaluateValuePredicate()
- .filter().simple("${body}")
- .to("mock:split");
-
- }
- };
- }
-}
http://git-wip-us.apache.org/repos/asf/camel/blob/88ba9063/tooling/route-parser/src/test/java/org/apache/camel/parser/xml/FindElementInRoutesTest.java
----------------------------------------------------------------------
diff --git a/tooling/route-parser/src/test/java/org/apache/camel/parser/xml/FindElementInRoutesTest.java b/tooling/route-parser/src/test/java/org/apache/camel/parser/xml/FindElementInRoutesTest.java
deleted file mode 100644
index f15dd0e..0000000
--- a/tooling/route-parser/src/test/java/org/apache/camel/parser/xml/FindElementInRoutesTest.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/**
- * 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.parser.xml;
-
-import java.io.FileInputStream;
-import java.io.InputStream;
-
-import org.w3c.dom.Element;
-
-import org.apache.camel.parser.helper.CamelXmlHelper;
-import org.junit.Test;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import static org.junit.Assert.assertNotNull;
-
-public class FindElementInRoutesTest {
-
- private static final Logger LOG = LoggerFactory.getLogger(FindElementInRoutesTest.class);
-
- @Test
- public void testXml() throws Exception {
- InputStream is = new FileInputStream("src/test/resources/org/apache/camel/parser/xml/myroutes.xml");
- String key = "_camelContext1/cbr-route/_from1";
- Element element = CamelXmlHelper.getSelectedCamelElementNode(key, is);
- assertNotNull("Could not find Element for key " + key, element);
-
- LOG.info("Found element " + element.getTagName());
- }
-
-}
http://git-wip-us.apache.org/repos/asf/camel/blob/88ba9063/tooling/route-parser/src/test/java/org/apache/camel/parser/xml/XmlOnExceptionRouteTest.java
----------------------------------------------------------------------
diff --git a/tooling/route-parser/src/test/java/org/apache/camel/parser/xml/XmlOnExceptionRouteTest.java b/tooling/route-parser/src/test/java/org/apache/camel/parser/xml/XmlOnExceptionRouteTest.java
deleted file mode 100644
index 6f8aeb6..0000000
--- a/tooling/route-parser/src/test/java/org/apache/camel/parser/xml/XmlOnExceptionRouteTest.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/**
- * 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.parser.xml;
-
-import java.io.FileInputStream;
-import java.io.InputStream;
-import java.util.ArrayList;
-import java.util.List;
-
-import org.apache.camel.parser.XmlRouteParser;
-import org.apache.camel.parser.model.CamelEndpointDetails;
-import org.junit.Assert;
-import org.junit.Test;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class XmlOnExceptionRouteTest {
-
- private static final Logger LOG = LoggerFactory.getLogger(XmlOnExceptionRouteTest.class);
-
- @Test
- public void testXml() throws Exception {
- List<CamelEndpointDetails> endpoints = new ArrayList<>();
-
- InputStream is = new FileInputStream("src/test/resources/org/apache/camel/parser/xml/mycamel-onexception.xml");
- String fqn = "src/test/resources/org/apache/camel/parser/xml/mycamel-onexception.xml";
- String baseDir = "src/test/resources";
- XmlRouteParser.parseXmlRouteEndpoints(is, baseDir, fqn, endpoints);
-
- for (CamelEndpointDetails detail : endpoints) {
- LOG.info(detail.getEndpointUri());
- }
-
- Assert.assertEquals("log:all", endpoints.get(0).getEndpointUri());
- Assert.assertEquals("mock:dead", endpoints.get(1).getEndpointUri());
- Assert.assertEquals("log:done", endpoints.get(2).getEndpointUri());
- Assert.assertEquals("stream:in?promptMessage=Enter something:", endpoints.get(3).getEndpointUri());
- Assert.assertEquals("stream:out", endpoints.get(4).getEndpointUri());
- }
-
-}
http://git-wip-us.apache.org/repos/asf/camel/blob/88ba9063/tooling/route-parser/src/test/java/org/apache/camel/parser/xml/XmlRouteTest.java
----------------------------------------------------------------------
diff --git a/tooling/route-parser/src/test/java/org/apache/camel/parser/xml/XmlRouteTest.java b/tooling/route-parser/src/test/java/org/apache/camel/parser/xml/XmlRouteTest.java
deleted file mode 100644
index 05be852..0000000
--- a/tooling/route-parser/src/test/java/org/apache/camel/parser/xml/XmlRouteTest.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/**
- * 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.parser.xml;
-
-import java.io.FileInputStream;
-import java.io.InputStream;
-import java.util.ArrayList;
-import java.util.List;
-
-import org.apache.camel.parser.XmlRouteParser;
-import org.apache.camel.parser.model.CamelEndpointDetails;
-import org.junit.Assert;
-import org.junit.Test;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class XmlRouteTest {
-
- private static final Logger LOG = LoggerFactory.getLogger(XmlRouteTest.class);
-
- @Test
- public void testXml() throws Exception {
- List<CamelEndpointDetails> endpoints = new ArrayList<>();
-
- InputStream is = new FileInputStream("src/test/resources/org/apache/camel/parser/xml/mycamel.xml");
- String fqn = "src/test/resources/org/apache/camel/camel/parser/xml/mycamel.xml";
- String baseDir = "src/test/resources";
- XmlRouteParser.parseXmlRouteEndpoints(is, baseDir, fqn, endpoints);
-
- for (CamelEndpointDetails detail : endpoints) {
- LOG.info(detail.getEndpointUri());
- }
- Assert.assertEquals("stream:in?promptMessage=Enter something:", endpoints.get(0).getEndpointUri());
- Assert.assertEquals("stream:out", endpoints.get(1).getEndpointUri());
- }
-
-}
http://git-wip-us.apache.org/repos/asf/camel/blob/88ba9063/tooling/route-parser/src/test/resources/log4j2.properties
----------------------------------------------------------------------
diff --git a/tooling/route-parser/src/test/resources/log4j2.properties b/tooling/route-parser/src/test/resources/log4j2.properties
deleted file mode 100644
index 2f66eb5..0000000
--- a/tooling/route-parser/src/test/resources/log4j2.properties
+++ /dev/null
@@ -1,30 +0,0 @@
-## ---------------------------------------------------------------------------
-## 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.
-## ---------------------------------------------------------------------------
-
-appender.file.type = File
-appender.file.name = file
-appender.file.fileName = target/route-parser-test.log
-appender.file.layout.type = PatternLayout
-appender.file.layout.pattern = %d [%-15.15t] %-5p %-30.30c{1} - %m%n
-appender.out.type = Console
-appender.out.name = out
-appender.out.layout.type = PatternLayout
-appender.out.layout.pattern = %d [%-15.15t] %-5p %-30.30c{1} - %m%n
-logger.parser.name = org.apache.camel.parser
-logger.parser.level = DEBUG
-rootLogger.level = INFO
-rootLogger.appenderRef.file.ref = file
http://git-wip-us.apache.org/repos/asf/camel/blob/88ba9063/tooling/route-parser/src/test/resources/org/apache/camel/parser/xml/mycamel-onexception.xml
----------------------------------------------------------------------
diff --git a/tooling/route-parser/src/test/resources/org/apache/camel/parser/xml/mycamel-onexception.xml b/tooling/route-parser/src/test/resources/org/apache/camel/parser/xml/mycamel-onexception.xml
deleted file mode 100644
index 14a370f..0000000
--- a/tooling/route-parser/src/test/resources/org/apache/camel/parser/xml/mycamel-onexception.xml
+++ /dev/null
@@ -1,33 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<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">
-
- <camelContext xmlns="http://camel.apache.org/schema/spring">
-
- <endpoint id="logger" uri="log:all"/>
-
- <onException>
- <exception>java.lang.Exception</exception>
- <handled>
- <constant>true</constant>
- </handled>
- <to uri="mock:dead"/>
- </onException>
-
- <onCompletion>
- <to uri="log:done"/>
- </onCompletion>
-
- <route>
- <from uri="stream:in?promptMessage=Enter something: "/>
- <transform>
- <simple>Hello ${body.toUpperCase()}</simple>
- </transform>
- <to uri="stream:out"/>
- </route>
- </camelContext>
-
-</beans>
http://git-wip-us.apache.org/repos/asf/camel/blob/88ba9063/tooling/route-parser/src/test/resources/org/apache/camel/parser/xml/mycamel.xml
----------------------------------------------------------------------
diff --git a/tooling/route-parser/src/test/resources/org/apache/camel/parser/xml/mycamel.xml b/tooling/route-parser/src/test/resources/org/apache/camel/parser/xml/mycamel.xml
deleted file mode 100644
index f243369..0000000
--- a/tooling/route-parser/src/test/resources/org/apache/camel/parser/xml/mycamel.xml
+++ /dev/null
@@ -1,26 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<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">
-
- <!-- START SNIPPET: e1 -->
- <!-- camelContext is the Camel runtime, where we can host Camel routes -->
- <camelContext xmlns="http://camel.apache.org/schema/spring">
- <route>
- <!-- read input from the console using the stream component -->
- <from
- uri="stream:in?promptMessage=Enter something: "/>
- <!-- transform the input to upper case using the simple language -->
- <!-- you can also use other languages such as groovy, ognl, mvel, javascript etc. -->
- <transform>
- <simple>Hello ${body.toUpperCase()}</simple>
- </transform>
- <!-- and then print to the console -->
- <to uri="stream:out"/>
- </route>
- </camelContext>
- <!-- END SNIPPET: e1 -->
-
-</beans>
http://git-wip-us.apache.org/repos/asf/camel/blob/88ba9063/tooling/route-parser/src/test/resources/org/apache/camel/parser/xml/myroutes.xml
----------------------------------------------------------------------
diff --git a/tooling/route-parser/src/test/resources/org/apache/camel/parser/xml/myroutes.xml b/tooling/route-parser/src/test/resources/org/apache/camel/parser/xml/myroutes.xml
deleted file mode 100644
index c132e34..0000000
--- a/tooling/route-parser/src/test/resources/org/apache/camel/parser/xml/myroutes.xml
+++ /dev/null
@@ -1,19 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<routes xmlns="http://camel.apache.org/schema/spring">
- <route id="cbr-route">
- <from uri="timer:foo?period=5000"/>
- <!-- generate random number message, using a 3 digit number -->
- <transform>
- <method bean="myTransformer"/>
- </transform>
- <choice>
- <when>
- <simple>${body} > 500</simple>
- <log message="High priority message : ${body}"/>
- </when>
- <otherwise>
- <log message="Low priority message : ${body}"/>
- </otherwise>
- </choice>
- </route>
-</routes>