Repository: camel Updated Branches: refs/heads/master 0273cd737 -> dc24362ce
CAMEL-8052 Added some unit tests for Spring DSL Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/affeb0e3 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/affeb0e3 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/affeb0e3 Branch: refs/heads/master Commit: affeb0e3c4443665e9731998536362ddd9b0278c Parents: 0273cd7 Author: Willem Jiang <willem.ji...@gmail.com> Authored: Mon Nov 17 15:38:11 2014 +0800 Committer: Willem Jiang <willem.ji...@gmail.com> Committed: Mon Nov 17 15:38:11 2014 +0800 ---------------------------------------------------------------------- ...SpringRemovePropertiesWithExclusionTest.java | 28 +++++++++++++ ...ingRemovePropertiesWithoutExclusionTest.java | 28 +++++++++++++ .../processor/removePropertiesWithExclusion.xml | 43 ++++++++++++++++++++ .../removePropertiesWithoutExclusion.xml | 40 ++++++++++++++++++ 4 files changed, 139 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/camel/blob/affeb0e3/components/camel-spring/src/test/java/org/apache/camel/spring/processor/SpringRemovePropertiesWithExclusionTest.java ---------------------------------------------------------------------- diff --git a/components/camel-spring/src/test/java/org/apache/camel/spring/processor/SpringRemovePropertiesWithExclusionTest.java b/components/camel-spring/src/test/java/org/apache/camel/spring/processor/SpringRemovePropertiesWithExclusionTest.java new file mode 100644 index 0000000..f28d6f2 --- /dev/null +++ b/components/camel-spring/src/test/java/org/apache/camel/spring/processor/SpringRemovePropertiesWithExclusionTest.java @@ -0,0 +1,28 @@ +/** + * 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.processor; + +import org.apache.camel.CamelContext; +import org.apache.camel.processor.RemovePropertiesWithExclusionTest; +import static org.apache.camel.spring.processor.SpringTestHelper.createSpringCamelContext; + +public class SpringRemovePropertiesWithExclusionTest extends RemovePropertiesWithExclusionTest { + protected CamelContext createCamelContext() throws Exception { + return createSpringCamelContext(this, + "org/apache/camel/spring/processor/removePropertiesWithExclusion.xml"); + } +} http://git-wip-us.apache.org/repos/asf/camel/blob/affeb0e3/components/camel-spring/src/test/java/org/apache/camel/spring/processor/SpringRemovePropertiesWithoutExclusionTest.java ---------------------------------------------------------------------- diff --git a/components/camel-spring/src/test/java/org/apache/camel/spring/processor/SpringRemovePropertiesWithoutExclusionTest.java b/components/camel-spring/src/test/java/org/apache/camel/spring/processor/SpringRemovePropertiesWithoutExclusionTest.java new file mode 100644 index 0000000..e4523f7 --- /dev/null +++ b/components/camel-spring/src/test/java/org/apache/camel/spring/processor/SpringRemovePropertiesWithoutExclusionTest.java @@ -0,0 +1,28 @@ +/** + * 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.processor; + +import org.apache.camel.CamelContext; +import org.apache.camel.processor.RemovePropertiesWithoutExclusionTest; +import static org.apache.camel.spring.processor.SpringTestHelper.createSpringCamelContext; + +public class SpringRemovePropertiesWithoutExclusionTest extends RemovePropertiesWithoutExclusionTest { + protected CamelContext createCamelContext() throws Exception { + return createSpringCamelContext(this, + "org/apache/camel/spring/processor/removePropertiesWithoutExclusion.xml"); + } +} http://git-wip-us.apache.org/repos/asf/camel/blob/affeb0e3/components/camel-spring/src/test/resources/org/apache/camel/spring/processor/removePropertiesWithExclusion.xml ---------------------------------------------------------------------- diff --git a/components/camel-spring/src/test/resources/org/apache/camel/spring/processor/removePropertiesWithExclusion.xml b/components/camel-spring/src/test/resources/org/apache/camel/spring/processor/removePropertiesWithExclusion.xml new file mode 100644 index 0000000..4eb3b54 --- /dev/null +++ b/components/camel-spring/src/test/resources/org/apache/camel/spring/processor/removePropertiesWithExclusion.xml @@ -0,0 +1,43 @@ +<?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 + "> + <!-- START SNIPPET: example --> + <camelContext xmlns="http://camel.apache.org/schema/spring"> + <route> + <from uri="direct:start"/> + <setProperty propertyName="foo"> + <constant>bar</constant> + </setProperty> + <setProperty propertyName="fee"> + <constant>bar1</constant> + </setProperty> + <setProperty propertyName="fiu"> + <constant>bar2</constant> + </setProperty> + <to uri="mock:mid"/> + <removeProperties pattern="f*" excludePattern="fiu"/> + <to uri="mock:end"/> + </route> + </camelContext> + <!-- END SNIPPET: example --> +</beans> http://git-wip-us.apache.org/repos/asf/camel/blob/affeb0e3/components/camel-spring/src/test/resources/org/apache/camel/spring/processor/removePropertiesWithoutExclusion.xml ---------------------------------------------------------------------- diff --git a/components/camel-spring/src/test/resources/org/apache/camel/spring/processor/removePropertiesWithoutExclusion.xml b/components/camel-spring/src/test/resources/org/apache/camel/spring/processor/removePropertiesWithoutExclusion.xml new file mode 100644 index 0000000..d80c4e8 --- /dev/null +++ b/components/camel-spring/src/test/resources/org/apache/camel/spring/processor/removePropertiesWithoutExclusion.xml @@ -0,0 +1,40 @@ +<?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 + "> + <!-- START SNIPPET: example --> + <camelContext xmlns="http://camel.apache.org/schema/spring"> + <route> + <from uri="direct:start"/> + <setProperty propertyName="foo"> + <constant>bar</constant> + </setProperty> + <setProperty propertyName="fee"> + <constant>bar1</constant> + </setProperty> + <to uri="mock:mid"/> + <removeProperties pattern="f*"/> + <to uri="mock:end"/> + </route> + </camelContext> + <!-- END SNIPPET: example --> +</beans>