Hello, Mirko
It seems to be impossible to just replace HtmlUnit with a new version,
because
org.jvnet.hudson.test.HudsonTestCase.WebClient.WebClient(HudsonTestCase) uses
field BrowserVersion.FIREFOX_2, which is no longer used in HtmlUnit.
Tests in error:
FailedTest.org.jvnet.hudson.test.JellyTestSuiteBuilder$JellyTestSuite »
NoSuchField
PreBuildMergeOptionsTest.exporting:48 » NoSuchField FIREFOX_2
GitSCMTest>HudsonTestCase.runBare:296->HudsonTestCase.runTest:440-
>testConfigRoundtripURLPreserved:1229->HudsonTestCase.configRoundtrip:888-
>HudsonTestCase.createWebClient:1617 » NoSuchField
GitSCMTest>HudsonTestCase.runBare:296->HudsonTestCase.runTest:440-
>testConfigRoundtrip:1240->HudsonTestCase.configRoundtrip:888-
>HudsonTestCase.createWebClient:1617 » NoSuchField
So, new HtmlUnit substitution should make some problems, and, of
course,
should cause every existing test to fail.
-----Original Message-----
From: Mirko Friedenhagen <[email protected]>
To: [email protected] <[email protected]>
Copy:
Date : Wednesday 03 December 2014 22:44:45
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(Scri
> ptRuntime.java:3652)>
> at
>
> net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.constructError(Scri
> ptRuntime.java:3630)>
> at
>
> net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.typeError(ScriptRun
> time.java:3658)>
> at
>
> net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.typeError2(ScriptRu
> ntime.java:3677)>
> at
>
> net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.notFunctionError(Sc
> riptRuntime.java:3741)>
> at
>
> net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.getPropFunctionAndT
> hisHelper(ScriptRuntime.java:2249)>
> at
>
> net.sourceforge.htmlunit.corejs.javascript.ScriptRuntime.getPropFunctionAndT
> his(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-0d58
> c789ba59%40googlegroups.com. For more options, visit
> https://groups.google.com/d/optout.
--
Best regards,
Pavel Baranchikov
Tuesday 09 December 2014
--
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/2761025.A8bsTBA3JS%40pbaranchikov.ryazan.aleatis.lan.
For more options, visit https://groups.google.com/d/optout.