Return-Path: Delivered-To: apmail-activemq-commits-archive@www.apache.org Received: (qmail 22817 invoked from network); 3 May 2007 17:36:09 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 3 May 2007 17:36:09 -0000 Received: (qmail 42813 invoked by uid 500); 3 May 2007 17:36:15 -0000 Delivered-To: apmail-activemq-commits-archive@activemq.apache.org Received: (qmail 42798 invoked by uid 500); 3 May 2007 17:36:15 -0000 Mailing-List: contact commits-help@activemq.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@activemq.apache.org Delivered-To: mailing list commits@activemq.apache.org Received: (qmail 42789 invoked by uid 99); 3 May 2007 17:36:15 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 03 May 2007 10:36:15 -0700 X-ASF-Spam-Status: No, hits=-99.5 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO eris.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 03 May 2007 10:36:06 -0700 Received: by eris.apache.org (Postfix, from userid 65534) id 290521A9838; Thu, 3 May 2007 10:35:46 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r534941 - in /activemq/camel/trunk: camel-core/src/main/java/org/apache/camel/builder/ camel-core/src/main/java/org/apache/camel/builder/xml/ camel-core/src/main/java/org/apache/camel/impl/ camel-core/src/main/java/org/apache/camel/processo... Date: Thu, 03 May 2007 17:35:45 -0000 To: commits@activemq.apache.org From: jstrachan@apache.org X-Mailer: svnmailer-1.1.0 Message-Id: <20070503173546.290521A9838@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: jstrachan Date: Thu May 3 10:35:43 2007 New Revision: 534941 URL: http://svn.apache.org/viewvc?view=rev&rev=534941 Log: added a test case showing the use of xpath filter using spring XML; also tidied up the spring XML test cases to make it easier to deal with issues that arise in the spring 2.0 parsing code Added: activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/NoRouteBuilder.java (with props) activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/builder/xml/XPathWithNamespacesFromDomTest.java (with props) activemq/camel/trunk/camel-spring/src/test/java/org/apache/camel/spring/example/SpringXPathFilterTest.java (with props) activemq/camel/trunk/camel-spring/src/test/java/org/apache/camel/spring/xml/SpringXmlRouteBuilderTest.java (with props) activemq/camel/trunk/camel-spring/src/test/resources/org/apache/camel/spring/example/ activemq/camel/trunk/camel-spring/src/test/resources/org/apache/camel/spring/example/xpathFilter.xml (with props) activemq/camel/trunk/camel-spring/src/test/resources/org/apache/camel/spring/xml/ activemq/camel/trunk/camel-spring/src/test/resources/org/apache/camel/spring/xml/buildCustomProcessor.xml (with props) activemq/camel/trunk/camel-spring/src/test/resources/org/apache/camel/spring/xml/buildCustomProcessorWithFilter.xml (with props) activemq/camel/trunk/camel-spring/src/test/resources/org/apache/camel/spring/xml/buildDynamicRecipientList.xml (with props) activemq/camel/trunk/camel-spring/src/test/resources/org/apache/camel/spring/xml/buildIdempotentConsumer.xml (with props) activemq/camel/trunk/camel-spring/src/test/resources/org/apache/camel/spring/xml/buildRouteWithInterceptor.xml (with props) activemq/camel/trunk/camel-spring/src/test/resources/org/apache/camel/spring/xml/buildSimpleRoute.xml (with props) activemq/camel/trunk/camel-spring/src/test/resources/org/apache/camel/spring/xml/buildSimpleRouteWithChoice.xml (with props) activemq/camel/trunk/camel-spring/src/test/resources/org/apache/camel/spring/xml/buildSimpleRouteWithHeaderPredicate.xml (with props) activemq/camel/trunk/camel-spring/src/test/resources/org/apache/camel/spring/xml/buildSplitter.xml (with props) activemq/camel/trunk/camel-spring/src/test/resources/org/apache/camel/spring/xml/buildStaticRecipientList.xml (with props) activemq/camel/trunk/camel-spring/src/test/resources/org/apache/camel/spring/xml/buildWireTap.xml (with props) Removed: activemq/camel/trunk/camel-spring/src/test/java/org/apache/camel/spring/xml/XmlRouteBuilderTest.java Modified: activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/builder/FromBuilder.java activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/builder/xml/DefaultNamespaceContext.java activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/builder/xml/XPathBuilder.java activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/processor/FilterProcessor.java activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/ContextTestSupport.java activemq/camel/trunk/camel-spring/src/main/java/org/apache/camel/spring/CamelContextFactoryBean.java activemq/camel/trunk/camel-spring/src/main/java/org/apache/camel/spring/SpringCamelContext.java activemq/camel/trunk/camel-spring/src/main/java/org/apache/camel/spring/xml/BeanDefinitionParserSupport.java activemq/camel/trunk/camel-spring/src/main/java/org/apache/camel/spring/xml/BuilderAction.java activemq/camel/trunk/camel-spring/src/main/java/org/apache/camel/spring/xml/CamelBeanDefinitionParser.java activemq/camel/trunk/camel-spring/src/main/java/org/apache/camel/spring/xml/CamelNamespaceHandler.java activemq/camel/trunk/camel-spring/src/main/resources/org/apache/camel/spring/camel-1.0.xsd activemq/camel/trunk/camel-spring/src/test/resources/org/apache/camel/spring/builder/spring_route_builder_test.xml Modified: activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/builder/FromBuilder.java URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/builder/FromBuilder.java?view=diff&rev=534941&r1=534940&r2=534941 ============================================================================== --- activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/builder/FromBuilder.java (original) +++ activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/builder/FromBuilder.java Thu May 3 10:35:43 2007 @@ -16,10 +16,6 @@ */ package org.apache.camel.builder; -import java.util.ArrayList; -import java.util.Collection; -import java.util.List; - import org.apache.camel.Endpoint; import org.apache.camel.Exchange; import org.apache.camel.Expression; @@ -36,13 +32,15 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; +import java.util.ArrayList; +import java.util.Collection; +import java.util.List; + /** * @version $Revision$ */ public class FromBuilder extends BuilderSupport implements ProcessorFactory { - - public static final String DEFAULT_TRACE_CATEGORY = "org.apache.camel.TRACE"; - + public static final String DEFAULT_TRACE_CATEGORY = "org.apache.camel.TRACE"; private RouteBuilder builder; private Endpoint from; private List processors = new ArrayList(); @@ -82,9 +80,7 @@ * Sends the exchange to a list of endpoints using the {@link MulticastProcessor} pattern */ @Fluent - public ProcessorFactory to( - @FluentArg(value = "uri", attribute = false, element = true) - String... uris) { + public ProcessorFactory to(String... uris) { return to(endpoints(uris)); } @@ -102,7 +98,8 @@ * Sends the exchange to a list of endpoint using the {@link MulticastProcessor} pattern */ @Fluent - public ProcessorFactory to(@FluentArg("endpoints")Collection endpoints) { + public ProcessorFactory to(@FluentArg(value = "endpoint", attribute = false, element = true) + Collection endpoints) { return addProcessBuilder(new MulticastBuilder(this, endpoints)); } @@ -206,7 +203,7 @@ * @return the builder */ @Fluent - public SplitterBuilder splitter(@FluentArg(value = "recipients", element = true) Expression receipients) { + public SplitterBuilder splitter(@FluentArg(value = "recipients", element = true)Expression receipients) { SplitterBuilder answer = new SplitterBuilder(this, receipients); addProcessBuilder(answer); return answer; @@ -242,36 +239,36 @@ addProcessBuilder(answer); return answer; } - + /** * Trace logs the exchange before it goes to the next processing step using the {@link #DEFAULT_TRACE_CATEGORY} logging * category. - * + * * @return */ @Fluent - public FromBuilder trace() { - return trace(DEFAULT_TRACE_CATEGORY); - } - + public FromBuilder trace() { + return trace(DEFAULT_TRACE_CATEGORY); + } + /** * Trace logs the exchange before it goes to the next processing step using the specified logging * category. - * + * * @param category the logging category trace messages will sent to. * @return */ @Fluent - public FromBuilder trace(@FluentArg("category")String category) { - final Log log = LogFactory.getLog(category); - return intercept(new DelegateProcessor(){ - @Override - public void process(Exchange exchange) throws Exception { - log.trace(exchange); - processNext(exchange); - } - }); - } + public FromBuilder trace(@FluentArg("category")String category) { + final Log log = LogFactory.getLog(category); + return intercept(new DelegateProcessor() { + @Override + public void process(Exchange exchange) throws Exception { + log.trace(exchange); + processNext(exchange); + } + }); + } @Fluent public FromBuilder intercept(@FluentArg("interceptor")DelegateProcessor interceptor) { @@ -283,7 +280,7 @@ @Fluent(nestedActions = true) public PolicyBuilder policies() { - PolicyBuilder answer = new PolicyBuilder(this); + PolicyBuilder answer = new PolicyBuilder(this); addProcessBuilder(answer); return answer; } @@ -344,7 +341,6 @@ return this; } - /** * Adds a processor which sets the exchange property */ @@ -354,7 +350,6 @@ return this; } - /** * Converts the IN message body to the specified type */ @@ -451,5 +446,4 @@ public List getProcessors() { return processors; } - } Modified: activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/builder/xml/DefaultNamespaceContext.java URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/builder/xml/DefaultNamespaceContext.java?view=diff&rev=534941&r1=534940&r2=534941 ============================================================================== --- activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/builder/xml/DefaultNamespaceContext.java (original) +++ activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/builder/xml/DefaultNamespaceContext.java Thu May 3 10:35:43 2007 @@ -17,6 +17,11 @@ */ package org.apache.camel.builder.xml; +import org.w3c.dom.Element; +import org.w3c.dom.NamedNodeMap; +import org.w3c.dom.Node; +import org.w3c.dom.Attr; + import javax.xml.namespace.NamespaceContext; import javax.xml.xpath.XPathFactory; import java.util.HashMap; @@ -94,5 +99,23 @@ } } return set.iterator(); + } + + public void setNamespacesFromDom(Element element) { + // lets set the parent first in case we overload a prefix here + Node parentNode = element.getParentNode(); + if (parentNode instanceof Element) { + setNamespacesFromDom((Element) parentNode); + } + NamedNodeMap attributes = element.getAttributes(); + for (int i = 0, size = attributes.getLength(); i < size; i++) { + Attr node = (Attr) attributes.item(i); + String name = node.getName(); + if (name.startsWith("xmlns:")) { + String prefix = name.substring("xmlns:".length()); + String uri = node.getValue(); + add(prefix, uri); + } + } } } Modified: activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/builder/xml/XPathBuilder.java URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/builder/xml/XPathBuilder.java?view=diff&rev=534941&r1=534940&r2=534941 ============================================================================== --- activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/builder/xml/XPathBuilder.java (original) +++ activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/builder/xml/XPathBuilder.java Thu May 3 10:35:43 2007 @@ -24,6 +24,7 @@ import org.apache.camel.RuntimeExpressionException; import org.apache.camel.Message; import org.w3c.dom.Document; +import org.w3c.dom.Element; import org.xml.sax.InputSource; import javax.xml.namespace.QName; @@ -237,6 +238,10 @@ expression = createXPathExpression(); } return expression; + } + + public void setNamespacesFromDom(Element node) { + getNamespaceContext().setNamespacesFromDom(node); } // Implementation methods Added: activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/NoRouteBuilder.java URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/NoRouteBuilder.java?view=auto&rev=534941 ============================================================================== --- activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/NoRouteBuilder.java (added) +++ activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/NoRouteBuilder.java Thu May 3 10:35:43 2007 @@ -0,0 +1,36 @@ +/** + * + * 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.impl; + +import org.apache.camel.builder.RouteBuilder; + +/** + * A helper class, usually used for testing which does not create any routes. + * + * @version $Revision: 1.1 $ + */ +public class NoRouteBuilder extends RouteBuilder { + private static final NoRouteBuilder instance = new NoRouteBuilder(); + + public static NoRouteBuilder getInstance() { + return instance; + } + + public void configure() throws Exception { + } +} Propchange: activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/NoRouteBuilder.java ------------------------------------------------------------------------------ svn:eol-style = native Modified: activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/processor/FilterProcessor.java URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/processor/FilterProcessor.java?view=diff&rev=534941&r1=534940&r2=534941 ============================================================================== --- activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/processor/FilterProcessor.java (original) +++ activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/processor/FilterProcessor.java Thu May 3 10:35:43 2007 @@ -43,7 +43,7 @@ @Override public String toString() { - return "if (" + predicate + ") " + processor; + return "filter (" + predicate + ") " + processor; } public Predicate getPredicate() { Modified: activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/ContextTestSupport.java URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/ContextTestSupport.java?view=diff&rev=534941&r1=534940&r2=534941 ============================================================================== --- activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/ContextTestSupport.java (original) +++ activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/ContextTestSupport.java Thu May 3 10:35:43 2007 @@ -18,6 +18,7 @@ package org.apache.camel; import org.apache.camel.impl.DefaultCamelContext; +import org.apache.camel.impl.DefaultExchange; import org.apache.camel.CamelClient; import org.apache.camel.builder.RouteBuilder; @@ -39,6 +40,8 @@ context.addRoutes(createRouteBuilder()); context.start(); + + log.debug("Routing Rules are: " + context.getRoutes()); } @Override @@ -77,5 +80,17 @@ in.setHeader("testCase", getName()); } }); + } + + /** + * Creates an exchange with the given body + */ + protected Exchange createExchangeWithBody(Object body) { + Exchange exchange = new DefaultExchange(context); + Message message = exchange.getIn(); + message.setHeader("testName", getName()); + message.setHeader("testClass", getClass().getName()); + message.setBody(body); + return exchange; } } Added: activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/builder/xml/XPathWithNamespacesFromDomTest.java URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/builder/xml/XPathWithNamespacesFromDomTest.java?view=auto&rev=534941 ============================================================================== --- activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/builder/xml/XPathWithNamespacesFromDomTest.java (added) +++ activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/builder/xml/XPathWithNamespacesFromDomTest.java Thu May 3 10:35:43 2007 @@ -0,0 +1,52 @@ +/** + * + * 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.xml; + +import org.apache.camel.TestSupport; +import org.apache.camel.Expression; +import org.apache.camel.Predicate; +import org.apache.camel.Exchange; +import org.apache.camel.CamelContext; +import org.apache.camel.Message; +import org.apache.camel.ContextTestSupport; +import org.apache.camel.impl.DefaultCamelContext; +import org.apache.camel.impl.DefaultExchange; +import org.w3c.dom.Document; +import org.w3c.dom.Element; + +import javax.xml.xpath.XPathFunctionResolver; + +/** + * @version $Revision: 534495 $ + */ +public class XPathWithNamespacesFromDomTest extends ContextTestSupport { + + public void testXPathUsingDomForNamespaces() throws Exception { + Document document = context.getTypeConverter().convertTo(Document.class, ""); + Element element = (Element) document.getElementsByTagName("bar").item(0); + assertNotNull("Could not find element for id 'a'", element); + + XPathBuilder builder = XPathBuilder.xpath("//y:foo[@id='z']"); + builder.setNamespacesFromDom(element); + DefaultNamespaceContext namespaceContext = builder.getNamespaceContext(); + assertEquals("y namespace", "n3", namespaceContext.getNamespaceURI("y")); + + assertPredicateMatches(builder, createExchangeWithBody("")); + assertPredicateDoesNotMatch(builder, createExchangeWithBody("")); + } +} Propchange: activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/builder/xml/XPathWithNamespacesFromDomTest.java ------------------------------------------------------------------------------ svn:eol-style = native Modified: activemq/camel/trunk/camel-spring/src/main/java/org/apache/camel/spring/CamelContextFactoryBean.java URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-spring/src/main/java/org/apache/camel/spring/CamelContextFactoryBean.java?view=diff&rev=534941&r1=534940&r2=534941 ============================================================================== --- activemq/camel/trunk/camel-spring/src/main/java/org/apache/camel/spring/CamelContextFactoryBean.java (original) +++ activemq/camel/trunk/camel-spring/src/main/java/org/apache/camel/spring/CamelContextFactoryBean.java Thu May 3 10:35:43 2007 @@ -74,7 +74,7 @@ //------------------------------------------------------------------------- public CamelContext getContext() throws Exception { if (context == null) { - context = SpringCamelContext.springCamelContext(getApplicationContext()); + context = new SpringCamelContext(getApplicationContext()); } return context; } Modified: activemq/camel/trunk/camel-spring/src/main/java/org/apache/camel/spring/SpringCamelContext.java URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-spring/src/main/java/org/apache/camel/spring/SpringCamelContext.java?view=diff&rev=534941&r1=534940&r2=534941 ============================================================================== --- activemq/camel/trunk/camel-spring/src/main/java/org/apache/camel/spring/SpringCamelContext.java (original) +++ activemq/camel/trunk/camel-spring/src/main/java/org/apache/camel/spring/SpringCamelContext.java Thu May 3 10:35:43 2007 @@ -42,7 +42,19 @@ public class SpringCamelContext extends DefaultCamelContext implements InitializingBean, DisposableBean, ApplicationContextAware { private ApplicationContext applicationContext; + public SpringCamelContext() { + } + + public SpringCamelContext(ApplicationContext applicationContext) { + this.applicationContext = applicationContext; + } + public static SpringCamelContext springCamelContext(ApplicationContext applicationContext) throws Exception { + // lets try and look up a configured camel context in the context + String[] names = applicationContext.getBeanNamesForType(SpringCamelContext.class); + if (names.length == 1) { + return (SpringCamelContext) applicationContext.getBean(names[0], SpringCamelContext.class); + } SpringCamelContext answer = new SpringCamelContext(); answer.setApplicationContext(applicationContext); return answer; Modified: activemq/camel/trunk/camel-spring/src/main/java/org/apache/camel/spring/xml/BeanDefinitionParserSupport.java URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-spring/src/main/java/org/apache/camel/spring/xml/BeanDefinitionParserSupport.java?view=diff&rev=534941&r1=534940&r2=534941 ============================================================================== --- activemq/camel/trunk/camel-spring/src/main/java/org/apache/camel/spring/xml/BeanDefinitionParserSupport.java (original) +++ activemq/camel/trunk/camel-spring/src/main/java/org/apache/camel/spring/xml/BeanDefinitionParserSupport.java Thu May 3 10:35:43 2007 @@ -38,7 +38,7 @@ @Override protected boolean isEligibleAttribute(String attributeName) { - return super.isEligibleAttribute(attributeName) && !attributeName.equals("xmlns"); + return attributeName != null && super.isEligibleAttribute(attributeName) && !attributeName.equals("xmlns"); } Modified: activemq/camel/trunk/camel-spring/src/main/java/org/apache/camel/spring/xml/BuilderAction.java URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-spring/src/main/java/org/apache/camel/spring/xml/BuilderAction.java?view=diff&rev=534941&r1=534940&r2=534941 ============================================================================== --- activemq/camel/trunk/camel-spring/src/main/java/org/apache/camel/spring/xml/BuilderAction.java (original) +++ activemq/camel/trunk/camel-spring/src/main/java/org/apache/camel/spring/xml/BuilderAction.java Thu May 3 10:35:43 2007 @@ -17,62 +17,76 @@ */ package org.apache.camel.spring.xml; -import java.lang.reflect.InvocationTargetException; -import java.util.HashMap; -import java.util.Map; - import org.springframework.beans.SimpleTypeConverter; import org.springframework.beans.factory.BeanFactory; import org.springframework.beans.factory.config.RuntimeBeanReference; -public class BuilderAction { +import java.lang.reflect.InvocationTargetException; +import java.util.HashMap; +import java.util.List; +import java.util.Map; - private final MethodInfo methodInfo; - private final HashMap parameterValues; +public class BuilderAction { + private final MethodInfo methodInfo; + private final HashMap parameterValues; - public BuilderAction(MethodInfo methodInfo, HashMap parameterValues) { - this.methodInfo = methodInfo; - this.parameterValues = parameterValues; - } - - public Object invoke(BeanFactory beanFactory, Object rootBuilder, Object contextBuilder) { - SimpleTypeConverter converter = new SimpleTypeConverter(); - Object args[] = new Object[methodInfo.parameters.size()]; - int pos=0; - for (Map.Entry entry : methodInfo.parameters.entrySet()) { - String paramName = entry.getKey(); - Class paramClass = entry.getValue(); - Object value = parameterValues.get(paramName); - if( value != null ) { - if( value.getClass() == RuntimeBeanReference.class ) { - value = beanFactory.getBean(((RuntimeBeanReference)value).getBeanName()); - } - if( value.getClass() == BuilderStatement.class ) { - BuilderStatement bs = (BuilderStatement) value; - value = bs.create(beanFactory, rootBuilder); - } - args[pos] = converter.convertIfNecessary(value, paramClass); - } - - } - - try { - return methodInfo.method.invoke(contextBuilder, args); - } catch (InvocationTargetException e) { - throw new IllegalArgumentException(e.getCause()); - } catch (RuntimeException e) { - throw e; - } catch (Throwable e) { - throw new IllegalArgumentException(e); - } - - } - - public String getName() { - return methodInfo.getName(); - } - - public MethodInfo getMethodInfo() { - return methodInfo; - } + public BuilderAction(MethodInfo methodInfo, HashMap parameterValues) { + this.methodInfo = methodInfo; + this.parameterValues = parameterValues; + } + + public Object invoke(BeanFactory beanFactory, Object rootBuilder, Object contextBuilder) { + SimpleTypeConverter converter = new SimpleTypeConverter(); + Object args[] = new Object[methodInfo.parameters.size()]; + int pos = 0; + for (Map.Entry entry : methodInfo.parameters.entrySet()) { + String paramName = entry.getKey(); + Class paramClass = entry.getValue(); + Object value = parameterValues.get(paramName); + if (value != null) { + value = replaceBeanReferences(beanFactory, rootBuilder, value); + args[pos] = converter.convertIfNecessary(value, paramClass); + } + } + + try { + return methodInfo.method.invoke(contextBuilder, args); + } + catch (InvocationTargetException e) { + throw new IllegalArgumentException(e.getCause()); + } + catch (RuntimeException e) { + throw e; + } + catch (Throwable e) { + throw new IllegalArgumentException(e); + } + } + + protected Object replaceBeanReferences(BeanFactory beanFactory, Object rootBuilder, Object value) { + // TODO why not using instanceof?? + if (value.getClass() == RuntimeBeanReference.class) { + String beanName = ((RuntimeBeanReference) value).getBeanName(); + value = beanFactory.getBean(beanName); + } + if (value.getClass() == BuilderStatement.class) { + BuilderStatement bs = (BuilderStatement) value; + value = bs.create(beanFactory, rootBuilder); + } + if (value instanceof List) { + List list = (List) value; + for (int i = 0, size = list.size(); i < size; i++) { + list.set(i, replaceBeanReferences(beanFactory, rootBuilder, list.get(i))); + } + } + return value; + } + + public String getName() { + return methodInfo.getName(); + } + + public MethodInfo getMethodInfo() { + return methodInfo; + } } Modified: activemq/camel/trunk/camel-spring/src/main/java/org/apache/camel/spring/xml/CamelBeanDefinitionParser.java URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-spring/src/main/java/org/apache/camel/spring/xml/CamelBeanDefinitionParser.java?view=diff&rev=534941&r1=534940&r2=534941 ============================================================================== --- activemq/camel/trunk/camel-spring/src/main/java/org/apache/camel/spring/xml/CamelBeanDefinitionParser.java (original) +++ activemq/camel/trunk/camel-spring/src/main/java/org/apache/camel/spring/xml/CamelBeanDefinitionParser.java Thu May 3 10:35:43 2007 @@ -37,8 +37,10 @@ import org.apache.camel.builder.ValueBuilder; import org.springframework.beans.SimpleTypeConverter; import org.springframework.beans.factory.config.RuntimeBeanReference; +import org.springframework.beans.factory.config.BeanDefinition; import org.springframework.beans.factory.support.AbstractBeanDefinition; import org.springframework.beans.factory.support.BeanDefinitionBuilder; +import org.springframework.beans.factory.support.ChildBeanDefinition; import org.springframework.beans.factory.xml.AbstractBeanDefinitionParser; import org.springframework.beans.factory.xml.ParserContext; import org.springframework.util.StringUtils; @@ -50,8 +52,14 @@ import org.w3c.dom.NodeList; public class CamelBeanDefinitionParser extends AbstractBeanDefinitionParser { + private final CamelNamespaceHandler namespaceHandler; + private int counter; - protected AbstractBeanDefinition parseInternal(Element element, ParserContext parserContext) { + public CamelBeanDefinitionParser(CamelNamespaceHandler namespaceHandler) { + this.namespaceHandler = namespaceHandler; + } + + protected AbstractBeanDefinition parseInternal(Element element, ParserContext parserContext) { BeanDefinitionBuilder factory = BeanDefinitionBuilder.rootBeanDefinition(RouteBuilderFactoryBean.class); List childElements = DomUtils.getChildElementsByTagName(element, "route"); @@ -62,7 +70,7 @@ Element routeElement = (Element) childElements.get(i); ArrayList actions = new ArrayList(); - Class type = parseBuilderElement(routeElement, RouteBuilder.class, actions); + Class type = parseBuilderElement(parserContext, routeElement, RouteBuilder.class, actions); BuilderStatement statement = new BuilderStatement(); statement.setReturnType(type); statement.setActions(actions); @@ -77,19 +85,19 @@ /** * Use reflection to figure out what is the valid next element. */ - private Class parseBuilderElement(Element element, Class builder, ArrayList actions) { + private Class parseBuilderElement(ParserContext parserContext, Element element, Class builder, ArrayList actions) { Class currentBuilder = builder; NodeList childElements = element.getChildNodes(); Element previousElement = null; for (int i = 0; i < childElements.getLength(); ++i) { Node node = childElements.item(i); if (node.getNodeType() == Node.ELEMENT_NODE) { - currentBuilder = parseAction(currentBuilder, actions, (Element) node, previousElement); + currentBuilder = parseAction(parserContext, currentBuilder, actions, (Element) node, previousElement); previousElement = (Element) node; BuilderAction action = actions.get(actions.size()-1); if( action.getMethodInfo().methodAnnotation.nestedActions() ) { - currentBuilder = parseBuilderElement((Element) node, currentBuilder, actions); + currentBuilder = parseBuilderElement(parserContext, (Element) node, currentBuilder, actions); } else { // Make sure the there are no child elements. if( hasChildElements(node) ) { @@ -131,7 +139,7 @@ return false; } - private Class parseAction(Class currentBuilder, ArrayList actions, Element element, Element previousElement) { + private Class parseAction(ParserContext parserContext, Class currentBuilder, ArrayList actions, Element element, Element previousElement) { String actionName = element.getLocalName(); @@ -178,8 +186,11 @@ parameterNames.removeAll(attributeArguments.keySet()); for (String key : parameterNames) { ArrayList elements = elementArguments.get(key); - Class clazz = match.parameters.get(key); - Object value = convertTo(elements, clazz); + if (elements == null) { + elements = getFirstChildElements(element); + } + Class clazz = match.parameters.get(key); + Object value = convertTo(parserContext, elements, clazz); attributeArguments.put(key, value); for (Element el : elements) { // remove the argument nodes so that they don't get interpreted as @@ -192,17 +203,42 @@ return match.method.getReturnType(); } - private Object convertTo(ArrayList elements, Class clazz) { + private ArrayList getFirstChildElements(Element element) { + ArrayList answer = new ArrayList(); + NodeList list = element.getChildNodes(); + for (int i = 0, size = list.getLength(); i < size; i++) { + Node node = list.item(i); + if (node instanceof Element) { + answer.add((Element) node); + break; + } + } + return answer; + } + + private Object convertTo(ParserContext parserContext, ArrayList elements, Class clazz) { if( clazz.isArray() || elements.size() > 1 ) { - Object array = Array.newInstance(clazz.getComponentType(), elements.size()); + List list = new ArrayList(); for( int i=0; i < elements.size(); i ++ ) { ArrayList e = new ArrayList(1); e.add(elements.get(i)); - Object value = convertTo(e, clazz.getComponentType()); - Array.set(array, i, value); + Object value = convertTo(parserContext, e, clazz.getComponentType()); + + list.add(value); + } + return list; + /* + Object array = Array.newInstance(clazz.getComponentType(), elements.size()); + for( int i=0; i < elements.size(); i ++ ) { + ArrayList e = new ArrayList(1); + e.add(elements.get(i)); + Object value = convertTo(parserContext, e, clazz.getComponentType()); + + Array.set(array, i, value); } return array; + */ } else { Element element = elements.get(0); @@ -215,7 +251,7 @@ if( hasChildElements(element) ) { ArrayList actions = new ArrayList(); - Class type = parseBuilderElement(element, RouteBuilder.class, actions); + Class type = parseBuilderElement(parserContext, element, RouteBuilder.class, actions); if ( type == ValueBuilder.class && clazz==Expression.class ) { Method method; @@ -239,14 +275,27 @@ return statement; } else { - // Just use the text in the element as the value. + // if we are on an element which has a custom parser, lets use that. + String name = element.getLocalName(); + if (namespaceHandler.getParserElementNames().contains(name)) { + String id = createBeanId(name); + element.setAttribute("id", id); + namespaceHandler.parse(element, parserContext); + return new RuntimeBeanReference(id); + } + + // Just use the text in the element as the value. SimpleTypeConverter converter = new SimpleTypeConverter(); return converter.convertIfNecessary(element.getTextContent(), clazz); } } } - private MethodInfo findMethodMatch(ArrayList methods, Set attributeNames, Set elementNames) { + protected synchronized String createBeanId(String name) { + return "_internal:camel:bean:" + name + (++counter); + } + + private MethodInfo findMethodMatch(ArrayList methods, Set attributeNames, Set elementNames) { for (MethodInfo method : methods) { // make sure all the given attribute parameters can be assigned via @@ -271,7 +320,8 @@ } // We may still be able to match using elements as parameters. - for (String key : elementNames) { + /* + for (String key : elementNames) { if (parameterNames.isEmpty()) { break; } @@ -290,8 +340,9 @@ if (parameterNames.isEmpty()) { return method; } - - } + */ + return method; + } return null; } Modified: activemq/camel/trunk/camel-spring/src/main/java/org/apache/camel/spring/xml/CamelNamespaceHandler.java URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-spring/src/main/java/org/apache/camel/spring/xml/CamelNamespaceHandler.java?view=diff&rev=534941&r1=534940&r2=534941 ============================================================================== --- activemq/camel/trunk/camel-spring/src/main/java/org/apache/camel/spring/xml/CamelNamespaceHandler.java (original) +++ activemq/camel/trunk/camel-spring/src/main/java/org/apache/camel/spring/xml/CamelNamespaceHandler.java Thu May 3 10:35:43 2007 @@ -1,33 +1,35 @@ package org.apache.camel.spring.xml; -import static org.apache.camel.util.ObjectHelper.isNotNullOrBlank; import org.apache.camel.spring.CamelContextFactoryBean; import org.apache.camel.spring.EndpointFactoryBean; -import org.apache.camel.util.ObjectHelper; -import org.springframework.beans.factory.xml.NamespaceHandlerSupport; -import org.springframework.beans.factory.xml.ParserContext; -import org.springframework.beans.factory.support.BeanDefinitionBuilder; +import static org.apache.camel.util.ObjectHelper.isNotNullOrBlank; +import org.apache.camel.builder.xml.XPathBuilder; import org.springframework.beans.factory.config.BeanDefinition; import org.springframework.beans.factory.config.RuntimeBeanReference; import org.springframework.beans.factory.parsing.BeanComponentDefinition; -import org.springframework.beans.PropertyValue; +import org.springframework.beans.factory.support.BeanDefinitionBuilder; +import org.springframework.beans.factory.xml.NamespaceHandlerSupport; +import org.springframework.beans.factory.xml.ParserContext; +import org.springframework.beans.factory.xml.BeanDefinitionParser; +import org.springframework.util.xml.DomUtils; import org.w3c.dom.Element; -import org.w3c.dom.NodeList; import org.w3c.dom.Node; +import org.w3c.dom.NodeList; -public class CamelNamespaceHandler extends NamespaceHandlerSupport { - private int counter; +import java.util.Set; +import java.util.HashSet; - protected CamelBeanDefinitionParser routesParser = new CamelBeanDefinitionParser(); +public class CamelNamespaceHandler extends NamespaceHandlerSupport { + protected CamelBeanDefinitionParser routesParser = new CamelBeanDefinitionParser(this); protected BeanDefinitionParserSupport endpointParser = new BeanDefinitionParserSupport(EndpointFactoryBean.class); + private Set parserElementNames = new HashSet(); public void init() { - registerBeanDefinitionParser("routes", routesParser); - registerBeanDefinitionParser("routeBuilder", routesParser); - registerBeanDefinitionParser("endpoint", endpointParser); - - registerBeanDefinitionParser("camelContext", new BeanDefinitionParserSupport(CamelContextFactoryBean.class) { + registerParser("routes", routesParser); + registerParser("routeBuilder", routesParser); + registerParser("endpoint", endpointParser); + registerParser("camelContext", new BeanDefinitionParserSupport(CamelContextFactoryBean.class) { @Override protected void doParse(Element element, ParserContext parserContext, BeanDefinitionBuilder builder) { super.doParse(element, parserContext, builder); @@ -47,45 +49,42 @@ String routeId = contextId + ":routes"; routes.setAttribute("id", routeId); - BeanDefinition definition = routesParser.parse(routes, parserContext); - definition.getPropertyValues().addPropertyValue("context", new RuntimeBeanReference(contextId)); - //definition.getPropertyValues().addPropertyValue("context", builder.getBeanDefinition()); - //builder.addPropertyValue("routeBuilder", definition); - parserContext.registerComponent(new BeanComponentDefinition(definition, routeId)); - -/* - NodeList list = element.getElementsByTagName("routes"); - for (int size = list.getLength(), i = 0; i < size; i++) { - Element node = (Element) list.item(i); - String routeId = node.getAttribute("id"); - if (!isNotNullOrBlank(routeId)) { - routeId = "__camel_route_" + nextCounter(); - node.setAttribute("id", routeId); - } - BeanDefinition definition = routesParser.parse(node, parserContext); - definition.getPropertyValues().addPropertyValue("context", new RuntimeBeanReference(contextId)); - //definition.getPropertyValues().addPropertyValue("context", builder.getBeanDefinition()); - //builder.addPropertyValue("routeBuilder", definition); - parserContext.registerComponent(new BeanComponentDefinition(definition, routeId)); - } + BeanDefinition definition = routesParser.parse(routes, parserContext); + definition.getPropertyValues().addPropertyValue("context", new RuntimeBeanReference(contextId)); + parserContext.registerComponent(new BeanComponentDefinition(definition, routeId)); -*/ list = routes.getElementsByTagName("endpoint"); for (int size = list.getLength(), i = 0; i < size; i++) { Element node = (Element) list.item(i); definition = endpointParser.parse(node, parserContext); String id = node.getAttribute("id"); if (isNotNullOrBlank(id)) { - //definition.getPropertyValues().addPropertyValue("context", builder.getBeanDefinition()); definition.getPropertyValues().addPropertyValue("context", new RuntimeBeanReference(contextId)); + //definition.getPropertyValues().addPropertyValue("context", builder.getBeanDefinition()); parserContext.registerComponent(new BeanComponentDefinition(definition, id)); } } } }); + + registerParser("xpath", new BeanDefinitionParserSupport(XPathBuilder.class) { + @Override + protected void doParse(Element element, ParserContext parserContext, BeanDefinitionBuilder builder) { + // lets create a child context + String xpath = DomUtils.getTextValue(element); + builder.addConstructorArg(xpath); + super.doParse(element, parserContext, builder); + builder.addPropertyValue("namespacesFromDom", element); + } + }); + } + + protected void registerParser(String name, BeanDefinitionParser parser) { + parserElementNames.add(name); + registerBeanDefinitionParser(name, parser); } - protected synchronized int nextCounter() { - return ++counter; + public Set getParserElementNames() { + return parserElementNames; } } Modified: activemq/camel/trunk/camel-spring/src/main/resources/org/apache/camel/spring/camel-1.0.xsd URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-spring/src/main/resources/org/apache/camel/spring/camel-1.0.xsd?view=diff&rev=534941&r1=534940&r2=534941 ============================================================================== --- activemq/camel/trunk/camel-spring/src/main/resources/org/apache/camel/spring/camel-1.0.xsd (original) +++ activemq/camel/trunk/camel-spring/src/main/resources/org/apache/camel/spring/camel-1.0.xsd Thu May 3 10:35:43 2007 @@ -140,11 +140,14 @@ + - + - + + + @@ -159,6 +162,12 @@ + + + + + + @@ -172,13 +181,12 @@ - + - Added: activemq/camel/trunk/camel-spring/src/test/java/org/apache/camel/spring/example/SpringXPathFilterTest.java URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-spring/src/test/java/org/apache/camel/spring/example/SpringXPathFilterTest.java?view=auto&rev=534941 ============================================================================== --- activemq/camel/trunk/camel-spring/src/test/java/org/apache/camel/spring/example/SpringXPathFilterTest.java (added) +++ activemq/camel/trunk/camel-spring/src/test/java/org/apache/camel/spring/example/SpringXPathFilterTest.java Thu May 3 10:35:43 2007 @@ -0,0 +1,40 @@ +/** + * + * 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.example; + +import org.apache.camel.processor.XPathFilterTest; +import org.apache.camel.CamelContext; +import org.apache.camel.spring.SpringCamelContext; +import org.apache.camel.impl.NoRouteBuilder; +import org.apache.camel.builder.RouteBuilder; +import org.springframework.context.support.ClassPathXmlApplicationContext; + +/** + * @version $Revision: 1.1 $ + */ +public class SpringXPathFilterTest extends XPathFilterTest { + @Override + protected CamelContext createCamelContext() throws Exception { + return SpringCamelContext.springCamelContext(new ClassPathXmlApplicationContext("org/apache/camel/spring/example/xpathFilter.xml")); + } + + @Override + protected RouteBuilder createRouteBuilder() { + return NoRouteBuilder.getInstance(); + } +} Propchange: activemq/camel/trunk/camel-spring/src/test/java/org/apache/camel/spring/example/SpringXPathFilterTest.java ------------------------------------------------------------------------------ svn:eol-style = native Added: activemq/camel/trunk/camel-spring/src/test/java/org/apache/camel/spring/xml/SpringXmlRouteBuilderTest.java URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-spring/src/test/java/org/apache/camel/spring/xml/SpringXmlRouteBuilderTest.java?view=auto&rev=534941 ============================================================================== --- activemq/camel/trunk/camel-spring/src/test/java/org/apache/camel/spring/xml/SpringXmlRouteBuilderTest.java (added) +++ activemq/camel/trunk/camel-spring/src/test/java/org/apache/camel/spring/xml/SpringXmlRouteBuilderTest.java Thu May 3 10:35:43 2007 @@ -0,0 +1,120 @@ +/** + * + * 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.xml; + +import org.apache.camel.builder.RouteBuilderTest; +import org.apache.camel.Route; +import org.apache.camel.Processor; +import org.apache.camel.spring.SpringCamelContext; +import org.apache.camel.processor.DelegateProcessor; +import org.springframework.context.support.ClassPathXmlApplicationContext; +import org.springframework.context.support.AbstractXmlApplicationContext; + +import java.util.List; + +/** + * A test case of the builder using Spring 2.0 to load the rules + * + * @version $Revision: 520164 $ + */ +public class SpringXmlRouteBuilderTest extends RouteBuilderTest { + protected AbstractXmlApplicationContext applicationContext; + + @Override + @SuppressWarnings("unchecked") + protected List buildSimpleRoute() { + return getRoutesFromContext("org/apache/camel/spring/xml/buildSimpleRoute.xml"); + } + + @Override + protected List buildCustomProcessor() { + List answer = getRoutesFromContext("org/apache/camel/spring/xml/buildCustomProcessor.xml"); + myProcessor = (Processor) applicationContext.getBean("myProcessor"); + return answer; + } + + @Override + protected List buildCustomProcessorWithFilter() { + List answer = getRoutesFromContext("org/apache/camel/spring/xml/buildCustomProcessorWithFilter.xml"); + myProcessor = (Processor) applicationContext.getBean("myProcessor"); + return answer; + } + + @Override + protected List buildRouteWithInterceptor() { + List answer = getRoutesFromContext("org/apache/camel/spring/xml/buildRouteWithInterceptor.xml"); + interceptor1 = (DelegateProcessor) applicationContext.getBean("interceptor1"); + interceptor2 = (DelegateProcessor) applicationContext.getBean("interceptor2"); + return answer; + } + + @Override + protected List buildSimpleRouteWithHeaderPredicate() { + return getRoutesFromContext("org/apache/camel/spring/xml/buildSimpleRouteWithHeaderPredicate.xml"); + } + + @Override + protected List buildSimpleRouteWithChoice() { + return getRoutesFromContext("org/apache/camel/spring/xml/buildSimpleRouteWithChoice.xml"); + } + + @Override + protected List buildWireTap() { + return getRoutesFromContext("org/apache/camel/spring/xml/buildWireTap.xml"); + } + + @Override + protected List buildDynamicRecipientList() { + return getRoutesFromContext("org/apache/camel/spring/xml/buildDynamicRecipientList.xml"); + } + + @Override + protected List buildStaticRecipientList() { + return getRoutesFromContext("org/apache/camel/spring/xml/buildStaticRecipientList.xml"); + } + + @Override + protected List buildSplitter() { + return getRoutesFromContext("org/apache/camel/spring/xml/buildSplitter.xml"); + } + + @Override + protected List buildIdempotentConsumer() { + return getRoutesFromContext("org/apache/camel/spring/xml/buildIdempotentConsumer.xml"); + } + + @Override + public void testIdempotentConsumer() throws Exception { + // TODO + } + + @Override + public void testWireTap() throws Exception { + // TODO + } + + protected List getRoutesFromContext(String classpathConfigFile) { + applicationContext = new ClassPathXmlApplicationContext(classpathConfigFile); + String name = "camel"; + SpringCamelContext context = (SpringCamelContext) applicationContext.getBean(name); + assertNotNull("No Camel Context for name: " + name + " in file: " + classpathConfigFile, context); + List routes = context.getRoutes(); + assertNotNull("No routes available for context: " + name + " in file: " + classpathConfigFile, routes); + return routes; + } +} Propchange: activemq/camel/trunk/camel-spring/src/test/java/org/apache/camel/spring/xml/SpringXmlRouteBuilderTest.java ------------------------------------------------------------------------------ svn:eol-style = native Modified: activemq/camel/trunk/camel-spring/src/test/resources/org/apache/camel/spring/builder/spring_route_builder_test.xml URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-spring/src/test/resources/org/apache/camel/spring/builder/spring_route_builder_test.xml?view=diff&rev=534941&r1=534940&r2=534941 ============================================================================== --- activemq/camel/trunk/camel-spring/src/test/resources/org/apache/camel/spring/builder/spring_route_builder_test.xml (original) +++ activemq/camel/trunk/camel-spring/src/test/resources/org/apache/camel/spring/builder/spring_route_builder_test.xml Thu May 3 10:35:43 2007 @@ -22,7 +22,14 @@ http://activemq.apache.org/camel/schema/camel-1.0.xsd http://activemq.apache.org/camel/schema/camel-1.0.xsd "> - + + + Added: activemq/camel/trunk/camel-spring/src/test/resources/org/apache/camel/spring/example/xpathFilter.xml URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-spring/src/test/resources/org/apache/camel/spring/example/xpathFilter.xml?view=auto&rev=534941 ============================================================================== --- activemq/camel/trunk/camel-spring/src/test/resources/org/apache/camel/spring/example/xpathFilter.xml (added) +++ activemq/camel/trunk/camel-spring/src/test/resources/org/apache/camel/spring/example/xpathFilter.xml Thu May 3 10:35:43 2007 @@ -0,0 +1,37 @@ + + + + + + + + + + /person[@name='James'] + + + + + + + Propchange: activemq/camel/trunk/camel-spring/src/test/resources/org/apache/camel/spring/example/xpathFilter.xml ------------------------------------------------------------------------------ svn:eol-style = native Added: activemq/camel/trunk/camel-spring/src/test/resources/org/apache/camel/spring/xml/buildCustomProcessor.xml URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-spring/src/test/resources/org/apache/camel/spring/xml/buildCustomProcessor.xml?view=auto&rev=534941 ============================================================================== --- activemq/camel/trunk/camel-spring/src/test/resources/org/apache/camel/spring/xml/buildCustomProcessor.xml (added) +++ activemq/camel/trunk/camel-spring/src/test/resources/org/apache/camel/spring/xml/buildCustomProcessor.xml Thu May 3 10:35:43 2007 @@ -0,0 +1,40 @@ + + + + + + + + + + + + + + + + + + Propchange: activemq/camel/trunk/camel-spring/src/test/resources/org/apache/camel/spring/xml/buildCustomProcessor.xml ------------------------------------------------------------------------------ svn:eol-style = native Added: activemq/camel/trunk/camel-spring/src/test/resources/org/apache/camel/spring/xml/buildCustomProcessorWithFilter.xml URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-spring/src/test/resources/org/apache/camel/spring/xml/buildCustomProcessorWithFilter.xml?view=auto&rev=534941 ============================================================================== --- activemq/camel/trunk/camel-spring/src/test/resources/org/apache/camel/spring/xml/buildCustomProcessorWithFilter.xml (added) +++ activemq/camel/trunk/camel-spring/src/test/resources/org/apache/camel/spring/xml/buildCustomProcessorWithFilter.xml Thu May 3 10:35:43 2007 @@ -0,0 +1,46 @@ + + + + + + + + + + + + + +
+ + + + + + + + + + Propchange: activemq/camel/trunk/camel-spring/src/test/resources/org/apache/camel/spring/xml/buildCustomProcessorWithFilter.xml ------------------------------------------------------------------------------ svn:eol-style = native Added: activemq/camel/trunk/camel-spring/src/test/resources/org/apache/camel/spring/xml/buildDynamicRecipientList.xml URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-spring/src/test/resources/org/apache/camel/spring/xml/buildDynamicRecipientList.xml?view=auto&rev=534941 ============================================================================== --- activemq/camel/trunk/camel-spring/src/test/resources/org/apache/camel/spring/xml/buildDynamicRecipientList.xml (added) +++ activemq/camel/trunk/camel-spring/src/test/resources/org/apache/camel/spring/xml/buildDynamicRecipientList.xml Thu May 3 10:35:43 2007 @@ -0,0 +1,42 @@ + + + + + + + + + + + +
+ + + + + + + + Propchange: activemq/camel/trunk/camel-spring/src/test/resources/org/apache/camel/spring/xml/buildDynamicRecipientList.xml ------------------------------------------------------------------------------ svn:eol-style = native Added: activemq/camel/trunk/camel-spring/src/test/resources/org/apache/camel/spring/xml/buildIdempotentConsumer.xml URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-spring/src/test/resources/org/apache/camel/spring/xml/buildIdempotentConsumer.xml?view=auto&rev=534941 ============================================================================== --- activemq/camel/trunk/camel-spring/src/test/resources/org/apache/camel/spring/xml/buildIdempotentConsumer.xml (added) +++ activemq/camel/trunk/camel-spring/src/test/resources/org/apache/camel/spring/xml/buildIdempotentConsumer.xml Thu May 3 10:35:43 2007 @@ -0,0 +1,42 @@ + + + + + + + + + + + + + + + + + Propchange: activemq/camel/trunk/camel-spring/src/test/resources/org/apache/camel/spring/xml/buildIdempotentConsumer.xml ------------------------------------------------------------------------------ svn:eol-style = native Added: activemq/camel/trunk/camel-spring/src/test/resources/org/apache/camel/spring/xml/buildRouteWithInterceptor.xml URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-spring/src/test/resources/org/apache/camel/spring/xml/buildRouteWithInterceptor.xml?view=auto&rev=534941 ============================================================================== --- activemq/camel/trunk/camel-spring/src/test/resources/org/apache/camel/spring/xml/buildRouteWithInterceptor.xml (added) +++ activemq/camel/trunk/camel-spring/src/test/resources/org/apache/camel/spring/xml/buildRouteWithInterceptor.xml Thu May 3 10:35:43 2007 @@ -0,0 +1,49 @@ + + + + + + + + + + + + + + + + + + + + + + + Propchange: activemq/camel/trunk/camel-spring/src/test/resources/org/apache/camel/spring/xml/buildRouteWithInterceptor.xml ------------------------------------------------------------------------------ svn:eol-style = native Added: activemq/camel/trunk/camel-spring/src/test/resources/org/apache/camel/spring/xml/buildSimpleRoute.xml URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-spring/src/test/resources/org/apache/camel/spring/xml/buildSimpleRoute.xml?view=auto&rev=534941 ============================================================================== --- activemq/camel/trunk/camel-spring/src/test/resources/org/apache/camel/spring/xml/buildSimpleRoute.xml (added) +++ activemq/camel/trunk/camel-spring/src/test/resources/org/apache/camel/spring/xml/buildSimpleRoute.xml Thu May 3 10:35:43 2007 @@ -0,0 +1,38 @@ + + + + + + + + + + + + + + + + Propchange: activemq/camel/trunk/camel-spring/src/test/resources/org/apache/camel/spring/xml/buildSimpleRoute.xml ------------------------------------------------------------------------------ svn:eol-style = native Added: activemq/camel/trunk/camel-spring/src/test/resources/org/apache/camel/spring/xml/buildSimpleRouteWithChoice.xml URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-spring/src/test/resources/org/apache/camel/spring/xml/buildSimpleRouteWithChoice.xml?view=auto&rev=534941 ============================================================================== --- activemq/camel/trunk/camel-spring/src/test/resources/org/apache/camel/spring/xml/buildSimpleRouteWithChoice.xml (added) +++ activemq/camel/trunk/camel-spring/src/test/resources/org/apache/camel/spring/xml/buildSimpleRouteWithChoice.xml Thu May 3 10:35:43 2007 @@ -0,0 +1,59 @@ + + + + + + + + + + + + +
+ + + + + + +
+ + + + + + + + + + + + + + Propchange: activemq/camel/trunk/camel-spring/src/test/resources/org/apache/camel/spring/xml/buildSimpleRouteWithChoice.xml ------------------------------------------------------------------------------ svn:eol-style = native Added: activemq/camel/trunk/camel-spring/src/test/resources/org/apache/camel/spring/xml/buildSimpleRouteWithHeaderPredicate.xml URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-spring/src/test/resources/org/apache/camel/spring/xml/buildSimpleRouteWithHeaderPredicate.xml?view=auto&rev=534941 ============================================================================== --- activemq/camel/trunk/camel-spring/src/test/resources/org/apache/camel/spring/xml/buildSimpleRouteWithHeaderPredicate.xml (added) +++ activemq/camel/trunk/camel-spring/src/test/resources/org/apache/camel/spring/xml/buildSimpleRouteWithHeaderPredicate.xml Thu May 3 10:35:43 2007 @@ -0,0 +1,44 @@ + + + + + + + + + + + +
+ + + + + + + + + + Propchange: activemq/camel/trunk/camel-spring/src/test/resources/org/apache/camel/spring/xml/buildSimpleRouteWithHeaderPredicate.xml ------------------------------------------------------------------------------ svn:eol-style = native Added: activemq/camel/trunk/camel-spring/src/test/resources/org/apache/camel/spring/xml/buildSplitter.xml URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-spring/src/test/resources/org/apache/camel/spring/xml/buildSplitter.xml?view=auto&rev=534941 ============================================================================== --- activemq/camel/trunk/camel-spring/src/test/resources/org/apache/camel/spring/xml/buildSplitter.xml (added) +++ activemq/camel/trunk/camel-spring/src/test/resources/org/apache/camel/spring/xml/buildSplitter.xml Thu May 3 10:35:43 2007 @@ -0,0 +1,45 @@ + + + + + + + + + + + + + + + + + + + + + + Propchange: activemq/camel/trunk/camel-spring/src/test/resources/org/apache/camel/spring/xml/buildSplitter.xml ------------------------------------------------------------------------------ svn:eol-style = native Added: activemq/camel/trunk/camel-spring/src/test/resources/org/apache/camel/spring/xml/buildStaticRecipientList.xml URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-spring/src/test/resources/org/apache/camel/spring/xml/buildStaticRecipientList.xml?view=auto&rev=534941 ============================================================================== --- activemq/camel/trunk/camel-spring/src/test/resources/org/apache/camel/spring/xml/buildStaticRecipientList.xml (added) +++ activemq/camel/trunk/camel-spring/src/test/resources/org/apache/camel/spring/xml/buildStaticRecipientList.xml Thu May 3 10:35:43 2007 @@ -0,0 +1,42 @@ + + + + + + + + + + + queue:b + queue:c + queue:d + + + + + + + Propchange: activemq/camel/trunk/camel-spring/src/test/resources/org/apache/camel/spring/xml/buildStaticRecipientList.xml ------------------------------------------------------------------------------ svn:eol-style = native Added: activemq/camel/trunk/camel-spring/src/test/resources/org/apache/camel/spring/xml/buildWireTap.xml URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-spring/src/test/resources/org/apache/camel/spring/xml/buildWireTap.xml?view=auto&rev=534941 ============================================================================== --- activemq/camel/trunk/camel-spring/src/test/resources/org/apache/camel/spring/xml/buildWireTap.xml (added) +++ activemq/camel/trunk/camel-spring/src/test/resources/org/apache/camel/spring/xml/buildWireTap.xml Thu May 3 10:35:43 2007 @@ -0,0 +1,41 @@ + + + + + + + + + + + + + + + + + + + Propchange: activemq/camel/trunk/camel-spring/src/test/resources/org/apache/camel/spring/xml/buildWireTap.xml ------------------------------------------------------------------------------ svn:eol-style = native