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 2018/01/12 13:23:19 UTC
[camel] branch master updated: CAMEL-11599: XPath with Saxon should
load Saxon using their preferred way.
This is an automated email from the ASF dual-hosted git repository.
davsclaus pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git
The following commit(s) were added to refs/heads/master by this push:
new 8947203 CAMEL-11599: XPath with Saxon should load Saxon using their preferred way.
8947203 is described below
commit 8947203d572676797d07a3a1a47286e87aaa0a58
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Fri Jan 12 14:23:12 2018 +0100
CAMEL-11599: XPath with Saxon should load Saxon using their preferred way.
---
.../apache/camel/itest/CamelSaxonEnabledTest.java | 59 ++++++++++++++++++++++
...amelSaxonTest.xml => CamelSaxonEnabledTest.xml} | 0
.../org/apache/camel/itest/CamelSaxonTest.xml | 4 +-
3 files changed, 61 insertions(+), 2 deletions(-)
diff --git a/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/CamelSaxonEnabledTest.java b/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/CamelSaxonEnabledTest.java
new file mode 100644
index 0000000..59e5848
--- /dev/null
+++ b/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/CamelSaxonEnabledTest.java
@@ -0,0 +1,59 @@
+/**
+ * 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.itest;
+
+import java.net.URL;
+
+import org.apache.camel.CamelContext;
+import org.apache.camel.component.mock.MockEndpoint;
+import org.apache.camel.test.karaf.AbstractFeatureTest;
+import org.apache.camel.test.karaf.CamelKarafTestSupport;
+import org.apache.camel.util.ObjectHelper;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.ops4j.pax.exam.Configuration;
+import org.ops4j.pax.exam.Option;
+import org.ops4j.pax.exam.junit.PaxExam;
+
+@RunWith(PaxExam.class)
+public class CamelSaxonEnabledTest extends AbstractFeatureTest {
+
+ @Test
+ public void testCamelSaxonEnabled() throws Exception {
+ // install the camel blueprint xml file we use in this test
+ URL url = ObjectHelper.loadResourceAsURL("org/apache/camel/itest/CamelSaxonEnabledTest.xml", CamelSaxonEnabledTest.class.getClassLoader());
+ installBlueprintAsBundle("CamelSaxonTest", url, true);
+
+ // lookup Camel from OSGi
+ CamelContext camel = getOsgiService(bundleContext, CamelContext.class);
+
+ // test camel
+ MockEndpoint mock = camel.getEndpoint("mock:camel", MockEndpoint.class);
+ mock.expectedBodiesReceived("<name>King</name>");
+ mock.expectedHeaderReceived("type", "Camel");
+
+ camel.createProducerTemplate().sendBodyAndHeader("direct:in", "<name>King</name>", "type", "Camel");
+
+ mock.assertIsSatisfied();
+ }
+
+ @Configuration
+ public Option[] configure() {
+ return CamelKarafTestSupport.configure("camel-test-karaf", "camel-saxon");
+ }
+
+}
diff --git a/tests/camel-itest-osgi/src/test/resources/org/apache/camel/itest/CamelSaxonTest.xml b/tests/camel-itest-osgi/src/test/resources/org/apache/camel/itest/CamelSaxonEnabledTest.xml
similarity index 100%
copy from tests/camel-itest-osgi/src/test/resources/org/apache/camel/itest/CamelSaxonTest.xml
copy to tests/camel-itest-osgi/src/test/resources/org/apache/camel/itest/CamelSaxonEnabledTest.xml
diff --git a/tests/camel-itest-osgi/src/test/resources/org/apache/camel/itest/CamelSaxonTest.xml b/tests/camel-itest-osgi/src/test/resources/org/apache/camel/itest/CamelSaxonTest.xml
index dff03e5..159aa66 100644
--- a/tests/camel-itest-osgi/src/test/resources/org/apache/camel/itest/CamelSaxonTest.xml
+++ b/tests/camel-itest-osgi/src/test/resources/org/apache/camel/itest/CamelSaxonTest.xml
@@ -28,11 +28,11 @@
<from uri="direct:in"/>
<choice>
<when>
- <xpath saxon="true">$type = 'Camel'</xpath>
+ <xpath objectModel="http://saxon.sf.net/jaxp/xpath/om">$type = 'Camel'</xpath>
<to uri="mock:camel"/>
</when>
<when>
- <xpath saxon="true">//name = 'Kong'</xpath>
+ <xpath objectModel="http://saxon.sf.net/jaxp/xpath/om">//name = 'Kong'</xpath>
<to uri="mock:donkey"/>
</when>
<otherwise>
--
To stop receiving notification emails like this one, please contact
['"commits@camel.apache.org" <co...@camel.apache.org>'].