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 2015/09/16 15:03:51 UTC

[1/5] camel git commit: CAMEL-8393: Fixed Routing Slip and Dynamic Router to not evaluate expression again during each redelivery attempt from Error Handler if routing caused an exception.

Repository: camel
Updated Branches:
  refs/heads/master f53890482 -> eeb09c827


CAMEL-8393: Fixed Routing Slip and Dynamic Router to not evaluate expression again during each redelivery attempt from Error Handler if routing caused an exception.


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/0163fe44
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/0163fe44
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/0163fe44

Branch: refs/heads/master
Commit: 0163fe44840c014f293e6790d6d60858191733be
Parents: f538904
Author: Claus Ibsen <da...@apache.org>
Authored: Wed Sep 16 13:03:11 2015 +0200
Committer: Claus Ibsen <da...@apache.org>
Committed: Wed Sep 16 13:03:11 2015 +0200

----------------------------------------------------------------------
 .../org/apache/camel/processor/RoutingSlip.java |  76 +++++++++++-
 .../processor/DynamicRouterOnExceptionTest.java | 121 +++++++++++++++++++
 .../processor/RoutingSlipOnExceptionTest.java   |  38 ++++++
 3 files changed, 233 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/0163fe44/camel-core/src/main/java/org/apache/camel/processor/RoutingSlip.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/processor/RoutingSlip.java b/camel-core/src/main/java/org/apache/camel/processor/RoutingSlip.java
index a8ca7e0..c20742c 100644
--- a/camel-core/src/main/java/org/apache/camel/processor/RoutingSlip.java
+++ b/camel-core/src/main/java/org/apache/camel/processor/RoutingSlip.java
@@ -17,17 +17,21 @@
 package org.apache.camel.processor;
 
 import java.util.Iterator;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.ConcurrentMap;
 
 import org.apache.camel.AsyncCallback;
 import org.apache.camel.AsyncProcessor;
 import org.apache.camel.AsyncProducerCallback;
 import org.apache.camel.CamelContext;
 import org.apache.camel.Endpoint;
+import org.apache.camel.ErrorHandlerFactory;
 import org.apache.camel.Exchange;
 import org.apache.camel.ExchangePattern;
 import org.apache.camel.Expression;
 import org.apache.camel.FailedToCreateProducerException;
 import org.apache.camel.Message;
+import org.apache.camel.Processor;
 import org.apache.camel.Producer;
 import org.apache.camel.Traceable;
 import org.apache.camel.builder.ExpressionBuilder;
@@ -36,9 +40,12 @@ import org.apache.camel.impl.EmptyProducerCache;
 import org.apache.camel.impl.ProducerCache;
 import org.apache.camel.spi.EndpointUtilizationStatistics;
 import org.apache.camel.spi.IdAware;
+import org.apache.camel.spi.RouteContext;
+import org.apache.camel.spi.UnitOfWork;
 import org.apache.camel.support.ServiceSupport;
 import org.apache.camel.util.AsyncProcessorHelper;
 import org.apache.camel.util.ExchangeHelper;
+import org.apache.camel.util.KeyValueHolder;
 import org.apache.camel.util.MessageHelper;
 import org.apache.camel.util.ObjectHelper;
 import org.apache.camel.util.ServiceHelper;
@@ -67,6 +74,20 @@ public class RoutingSlip extends ServiceSupport implements AsyncProcessor, Trace
     protected Expression expression;
     protected String uriDelimiter;
     protected final CamelContext camelContext;
