You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ja...@apache.org on 2008/09/29 14:22:32 UTC
svn commit: r700090 -
/activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/builder/xml/XPathTest.java
Author: janstey
Date: Mon Sep 29 05:22:32 2008
New Revision: 700090
URL: http://svn.apache.org/viewvc?rev=700090&view=rev
Log:
CAMEL-939 - Seems that XPathTest.testUsingJavaExtensions was supposed to be
ignored if Xalan was not on the classpath. I'm changing the test so that it is
ignored correctly in this case.
Modified:
activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/builder/xml/XPathTest.java
Modified: activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/builder/xml/XPathTest.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/builder/xml/XPathTest.java?rev=700090&r1=700089&r2=700090&view=diff
==============================================================================
--- activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/builder/xml/XPathTest.java (original)
+++ activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/builder/xml/XPathTest.java Mon Sep 29 05:22:32 2008
@@ -56,19 +56,19 @@
// we may not have Xalan on the classpath
try {
instance = Class.forName("org.apache.xalan.extensions.XPathFunctionResolverImpl").newInstance();
+
+ if (instance instanceof XPathFunctionResolver) {
+ XPathFunctionResolver functionResolver = (XPathFunctionResolver)instance;
+
+ XPathBuilder builder = xpath("java:" + getClass().getName() + ".func(string(/header/value))").namespace("java", "http://xml.apache.org/xalan/java").functionResolver(functionResolver);
+
+ String xml = "<header><value>12</value></header>";
+ Object value = assertExpression(builder, xml, "modified12");
+ log.debug("Evaluated xpath: " + builder.getText() + " on XML: " + xml + " result: " + value);
+ }
} catch (Throwable e) {
log.debug("Could not find Xalan on the classpath so ignoring this test case: " + e);
}
-
- if (instance instanceof XPathFunctionResolver) {
- XPathFunctionResolver functionResolver = (XPathFunctionResolver)instance;
-
- XPathBuilder builder = xpath("java:" + getClass().getName() + ".func(string(/header/value))").namespace("java", "http://xml.apache.org/xalan/java").functionResolver(functionResolver);
-
- String xml = "<header><value>12</value></header>";
- Object value = assertExpression(builder, xml, "modified12");
- log.debug("Evaluated xpath: " + builder.getText() + " on XML: " + xml + " result: " + value);
- }
}
public static String func(String s) {