No Class found error while running Test Case for Jenkins plugin

18 views
Skip to first unread message

chirag shah

unread,
Dec 19, 2017, 3:22:23 PM12/19/17
to Jenkins Developers
Hi,

I am developing test cases for one of my plugin.  Below is snipped code of test case:
     
 JenkinsRule.WebClient webClient=rule.createWebClient();
       
FreeStyleProject p = (FreeStyleProject) rule.jenkins.getItem("WebApp");
         
     
HtmlPage page=  webClient.getPage(p,"configure");

.
I am always getting java.lang.NoClassDefFoundError: Could not initialize class com.gargoylesoftware.htmlunit.util.EncodingSniffer . I have checked dependency jenkins-test-harness-htmlunit and it has same class.

I am having below jenkins and jenkins-test-harness version in my plugin:



   
<properties>
       
<jenkins.version>2.7.3</jenkins.version>
       
<java.level>8</java.level>
       
   
<jenkins-test-harness.version>2.27</jenkins-test-harness.version>
   
</properties>

Please help me if anybody has solution for it

Oleg Nenashev

unread,
Dec 26, 2017, 9:38:49 AM12/26/17
to Jenkins Developers
Is there a need to explicitly specify the Jenkins Test Harness version in your pom.xml?
I'd guess there is a version mismatch in the build due to that. So I would recommend to start from removing "<jenkins-test-harness.version>2.27</jenkins-test-harness.version>" and re-running the build.

вторник, 19 декабря 2017 г., 21:22:23 UTC+1 пользователь chirag shah написал:
Reply all
Reply to author
Forward
0 new messages