2015-02-05 21:12 GMT+03:00 <[email protected]>:
> Author: kkolinko
> Date: Thu Feb 5 18:12:31 2015
> New Revision: 1657653
>
> URL: http://svn.apache.org/r1657653
> Log:
> Fix compilation failure in a test class when using JDK 1.5.
> The XPathFactory.newInstance(String, String, ClassLoader) method is @since
> Java 1.6.
>
> From code review, the only difference between old and new methods is presence
> of the second argument,
> "com.sun.org.apache.xpath.internal.jaxp.XPathFactoryImpl". The null class
> loader is interpreted as TCCL by both methods, so there is no difference.
> This test is @Ignore'd so it is not really tested.
>
> Modified:
>
> tomcat/taglibs/standard/trunk/impl/src/test/java/org/apache/taglibs/standard/tag/common/xml/ForEachTagTest.java
> tomcat/taglibs/standard/trunk/pom.xml
>
> Modified:
> tomcat/taglibs/standard/trunk/impl/src/test/java/org/apache/taglibs/standard/tag/common/xml/ForEachTagTest.java
> URL:
> http://svn.apache.org/viewvc/tomcat/taglibs/standard/trunk/impl/src/test/java/org/apache/taglibs/standard/tag/common/xml/ForEachTagTest.java?rev=1657653&r1=1657652&r2=1657653&view=diff
> ==============================================================================
> ---
> tomcat/taglibs/standard/trunk/impl/src/test/java/org/apache/taglibs/standard/tag/common/xml/ForEachTagTest.java
> (original)
> +++
> tomcat/taglibs/standard/trunk/impl/src/test/java/org/apache/taglibs/standard/tag/common/xml/ForEachTagTest.java
> Thu Feb 5 18:12:31 2015
> @@ -218,7 +218,8 @@ public class ForEachTagTest {
> return doc;
> }
> };
> - XPathFactory factory =
> XPathFactory.newInstance(XPathFactory.DEFAULT_OBJECT_MODEL_URI,
> "com.sun.org.apache.xpath.internal.jaxp.XPathFactoryImpl", null);
> + // XPathFactory factory =
> XPathFactory.newInstance(XPathFactory.DEFAULT_OBJECT_MODEL_URI,
> "com.sun.org.apache.xpath.internal.jaxp.XPathFactoryImpl", null);
> + XPathFactory factory =
> XPathFactory.newInstance(XPathFactory.DEFAULT_OBJECT_MODEL_URI);
> System.out.println("factory.getClass() = " + factory.getClass());
> factory.setXPathVariableResolver(resolver);
> XPathExpression select = factory.newXPath().compile("$doc/root/a");
For a record,
if I enable the xpathPerformance test (by removing @Ignore annotation)
and run "mvn install" with JDK 1.6,
using 1-argument version of XPathFactory.newInstance() results in printing
[[[
Running org.apache.taglibs.standard.tag.common.xml.ForEachTagTest
factory.getClass() = class org.apache.xpath.jaxp.XPathFactoryImpl
]]]
using 3-arguments version of XPathFactory.newInstance() results in printing
[[[
Running org.apache.taglibs.standard.tag.common.xml.ForEachTagTest
factory.getClass() = class com.sun.org.apache.xpath.internal.jaxp.XPathFactoryIm
pl
]]]
So there is a difference.
At the same time, in both cases the test does not complete after
running for 1 hour. I had to abort the tests and kill java process
forked by maven/junit. So here is no difference.
A comment for @Ignore is "Takes > 20s to run", so I was prepared to
wait, but an hour is more than I expected from that comment.
Maybe reducing the size of a sample document
("newBenchmarkDocument(200000)") will help.
This is not my priority for now. I just run it as I wanted to verify
whether my code change mattered.
Best regards,
Konstantin Kolinko
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]