CAMEL-8309: Camel XML DSL - Allow to specify uri attributes in multi lines to make long urs easier to read and maintain
Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/775259dd Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/775259dd Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/775259dd Branch: refs/heads/master Commit: 775259dd5a0fbffa413f3d94a8b93011cd3d8cd2 Parents: 9681ac7 Author: Claus Ibsen <[email protected]> Authored: Tue Feb 3 08:59:28 2015 +0100 Committer: Claus Ibsen <[email protected]> Committed: Tue Feb 3 08:59:28 2015 +0100 ---------------------------------------------------------------------- ...ringAttributeNewLineRouteContextRefTest.java | 43 +++++++++++++++++++ ...pringAttributeNewLineRouteContextRefTest.xml | 44 ++++++++++++++++++++ 2 files changed, 87 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/camel/blob/775259dd/components/camel-spring/src/test/java/org/apache/camel/component/properties/SpringAttributeNewLineRouteContextRefTest.java ---------------------------------------------------------------------- diff --git a/components/camel-spring/src/test/java/org/apache/camel/component/properties/SpringAttributeNewLineRouteContextRefTest.java b/components/camel-spring/src/test/java/org/apache/camel/component/properties/SpringAttributeNewLineRouteContextRefTest.java new file mode 100644 index 0000000..d88099d --- /dev/null +++ b/components/camel-spring/src/test/java/org/apache/camel/component/properties/SpringAttributeNewLineRouteContextRefTest.java @@ -0,0 +1,43 @@ +/** + * 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.component.properties; + +import org.apache.camel.spring.SpringTestSupport; +import org.junit.Test; +import org.springframework.context.support.AbstractXmlApplicationContext; +import org.springframework.context.support.ClassPathXmlApplicationContext; + +/** + * @version + */ +public class SpringAttributeNewLineRouteContextRefTest extends SpringTestSupport { + + @Override + protected AbstractXmlApplicationContext createApplicationContext() { + return new ClassPathXmlApplicationContext("org/apache/camel/component/properties/SpringAttributeNewLineRouteContextRefTest.xml"); + } + + @Test + public void testSpringAttributeNewLineTest() throws Exception { + getMockEndpoint("mock:bar").expectedMessageCount(1); + + template.sendBody("direct:start", "Hello World"); + + assertMockEndpointsSatisfied(); + } + +} http://git-wip-us.apache.org/repos/asf/camel/blob/775259dd/components/camel-spring/src/test/resources/org/apache/camel/component/properties/SpringAttributeNewLineRouteContextRefTest.xml ---------------------------------------------------------------------- diff --git a/components/camel-spring/src/test/resources/org/apache/camel/component/properties/SpringAttributeNewLineRouteContextRefTest.xml b/components/camel-spring/src/test/resources/org/apache/camel/component/properties/SpringAttributeNewLineRouteContextRefTest.xml new file mode 100644 index 0000000..f410971 --- /dev/null +++ b/components/camel-spring/src/test/resources/org/apache/camel/component/properties/SpringAttributeNewLineRouteContextRefTest.xml @@ -0,0 +1,44 @@ +<?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 + "> + + <routeContext id="myCoolRoutes" xmlns="http://camel.apache.org/schema/spring"> + <route> + <from uri="direct:start"/> + <to uri="seda:bar?timeout=10000 + &blockWhenFull=true"/> + </route> + + <route> + <from uri="seda:bar? + timeout=10000& + blockWhenFull=true"/> + <to uri="mock:bar"/> + </route> + </routeContext> + + <camelContext xmlns="http://camel.apache.org/schema/spring"> + <routeContextRef ref="myCoolRoutes"/> + </camelContext> + +</beans>