+    private final ConcurrentMap<PreparedErrorHandler, AsyncProcessor> errorHandlers = new ConcurrentHashMap<PreparedErrorHandler, AsyncProcessor>();
+
+    /**
+     * Class that represents prepared fine grained error handlers when processing routingslip/dynamic-router exchanges
+     * <p/>
+     * This is similar to how multicast processor does.
+     */
+    static final class PreparedErrorHandler extends KeyValueHolder<RouteContext, Processor> {
+
+        public PreparedErrorHandler(RouteContext key, Processor value) {
+            super(key, value);
+        }
+
+    }
 
     /**
      * The iterator to be used for retrieving the next routing slip(s) to be used.
@@ -304,6 +325,49 @@ public class RoutingSlip extends ServiceSupport implements AsyncProcessor, Trace
         return copy;
     }
 
+    protected AsyncProcessor createErrorHandler(RouteContext routeContext, Exchange exchange, AsyncProcessor processor) {
+        AsyncProcessor answer = processor;
+
+        boolean tryBlock = exchange.getProperty(Exchange.TRY_ROUTE_BLOCK, false, boolean.class);
+
+        // do not wrap in error handler if we are inside a try block
+        if (!tryBlock && routeContext != null) {
+            // wrap the producer in error handler so we have fine grained error handling on
+            // the output side instead of the input side
+            // this is needed to support redelivery on that output alone and not doing redelivery
+            // for the entire routingslip/dynamic-router block again which will start from scratch again
+
+            // create key for cache
+            final PreparedErrorHandler key = new PreparedErrorHandler(routeContext, processor);
+
+            // lookup cached first to reuse and preserve memory
+            answer = errorHandlers.get(key);
+            if (answer != null) {
+                log.trace("Using existing error handler for: {}", processor);
+                return answer;
+            }
+
+            log.trace("Creating error handler for: {}", processor);
+            ErrorHandlerFactory builder = routeContext.getRoute().getErrorHandlerBuilder();
+            // create error handler (create error handler directly to keep it light weight,
+            // instead of using ProcessorDefinition.wrapInErrorHandler)
+            try {
+                answer = (AsyncProcessor) builder.createErrorHandler(routeContext, processor);
+
+                // must start the error handler
+                ServiceHelper.startServices(answer);
+
+                // add to cache
+                errorHandlers.putIfAbsent(key, answer);
+
+            } catch (Exception e) {
+                throw ObjectHelper.wrapRuntimeCamelException(e);
+            }
+        }
+
+        return answer;
+    }
+
     protected boolean processExchange(final Endpoint endpoint, final Exchange exchange, final Exchange original,
                                       final AsyncCallback callback, final RoutingSlipIterator iter) {
 
@@ -313,6 +377,11 @@ public class RoutingSlip extends ServiceSupport implements AsyncProcessor, Trace
         boolean sync = producerCache.doInAsyncProducer(endpoint, exchange, null, callback, new AsyncProducerCallback() {
             public boolean doInAsyncProducer(Producer producer, AsyncProcessor asyncProducer, final Exchange exchange,
                                              ExchangePattern exchangePattern, final AsyncCallback callback) {
+
+                // rework error handling to support fine grained error handling
+                RouteContext routeContext = exchange.getUnitOfWork() != null ? exchange.getUnitOfWork().getRouteContext() : null;
+                asyncProducer = createErrorHandler(routeContext, exchange, asyncProducer);
+
                 // set property which endpoint we send to
                 exchange.setProperty(Exchange.TO_ENDPOINT, endpoint.getEndpointUri());
                 exchange.setProperty(Exchange.SLIP_ENDPOINT, endpoint.getEndpointUri());
@@ -403,11 +472,14 @@ public class RoutingSlip extends ServiceSupport implements AsyncProcessor, Trace
     }
 
     protected void doStop() throws Exception {
-        ServiceHelper.stopService(producerCache);
+        ServiceHelper.stopServices(producerCache, errorHandlers);
     }
 
     protected void doShutdown() throws Exception {
-        ServiceHelper.stopAndShutdownService(producerCache);
+        ServiceHelper.stopAndShutdownServices(producerCache, errorHandlers);
+
+        // only clear error handlers when shutting down
+        errorHandlers.clear();
     }
 
     public EndpointUtilizationStatistics getEndpointUtilizationStatistics() {

http://git-wip-us.apache.org/repos/asf/camel/blob/0163fe44/camel-core/src/test/java/org/apache/camel/processor/DynamicRouterOnExceptionTest.java
----------------------------------------------------------------------
diff --git a/camel-core/src/test/java/org/apache/camel/processor/DynamicRouterOnExceptionTest.java b/camel-core/src/test/java/org/apache/camel/processor/DynamicRouterOnExceptionTest.java
new file mode 100644
index 0000000..6684112
--- /dev/null
+++ b/camel-core/src/test/java/org/apache/camel/processor/DynamicRouterOnExceptionTest.java
@@ -0,0 +1,121 @@
+/**
+ * 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.processor;
+
+import org.apache.camel.ContextTestSupport;
+import org.apache.camel.Exchange;
+import org.apache.camel.Processor;
+import org.apache.camel.builder.RouteBuilder;
+import org.apache.camel.component.mock.MockEndpoint;
+
+public class DynamicRouterOnExceptionTest extends ContextTestSupport {
+
+    public void testOk() throws Exception {
+        getMockEndpoint("mock:end").expectedMessageCount(1);
+
+        MockEndpoint route = getMockEndpoint("mock:route");
+        route.expectedMessageCount(1);
+
+        template.sendBody("direct:start", "Hello World");
+
+        assertMockEndpointsSatisfied();
+    }
+
+    public void testException() throws Exception {
+        getMockEndpoint("mock:end").expectedMessageCount(1);
+
+        MockEndpoint route = getMockEndpoint("mock:route");
+        route.whenExchangeReceived(1, new Processor() {
+            @Override
+            public void process(Exchange exchange) throws Exception {
+                exchange.setException(new IllegalArgumentException("Forced"));
+            }
+        });
+        route.whenExchangeReceived(2, new Processor() {
+            @Override
+            public void process(Exchange exchange) throws Exception {
+                exchange.getIn().setBody("Bye World");
+            }
+        });
+        route.expectedMessageCount(2);
+
+        template.sendBody("direct:start", "Hello World");
+
+        assertMockEndpointsSatisfied();
+    }
+
+    public void testExceptionTwo() throws Exception {
+        getMockEndpoint("mock:end").expectedMessageCount(2);
+
+        MockEndpoint route = getMockEndpoint("mock:route");
+        route.whenExchangeReceived(1, new Processor() {
+            @Override
+            public void process(Exchange exchange) throws Exception {
+                exchange.setException(new IllegalArgumentException("Forced"));
+            }
+        });
+        route.whenExchangeReceived(2, new Processor() {
+            @Override
+            public void process(Exchange exchange) throws Exception {
+                exchange.getIn().setBody("Bye World");
+            }
+        });
+        route.whenExchangeReceived(3, new Processor() {
+            @Override
+            public void process(Exchange exchange) throws Exception {
+                exchange.setException(new IllegalArgumentException("Forced"));
+            }
+        });
+        route.whenExchangeReceived(4, new Processor() {
+            @Override
+            public void process(Exchange exchange) throws Exception {
+                exchange.getIn().setBody("Bye World");
+            }
+        });
+        route.expectedMessageCount(4);
+
+        template.sendBody("direct:start", "Hello World");
+        template.sendBody("direct:start", "Bye World");
+
+        assertMockEndpointsSatisfied();
+    }
+
+    @Override
+    protected RouteBuilder createRouteBuilder() throws Exception {
+        return new RouteBuilder() {
+            @Override
+            public void configure() throws Exception {
+                onException(IllegalArgumentException.class)
+                    .maximumRedeliveries(5);
+
+                from("direct:start")
+                    .dynamicRouter(method(DynamicRouterOnExceptionTest.class, "whereTo"))
+                    .to("mock:end");
+            }
+        };
+    }
+
+    public static String whereTo(Exchange exchange) {
+        Boolean invoked = exchange.getProperty("invoked", Boolean.class);
+        if (invoked == null) {
+            exchange.setProperty("invoked", true);
+            return "mock:route";
+        } else {
+            return null;
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/camel/blob/0163fe44/camel-core/src/test/java/org/apache/camel/processor/RoutingSlipOnExceptionTest.java
----------------------------------------------------------------------
diff --git a/camel-core/src/test/java/org/apache/camel/processor/RoutingSlipOnExceptionTest.java b/camel-core/src/test/java/org/apache/camel/processor/RoutingSlipOnExceptionTest.java
new file mode 100644
index 0000000..9f5f6f2
--- /dev/null
+++ b/camel-core/src/test/java/org/apache/camel/processor/RoutingSlipOnExceptionTest.java
@@ -0,0 +1,38 @@
+/**
+ * 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.processor;
+
+import org.apache.camel.builder.RouteBuilder;
+
+public class RoutingSlipOnExceptionTest extends DynamicRouterOnExceptionTest {
+
+    @Override
+    protected RouteBuilder createRouteBuilder() throws Exception {
+        return new RouteBuilder() {
+            @Override
+            public void configure() throws Exception {
+                onException(IllegalArgumentException.class)
+                    .maximumRedeliveries(5);
+
+                from("direct:start")
+                    .routingSlip(method(RoutingSlipOnExceptionTest.class, "whereTo"))
+                    .to("mock:end");
+            }
+        };
+    }
+
+}


[2/5] camel git commit: CAMEL-9131: Add more labels to endpoint/component options.

Posted by da...@apache.org.
CAMEL-9131: Add more labels to endpoint/component options.


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/6542c6d8
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/6542c6d8
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/6542c6d8

Branch: refs/heads/master
Commit: 6542c6d858f7bb123d751812695d91a14870828e
Parents: 0163fe4
Author: Claus Ibsen <da...@apache.org>
Authored: Wed Sep 16 13:13:58 2015 +0200
Committer: Claus Ibsen <da...@apache.org>
Committed: Wed Sep 16 13:13:58 2015 +0200

----------------------------------------------------------------------
 .../browse/BrowseComponentConfigurationAndDocumentationTest.java   | 2 +-
 .../DataFormatComponentConfigurationAndDocumentationTest.java      | 2 +-
 .../dataset/DataSetComponentConfigurationAndDocumentationTest.java | 2 +-
 .../xslt/XsltComponentConfigurationAndDocumentationTest.java       | 2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/6542c6d8/camel-core/src/test/java/org/apache/camel/component/browse/BrowseComponentConfigurationAndDocumentationTest.java
----------------------------------------------------------------------
diff --git a/camel-core/src/test/java/org/apache/camel/component/browse/BrowseComponentConfigurationAndDocumentationTest.java b/camel-core/src/test/java/org/apache/camel/component/browse/BrowseComponentConfigurationAndDocumentationTest.java
index ecfbcc4..507cf06 100644
--- a/camel-core/src/test/java/org/apache/camel/component/browse/BrowseComponentConfigurationAndDocumentationTest.java
+++ b/camel-core/src/test/java/org/apache/camel/component/browse/BrowseComponentConfigurationAndDocumentationTest.java
@@ -41,7 +41,7 @@ public class BrowseComponentConfigurationAndDocumentationTest extends ContextTes
         String json = compConf.createParameterJsonSchema();
         assertNotNull(json);
 
-        assertTrue(json.contains("\"synchronous\": { \"kind\": \"parameter\", \"type\": \"boolean\""));
+        assertTrue(json.contains("\"synchronous\": { \"kind\": \"parameter\", \"label\": \"advanced\", \"type\": \"boolean\""));
     }
 
     @Test

http://git-wip-us.apache.org/repos/asf/camel/blob/6542c6d8/camel-core/src/test/java/org/apache/camel/component/dataformat/DataFormatComponentConfigurationAndDocumentationTest.java
----------------------------------------------------------------------
diff --git a/camel-core/src/test/java/org/apache/camel/component/dataformat/DataFormatComponentConfigurationAndDocumentationTest.java b/camel-core/src/test/java/org/apache/camel/component/dataformat/DataFormatComponentConfigurationAndDocumentationTest.java
index afd2f87..914deeb 100644
--- a/camel-core/src/test/java/org/apache/camel/component/dataformat/DataFormatComponentConfigurationAndDocumentationTest.java
+++ b/camel-core/src/test/java/org/apache/camel/component/dataformat/DataFormatComponentConfigurationAndDocumentationTest.java
@@ -48,7 +48,7 @@ public class DataFormatComponentConfigurationAndDocumentationTest extends Contex
         assertTrue(json.contains("\"name\": { \"kind\": \"path\", \"required\": \"true\", \"type\": \"string\", \"javaType\": \"java.lang.String\","
                         + " \"deprecated\": \"false\", \"description\": \"Name of data format\" }"));
         assertTrue(json.contains("\"operation\": { \"kind\": \"path\", \"required\": \"true\", \"type\": \"string\""));
-        assertTrue(json.contains("\"synchronous\": { \"kind\": \"parameter\", \"type\": \"boolean\""));
+        assertTrue(json.contains("\"synchronous\": { \"kind\": \"parameter\", \"label\": \"advanced\", \"type\": \"boolean\""));
     }
 
     @Test

http://git-wip-us.apache.org/repos/asf/camel/blob/6542c6d8/camel-core/src/test/java/org/apache/camel/component/dataset/DataSetComponentConfigurationAndDocumentationTest.java
----------------------------------------------------------------------
diff --git a/camel-core/src/test/java/org/apache/camel/component/dataset/DataSetComponentConfigurationAndDocumentationTest.java b/camel-core/src/test/java/org/apache/camel/component/dataset/DataSetComponentConfigurationAndDocumentationTest.java
index 7e6e2ee..dc643ca 100644
--- a/camel-core/src/test/java/org/apache/camel/component/dataset/DataSetComponentConfigurationAndDocumentationTest.java
+++ b/camel-core/src/test/java/org/apache/camel/component/dataset/DataSetComponentConfigurationAndDocumentationTest.java
@@ -43,7 +43,7 @@ public class DataSetComponentConfigurationAndDocumentationTest extends ContextTe
 
         assertTrue(json.contains("\"preloadSize\": { \"kind\": \"parameter\", \"type\": \"integer\""));
         assertTrue(json.contains("\"minRate\": { \"kind\": \"parameter\", \"type\": \"integer\""));
-        assertTrue(json.contains("\"exchangePattern\": { \"kind\": \"parameter\", \"type\": \"string\", \"javaType\": \"org.apache.camel.ExchangePattern\""
+        assertTrue(json.contains("\"exchangePattern\": { \"kind\": \"parameter\", \"label\": \"advanced\", \"type\": \"string\", \"javaType\": \"org.apache.camel.ExchangePattern\""
                 + ", \"enum\": [ \"InOnly\", \"RobustInOnly\", \"InOut\", \"InOptionalOut\", \"OutOnly\", \"RobustOutOnly\", \"OutIn\", \"OutOptionalIn\" ]"));
         assertTrue(json.contains("\"InOut\""));
     }

http://git-wip-us.apache.org/repos/asf/camel/blob/6542c6d8/camel-core/src/test/java/org/apache/camel/component/xslt/XsltComponentConfigurationAndDocumentationTest.java
----------------------------------------------------------------------
diff --git a/camel-core/src/test/java/org/apache/camel/component/xslt/XsltComponentConfigurationAndDocumentationTest.java b/camel-core/src/test/java/org/apache/camel/component/xslt/XsltComponentConfigurationAndDocumentationTest.java
index 1bd9fb8..0552c4a 100644
--- a/camel-core/src/test/java/org/apache/camel/component/xslt/XsltComponentConfigurationAndDocumentationTest.java
+++ b/camel-core/src/test/java/org/apache/camel/component/xslt/XsltComponentConfigurationAndDocumentationTest.java
@@ -42,7 +42,7 @@ public class XsltComponentConfigurationAndDocumentationTest extends ContextTestS
         assertNotNull(json);
 
         assertTrue(json.contains("\"contentCache\": { \"kind\": \"parameter\", \"type\": \"boolean\", \"javaType\": \"boolean\", \"deprecated\": \"false\", \"defaultValue\": \"true\""));
-        assertTrue(json.contains("\"synchronous\": { \"kind\": \"parameter\", \"type\": \"boolean\""));
+        assertTrue(json.contains("\"synchronous\": { \"kind\": \"parameter\", \"label\": \"advanced\", \"type\": \"boolean\""));
     }
 
     @Test


[3/5] camel git commit: CAMEL-9119: xslt should throw exception if error/fatal parsing xslt source. Fixed some invalid xsl files which is now reported as errors.

Posted by da...@apache.org.
CAMEL-9119: xslt should throw exception if error/fatal parsing xslt source. Fixed some invalid xsl files which is now reported as errors.


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/c34d1aaf
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/c34d1aaf
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/c34d1aaf

Branch: refs/heads/master
Commit: c34d1aaf535123e6fc13b22ab9a2b0590558f22c
Parents: 6542c6d
Author: Claus Ibsen <da...@apache.org>
Authored: Wed Sep 16 13:32:35 2015 +0200
Committer: Claus Ibsen <da...@apache.org>
Committed: Wed Sep 16 13:32:35 2015 +0200

----------------------------------------------------------------------
 .../resources/org/apache/camel/component/xslt/staff_include.xsl    | 2 +-
 .../org/apache/camel/component/xslt/staff_include_classpath.xsl    | 2 +-
 .../org/apache/camel/component/xslt/staff_include_classpath2.xsl   | 2 +-
 .../org/apache/camel/component/xslt/staff_include_relative.xsl     | 2 +-
 .../apache/camel/component/xslt/staff_include_relative_other.xsl   | 2 +-
 camel-core/src/test/resources/xslt/staff/staff.xsl                 | 2 +-
 6 files changed, 6 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/c34d1aaf/camel-core/src/test/resources/org/apache/camel/component/xslt/staff_include.xsl
----------------------------------------------------------------------
diff --git a/camel-core/src/test/resources/org/apache/camel/component/xslt/staff_include.xsl b/camel-core/src/test/resources/org/apache/camel/component/xslt/staff_include.xsl
index 3991d81..2200329 100644
--- a/camel-core/src/test/resources/org/apache/camel/component/xslt/staff_include.xsl
+++ b/camel-core/src/test/resources/org/apache/camel/component/xslt/staff_include.xsl
@@ -19,7 +19,7 @@
 
     <xsl:include href="file:src/test/resources/org/apache/camel/component/xslt/staff_template.xsl"/>
 
-    <xsl:template match="staff/programmer">
+    <xsl:template match="staff/programmer" priority="2">
         <html>
             <body>
                 <xsl:apply-templates select="name"/>

http://git-wip-us.apache.org/repos/asf/camel/blob/c34d1aaf/camel-core/src/test/resources/org/apache/camel/component/xslt/staff_include_classpath.xsl
----------------------------------------------------------------------
diff --git a/camel-core/src/test/resources/org/apache/camel/component/xslt/staff_include_classpath.xsl b/camel-core/src/test/resources/org/apache/camel/component/xslt/staff_include_classpath.xsl
index 87ebb55..5374d04 100644
--- a/camel-core/src/test/resources/org/apache/camel/component/xslt/staff_include_classpath.xsl
+++ b/camel-core/src/test/resources/org/apache/camel/component/xslt/staff_include_classpath.xsl
@@ -19,7 +19,7 @@
 
     <xsl:include href="classpath:org/apache/camel/component/xslt/staff_template.xsl"/>
 
-    <xsl:template match="staff/programmer">
+    <xsl:template match="staff/programmer" priority="2">
         <html>
             <body>
                 <xsl:apply-templates select="name"/>

http://git-wip-us.apache.org/repos/asf/camel/blob/c34d1aaf/camel-core/src/test/resources/org/apache/camel/component/xslt/staff_include_classpath2.xsl
----------------------------------------------------------------------
diff --git a/camel-core/src/test/resources/org/apache/camel/component/xslt/staff_include_classpath2.xsl b/camel-core/src/test/resources/org/apache/camel/component/xslt/staff_include_classpath2.xsl
index 5098ece..082f54f 100644
--- a/camel-core/src/test/resources/org/apache/camel/component/xslt/staff_include_classpath2.xsl
+++ b/camel-core/src/test/resources/org/apache/camel/component/xslt/staff_include_classpath2.xsl
@@ -20,7 +20,7 @@
     <!-- test with a directory from classpath that has dot in the name -->
     <xsl:include href="staff_template.xsl"/>
 
-    <xsl:template match="staff/programmer">
+    <xsl:template match="staff/programmer" priority="2">
         <html>
             <body>
                 <xsl:apply-templates select="name"/>

http://git-wip-us.apache.org/repos/asf/camel/blob/c34d1aaf/camel-core/src/test/resources/org/apache/camel/component/xslt/staff_include_relative.xsl
----------------------------------------------------------------------
diff --git a/camel-core/src/test/resources/org/apache/camel/component/xslt/staff_include_relative.xsl b/camel-core/src/test/resources/org/apache/camel/component/xslt/staff_include_relative.xsl
index afaf24d..2f19728 100644
--- a/camel-core/src/test/resources/org/apache/camel/component/xslt/staff_include_relative.xsl
+++ b/camel-core/src/test/resources/org/apache/camel/component/xslt/staff_include_relative.xsl
@@ -19,7 +19,7 @@
 
     <xsl:include href="staff_template.xsl"/>
 
-    <xsl:template match="staff/programmer">
+    <xsl:template match="staff/programmer" priority="2">
         <html>
             <body>
                 <xsl:apply-templates select="name"/>

http://git-wip-us.apache.org/repos/asf/camel/blob/c34d1aaf/camel-core/src/test/resources/org/apache/camel/component/xslt/staff_include_relative_other.xsl
----------------------------------------------------------------------
diff --git a/camel-core/src/test/resources/org/apache/camel/component/xslt/staff_include_relative_other.xsl b/camel-core/src/test/resources/org/apache/camel/component/xslt/staff_include_relative_other.xsl
index 312fa7b..8a4e1b1 100644
--- a/camel-core/src/test/resources/org/apache/camel/component/xslt/staff_include_relative_other.xsl
+++ b/camel-core/src/test/resources/org/apache/camel/component/xslt/staff_include_relative_other.xsl
@@ -19,7 +19,7 @@
 
     <xsl:include href="../staff_other_template.xsl"/>
 
-    <xsl:template match="staff/programmer">
+    <xsl:template match="staff/programmer" priority="2">
         <html>
             <body>
                 <xsl:apply-templates select="age"/>

http://git-wip-us.apache.org/repos/asf/camel/blob/c34d1aaf/camel-core/src/test/resources/xslt/staff/staff.xsl
----------------------------------------------------------------------
diff --git a/camel-core/src/test/resources/xslt/staff/staff.xsl b/camel-core/src/test/resources/xslt/staff/staff.xsl
index 4316c3f..4bb9e8d 100644
--- a/camel-core/src/test/resources/xslt/staff/staff.xsl
+++ b/camel-core/src/test/resources/xslt/staff/staff.xsl
@@ -19,7 +19,7 @@
 
     <xsl:include href="../common/staff_template.xsl"/>
 
-    <xsl:template match="staff/programmer">
+    <xsl:template match="staff/programmer" priority="2">
         <html>
             <body>
                 <xsl:apply-templates select="name"/>


[5/5] camel git commit: CAMEL-9097: Move test to camel-saxon

Posted by da...@apache.org.
CAMEL-9097: Move test to camel-saxon


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/eeb09c82
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/eeb09c82
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/eeb09c82

Branch: refs/heads/master
Commit: eeb09c8277e2e520dcc7322a1f334560acd185c1
Parents: 717a42d
Author: Claus Ibsen <da...@apache.org>
Authored: Wed Sep 16 14:48:15 2015 +0200
Committer: Claus Ibsen <da...@apache.org>
Committed: Wed Sep 16 14:48:15 2015 +0200

----------------------------------------------------------------------
 camel-core/pom.xml                              |  7 --
 .../toolbox/XsltAggregationStrategyTest.java    | 74 --------------------
 .../util/toolbox/aggregate-user-property.xsl    | 32 ---------
 .../org/apache/camel/util/toolbox/aggregate.xsl | 32 ---------
 .../org/apache/camel/util/toolbox/data1.xml     | 18 -----
 .../org/apache/camel/util/toolbox/data2.xml     | 18 -----
 .../org/apache/camel/util/toolbox/data3.xml     | 18 -----
 .../toolbox/XsltAggregationStrategyTest.java    | 74 ++++++++++++++++++++
 .../util/toolbox/aggregate-user-property.xsl    | 32 +++++++++
 .../org/apache/camel/util/toolbox/aggregate.xsl | 32 +++++++++
 .../org/apache/camel/util/toolbox/data1.xml     | 18 +++++
 .../org/apache/camel/util/toolbox/data2.xml     | 18 +++++
 .../org/apache/camel/util/toolbox/data3.xml     | 18 +++++
 13 files changed, 192 insertions(+), 199 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/eeb09c82/camel-core/pom.xml
----------------------------------------------------------------------
diff --git a/camel-core/pom.xml b/camel-core/pom.xml
index 5817dee..0152138 100644
--- a/camel-core/pom.xml
+++ b/camel-core/pom.xml
@@ -169,13 +169,6 @@
       <scope>test</scope>
     </dependency>
 
-    <!-- for xslt tests -->
-    <dependency>
-      <groupId>net.sf.saxon</groupId>
-      <artifactId>Saxon-HE</artifactId>
-      <scope>test</scope>
-    </dependency>
-
     <!-- validator -->
     <dependency>
       <groupId>xml-resolver</groupId>

http://git-wip-us.apache.org/repos/asf/camel/blob/eeb09c82/camel-core/src/test/java/org/apache/camel/util/toolbox/XsltAggregationStrategyTest.java
----------------------------------------------------------------------
diff --git a/camel-core/src/test/java/org/apache/camel/util/toolbox/XsltAggregationStrategyTest.java b/camel-core/src/test/java/org/apache/camel/util/toolbox/XsltAggregationStrategyTest.java
deleted file mode 100644
index da5bf67..0000000
--- a/camel-core/src/test/java/org/apache/camel/util/toolbox/XsltAggregationStrategyTest.java
+++ /dev/null
@@ -1,74 +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.util.toolbox;
-
-import org.apache.camel.ContextTestSupport;
-import org.apache.camel.builder.RouteBuilder;
-import org.apache.camel.component.mock.MockEndpoint;
-import org.junit.Test;
-
-/**
- * Unit test for the {@link XsltAggregationStrategy}.
- * <p>
- * Need to use Saxon to get a predictable result: we cannot rely on the JDK's XSLT processor as it can vary across
- * platforms and JDK versions. Also, Xalan does not handle node-set properties well.
- */
-public class XsltAggregationStrategyTest extends ContextTestSupport {
-
-    @Test
-    public void testXsltAggregationDefaultProperty() throws Exception {
-        context.startRoute("route1");
-        MockEndpoint mock = getMockEndpoint("mock:transformed");
-        mock.expectedMessageCount(1);
-        mock.expectedBodiesReceived("<?xml version=\"1.0\" encoding=\"UTF-8\"?><item>ABC</item>");
-        assertMockEndpointsSatisfied();
-    }
-
-    @Test
-    public void testXsltAggregationUserProperty() throws Exception {
-        context.startRoute("route2");
-        MockEndpoint mock = getMockEndpoint("mock:transformed");
-        mock.expectedMessageCount(1);
-        mock.expectedBodiesReceived("<?xml version=\"1.0\" encoding=\"UTF-8\"?><item>ABC</item>");
-        assertMockEndpointsSatisfied();
-    }
-
-    protected RouteBuilder createRouteBuilder() throws Exception {
-        return new RouteBuilder() {
-            @Override
-            public void configure() throws Exception {
-                from("file:src/test/resources/org/apache/camel/util/toolbox?noop=true&antInclude=*.xml")
-                        .routeId("route1").noAutoStartup()
-                        .aggregate(new XsltAggregationStrategy("org/apache/camel/util/toolbox/aggregate.xsl")
-                                .withSaxon())
-                        .constant(true)
-                        .completionFromBatchConsumer()
-                    .log("after aggregate body: ${body}")
-                    .to("mock:transformed");
-
-                from("file:src/test/resources/org/apache/camel/util/toolbox?noop=true&antInclude=*.xml")
-                        .routeId("route2").noAutoStartup()
-                        .aggregate(new XsltAggregationStrategy("org/apache/camel/util/toolbox/aggregate-user-property.xsl")
-                                .withSaxon().withPropertyName("user-property"))
-                        .constant(true)
-                        .completionFromBatchConsumer()
-                        .log("after aggregate body: ${body}")
-                        .to("mock:transformed");
-            }
-        };
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/camel/blob/eeb09c82/camel-core/src/test/resources/org/apache/camel/util/toolbox/aggregate-user-property.xsl
----------------------------------------------------------------------
diff --git a/camel-core/src/test/resources/org/apache/camel/util/toolbox/aggregate-user-property.xsl b/camel-core/src/test/resources/org/apache/camel/util/toolbox/aggregate-user-property.xsl
deleted file mode 100644
index 74bdd85..0000000
--- a/camel-core/src/test/resources/org/apache/camel/util/toolbox/aggregate-user-property.xsl
+++ /dev/null
@@ -1,32 +0,0 @@
-<?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.
--->
-<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
-
-    <xsl:output method="xml" indent="no"/>
-    <xsl:strip-space elements="*"/>
-
-    <xsl:param name="user-property" />
-
-    <xsl:template match="/">
-        <item>
-            <xsl:value-of select="."/>
-            <xsl:value-of select="$user-property/item"/>
-        </item>
-    </xsl:template>
-
-</xsl:stylesheet>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/camel/blob/eeb09c82/camel-core/src/test/resources/org/apache/camel/util/toolbox/aggregate.xsl
----------------------------------------------------------------------
diff --git a/camel-core/src/test/resources/org/apache/camel/util/toolbox/aggregate.xsl b/camel-core/src/test/resources/org/apache/camel/util/toolbox/aggregate.xsl
deleted file mode 100644
index 8d20385..0000000
--- a/camel-core/src/test/resources/org/apache/camel/util/toolbox/aggregate.xsl
+++ /dev/null
@@ -1,32 +0,0 @@
-<?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.
--->
-<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
-
-    <xsl:output method="xml" indent="no"/>
-    <xsl:strip-space elements="*"/>
-
-    <xsl:param name="new-exchange" />
-
-    <xsl:template match="/">
-        <item>
-            <xsl:value-of select="."/>
-            <xsl:value-of select="$new-exchange/item"/>
-        </item>
-    </xsl:template>
-
-</xsl:stylesheet>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/camel/blob/eeb09c82/camel-core/src/test/resources/org/apache/camel/util/toolbox/data1.xml
----------------------------------------------------------------------
diff --git a/camel-core/src/test/resources/org/apache/camel/util/toolbox/data1.xml b/camel-core/src/test/resources/org/apache/camel/util/toolbox/data1.xml
deleted file mode 100644
index be8cd6d..0000000
--- a/camel-core/src/test/resources/org/apache/camel/util/toolbox/data1.xml
+++ /dev/null
@@ -1,18 +0,0 @@
-<?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.
--->
-<item>A</item>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/camel/blob/eeb09c82/camel-core/src/test/resources/org/apache/camel/util/toolbox/data2.xml
----------------------------------------------------------------------
diff --git a/camel-core/src/test/resources/org/apache/camel/util/toolbox/data2.xml b/camel-core/src/test/resources/org/apache/camel/util/toolbox/data2.xml
deleted file mode 100644
index 3d3d463..0000000
--- a/camel-core/src/test/resources/org/apache/camel/util/toolbox/data2.xml
+++ /dev/null
@@ -1,18 +0,0 @@
-<?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.
--->
-<item>B</item>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/camel/blob/eeb09c82/camel-core/src/test/resources/org/apache/camel/util/toolbox/data3.xml
----------------------------------------------------------------------
diff --git a/camel-core/src/test/resources/org/apache/camel/util/toolbox/data3.xml b/camel-core/src/test/resources/org/apache/camel/util/toolbox/data3.xml
deleted file mode 100644
index 9182bcb..0000000
--- a/camel-core/src/test/resources/org/apache/camel/util/toolbox/data3.xml
+++ /dev/null
@@ -1,18 +0,0 @@
-<?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.
--->
-<item>C</item>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/camel/blob/eeb09c82/components/camel-saxon/src/test/java/org/apache/camel/util/toolbox/XsltAggregationStrategyTest.java
----------------------------------------------------------------------
diff --git a/components/camel-saxon/src/test/java/org/apache/camel/util/toolbox/XsltAggregationStrategyTest.java b/components/camel-saxon/src/test/java/org/apache/camel/util/toolbox/XsltAggregationStrategyTest.java
new file mode 100644
index 0000000..7ad2ab6
--- /dev/null
+++ b/components/camel-saxon/src/test/java/org/apache/camel/util/toolbox/XsltAggregationStrategyTest.java
@@ -0,0 +1,74 @@
+/**
+ * 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.util.toolbox;
+
+import org.apache.camel.builder.RouteBuilder;
+import org.apache.camel.component.mock.MockEndpoint;
+import org.apache.camel.test.junit4.CamelTestSupport;
+import org.junit.Test;
+
+/**
+ * Unit test for the {@link XsltAggregationStrategy}.
+ * <p>
+ * Need to use Saxon to get a predictable result: we cannot rely on the JDK's XSLT processor as it can vary across
+ * platforms and JDK versions. Also, Xalan does not handle node-set properties well.
+ */
+public class XsltAggregationStrategyTest extends CamelTestSupport {
+
+    @Test
+    public void testXsltAggregationDefaultProperty() throws Exception {
+        context.startRoute("route1");
+        MockEndpoint mock = getMockEndpoint("mock:transformed");
+        mock.expectedMessageCount(1);
+        mock.expectedBodiesReceived("<?xml version=\"1.0\" encoding=\"UTF-8\"?><item>ABC</item>");
+        assertMockEndpointsSatisfied();
+    }
+
+    @Test
+    public void testXsltAggregationUserProperty() throws Exception {
+        context.startRoute("route2");
+        MockEndpoint mock = getMockEndpoint("mock:transformed");
+        mock.expectedMessageCount(1);
+        mock.expectedBodiesReceived("<?xml version=\"1.0\" encoding=\"UTF-8\"?><item>ABC</item>");
+        assertMockEndpointsSatisfied();
+    }
+
+    protected RouteBuilder createRouteBuilder() throws Exception {
+        return new RouteBuilder() {
+            @Override
+            public void configure() throws Exception {
+                from("file:src/test/resources/org/apache/camel/util/toolbox?noop=true&antInclude=*.xml")
+                        .routeId("route1").noAutoStartup()
+                        .aggregate(new XsltAggregationStrategy("org/apache/camel/util/toolbox/aggregate.xsl")
+                                .withSaxon())
+                        .constant(true)
+                        .completionFromBatchConsumer()
+                        .log("after aggregate body: ${body}")
+                        .to("mock:transformed");
+
+                from("file:src/test/resources/org/apache/camel/util/toolbox?noop=true&antInclude=*.xml")
+                        .routeId("route2").noAutoStartup()
+                        .aggregate(new XsltAggregationStrategy("org/apache/camel/util/toolbox/aggregate-user-property.xsl")
+                                .withSaxon().withPropertyName("user-property"))
+                        .constant(true)
+                        .completionFromBatchConsumer()
+                        .log("after aggregate body: ${body}")
+                        .to("mock:transformed");
+            }
+        };
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/camel/blob/eeb09c82/components/camel-saxon/src/test/resources/org/apache/camel/util/toolbox/aggregate-user-property.xsl
----------------------------------------------------------------------
diff --git a/components/camel-saxon/src/test/resources/org/apache/camel/util/toolbox/aggregate-user-property.xsl b/components/camel-saxon/src/test/resources/org/apache/camel/util/toolbox/aggregate-user-property.xsl
new file mode 100644
index 0000000..74bdd85
--- /dev/null
+++ b/components/camel-saxon/src/test/resources/org/apache/camel/util/toolbox/aggregate-user-property.xsl
@@ -0,0 +1,32 @@
+<?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.
+-->
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+
+    <xsl:output method="xml" indent="no"/>
+    <xsl:strip-space elements="*"/>
+
+    <xsl:param name="user-property" />
+
+    <xsl:template match="/">
+        <item>
+            <xsl:value-of select="."/>
+            <xsl:value-of select="$user-property/item"/>
+        </item>
+    </xsl:template>
+
+</xsl:stylesheet>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/camel/blob/eeb09c82/components/camel-saxon/src/test/resources/org/apache/camel/util/toolbox/aggregate.xsl
----------------------------------------------------------------------
diff --git a/components/camel-saxon/src/test/resources/org/apache/camel/util/toolbox/aggregate.xsl b/components/camel-saxon/src/test/resources/org/apache/camel/util/toolbox/aggregate.xsl
new file mode 100644
index 0000000..8d20385
--- /dev/null
+++ b/components/camel-saxon/src/test/resources/org/apache/camel/util/toolbox/aggregate.xsl
@@ -0,0 +1,32 @@
+<?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.
+-->
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+
+    <xsl:output method="xml" indent="no"/>
+    <xsl:strip-space elements="*"/>
+
+    <xsl:param name="new-exchange" />
+
+    <xsl:template match="/">
+        <item>
+            <xsl:value-of select="."/>
+            <xsl:value-of select="$new-exchange/item"/>
+        </item>
+    </xsl:template>
+
+</xsl:stylesheet>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/camel/blob/eeb09c82/components/camel-saxon/src/test/resources/org/apache/camel/util/toolbox/data1.xml
----------------------------------------------------------------------
diff --git a/components/camel-saxon/src/test/resources/org/apache/camel/util/toolbox/data1.xml b/components/camel-saxon/src/test/resources/org/apache/camel/util/toolbox/data1.xml
new file mode 100644
index 0000000..be8cd6d
--- /dev/null
+++ b/components/camel-saxon/src/test/resources/org/apache/camel/util/toolbox/data1.xml
@@ -0,0 +1,18 @@
+<?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.
+-->
+<item>A</item>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/camel/blob/eeb09c82/components/camel-saxon/src/test/resources/org/apache/camel/util/toolbox/data2.xml
----------------------------------------------------------------------
diff --git a/components/camel-saxon/src/test/resources/org/apache/camel/util/toolbox/data2.xml b/components/camel-saxon/src/test/resources/org/apache/camel/util/toolbox/data2.xml
new file mode 100644
index 0000000..3d3d463
--- /dev/null
+++ b/components/camel-saxon/src/test/resources/org/apache/camel/util/toolbox/data2.xml
@@ -0,0 +1,18 @@
+<?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.
+-->
+<item>B</item>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/camel/blob/eeb09c82/components/camel-saxon/src/test/resources/org/apache/camel/util/toolbox/data3.xml
----------------------------------------------------------------------
diff --git a/components/camel-saxon/src/test/resources/org/apache/camel/util/toolbox/data3.xml b/components/camel-saxon/src/test/resources/org/apache/camel/util/toolbox/data3.xml
new file mode 100644
index 0000000..9182bcb
--- /dev/null
+++ b/components/camel-saxon/src/test/resources/org/apache/camel/util/toolbox/data3.xml
@@ -0,0 +1,18 @@
+<?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.
+-->
+<item>C</item>
\ No newline at end of file


[4/5] camel git commit: CAMEL-9131: Add more labels to endpoint/component options.

Posted by da...@apache.org.
CAMEL-9131: Add more labels to endpoint/component options.


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/717a42d5
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/717a42d5
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/717a42d5

Branch: refs/heads/master
Commit: 717a42d5a3a5d148b11562618a26c561beb93a1e
Parents: c34d1aa
Author: Claus Ibsen <da...@apache.org>
Authored: Wed Sep 16 14:01:16 2015 +0200
Committer: Claus Ibsen <da...@apache.org>
Committed: Wed Sep 16 14:01:16 2015 +0200

----------------------------------------------------------------------
 .../file/FileComponentConfigurationAndDocumentationTest.java       | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/717a42d5/camel-core/src/test/java/org/apache/camel/component/file/FileComponentConfigurationAndDocumentationTest.java
----------------------------------------------------------------------
diff --git a/camel-core/src/test/java/org/apache/camel/component/file/FileComponentConfigurationAndDocumentationTest.java b/camel-core/src/test/java/org/apache/camel/component/file/FileComponentConfigurationAndDocumentationTest.java
index fd2355a..65c67a9 100644
--- a/camel-core/src/test/java/org/apache/camel/component/file/FileComponentConfigurationAndDocumentationTest.java
+++ b/camel-core/src/test/java/org/apache/camel/component/file/FileComponentConfigurationAndDocumentationTest.java
@@ -42,7 +42,7 @@ public class FileComponentConfigurationAndDocumentationTest extends ContextTestS
         assertNotNull(json);
 
         assertTrue(json.contains("\"doneFileName\": { \"kind\": \"parameter\", \"label\": \"producer\", \"type\": \"string\""));
-        assertTrue(json.contains("\"exclude\": { \"kind\": \"parameter\", \"label\": \"consumer\", \"type\": \"string\""));
+        assertTrue(json.contains("\"exclude\": { \"kind\": \"parameter\", \"label\": \"consumer,filter\", \"type\": \"string\""));
         assertTrue(json.contains("\"delete\": { \"kind\": \"parameter\", \"label\": \"consumer\", \"type\": \"boolean\""));
     }