Hello Pavel,

as Jenkins uses Maven, you should be able to override the version by
standard Maven means:
* Exclude the htmlunit stuff from the test-harness
* Then add the versions you want.

    <dependencies>
        <dependency>
            <groupId>org.jenkins-ci.main</groupId>
            <artifactId>jenkins-test-harness</artifactId>
            <version>${project.parent.version}</version>
            <scope>test</scope>
            <exclusions>
                <exclusion>
                    <groupId>org.jenkins-ci</groupId>
                    <artifactId>htmlunit</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.jvnet.hudson</groupId>
                    <artifactId>htmlunit-core-js</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>net.sourceforge.htmlunit</groupId>
            <artifactId>htmlunit</artifactId>
            <version>2.15</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>net.sourceforge.htmlunit</groupId>
            <artifactId>htmlunit-core-js</artifactId>
            <version>2.15</version>
            <scope>test</scope>
        </dependency>
    </dependencies>



Regards Mirko
--
http://illegalstateexception.blogspot.com/
https://github.com/mfriedenhagen/ (http://osrc.dfm.io/mfriedenhagen)
https://bitbucket.org/mfriedenhagen/


On Tue, Dec 2, 2014 at 10:08 AM, Pavel Baranchikov
<[email protected]> wrote:
> Hello,
>
> Jenkins has its own HtmlUnit module, that is downloaded throught Maven as
> dependency to jenkins test harness. But the module is rather old - as I
> understand it is of version 2.6 instead of 2.15 version of the original
> HtmlUnit.
>
> This prevents me from testing my Html (with JavaScript)
>
> Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 19.895 sec
> <<< FAILURE! - in hudson.plugins.git.ui.ChangeSetListTest
> test1(hudson.plugins.git.ui.ChangeSetListTest)  Time elapsed: 17.864 sec
> <<< ERROR!
> com.gargoylesoftware.htmlunit.ScriptException: TypeError: Cannot find
> function querySelectorAll in object [object HTMLDocument]. (script in
> http://localhost:48448/job/test0/1/ from (45, 21) to (65, 14)#47)
>         at
> net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3652)
>         at
> net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3630)
>         at
> net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.typeError(ScriptRuntime.java:3658)
>         at
> net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.typeError2(ScriptRuntime.java:3677)
>         at
> net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.notFunctionError(ScriptRuntime.java:3741)
>         at
> net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.getPropFunctionAndThisHelper(ScriptRuntime.java:2249)
>         at
> net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.getPropFunctionAndThis(ScriptRuntime.java:2216)
>
>
> The method querySelectorAll() support has been added since 2.9 according to
> http://htmlunit.sourceforge.net/changes-report.html
>
> Is there a way to correctly replace HtmlUnit to the new version locally in
> my plugin's project?
> Are there plans to renew Jenkins-shipped version of HtmlUnit?
>
> --
> You received this message because you are subscribed to the Google Groups
> "Jenkins Developers" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/jenkinsci-dev/7daee6cd-a658-4676-aa3d-0d58c789ba59%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-dev/CAK8jvqzp_5%2BZenTn5wjCVDeCT6o6Q_CvLGcq%2BrGJCN-yH5i1pQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to