You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by cm...@apache.org on 2013/07/05 18:43:22 UTC
git commit: CAMEL-6250: Setting id on endpoint in may not work
- added unit test which shows the issue
Updated Branches:
refs/heads/master 900b9bd9c -> a2f4f6c1d
CAMEL-6250: Setting id on endpoint in <from> may not work - added unit test which shows the issue
Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/a2f4f6c1
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/a2f4f6c1
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/a2f4f6c1
Branch: refs/heads/master
Commit: a2f4f6c1d3312a47027b285cba89ecba820c3967
Parents: 900b9bd
Author: cmueller <cm...@apache.org>
Authored: Fri Jul 5 18:40:29 2013 +0200
Committer: cmueller <cm...@apache.org>
Committed: Fri Jul 5 18:43:18 2013 +0200
----------------------------------------------------------------------
.../spring/issues/EndpointIdIssueTest.java | 45 ++++++++++++++++++++
.../camel/spring/issues/EndpointIdIssueTest.xml | 33 ++++++++++++++
2 files changed, 78 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/camel/blob/a2f4f6c1/components/camel-spring/src/test/java/org/apache/camel/spring/issues/EndpointIdIssueTest.java
----------------------------------------------------------------------
diff --git a/components/camel-spring/src/test/java/org/apache/camel/spring/issues/EndpointIdIssueTest.java b/components/camel-spring/src/test/java/org/apache/camel/spring/issues/EndpointIdIssueTest.java
new file mode 100644
index 0000000..6f7f54c
--- /dev/null
+++ b/components/camel-spring/src/test/java/org/apache/camel/spring/issues/EndpointIdIssueTest.java
@@ -0,0 +1,45 @@
+/**
+ * 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.issues;
+
+import org.apache.camel.Exchange;
+import org.apache.camel.Processor;
+import org.apache.camel.impl.DefaultEndpoint;
+import org.apache.camel.spring.SpringTestSupport;
+import org.junit.Ignore;
+import org.springframework.context.support.AbstractXmlApplicationContext;
+import org.springframework.context.support.ClassPathXmlApplicationContext;
+
+@Ignore
+public class EndpointIdIssueTest extends SpringTestSupport {
+
+ @Override
+ protected AbstractXmlApplicationContext createApplicationContext() {
+ return new ClassPathXmlApplicationContext("org/apache/camel/spring/issues/EndpointIdIssueTest.xml");
+ }
+
+ public void testSpring() throws Exception {
+ Exchange response = template.request("direct:start", new Processor() {
+ public void process(Exchange exchange) throws Exception {
+ DefaultEndpoint fromEndpoint = (DefaultEndpoint) exchange.getFromEndpoint();
+ assertEquals("myCamelFromEndpint", fromEndpoint.getId());
+ }
+ });
+
+ assertNotNull(response);
+ }
+}
http://git-wip-us.apache.org/repos/asf/camel/blob/a2f4f6c1/components/camel-spring/src/test/resources/org/apache/camel/spring/issues/EndpointIdIssueTest.xml
----------------------------------------------------------------------
diff --git a/components/camel-spring/src/test/resources/org/apache/camel/spring/issues/EndpointIdIssueTest.xml b/components/camel-spring/src/test/resources/org/apache/camel/spring/issues/EndpointIdIssueTest.xml
new file mode 100644
index 0000000..05f0890
--- /dev/null
+++ b/components/camel-spring/src/test/resources/org/apache/camel/spring/issues/EndpointIdIssueTest.xml
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ 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.
+-->
+<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 id="myCamelContext" xmlns="http://camel.apache.org/schema/spring">
+ <route id="myCamelRoute">
+ <from id="myCamelFromEndpint" uri="direct:start"/>
+ <transform>
+ <constant>Camel rocks!</constant>
+ </transform>
+ </route>
+ </camelContext>
+</beans>