Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Junit Test From Ant--java.lang.LinkageError

Reply
Thread Tools

Junit Test From Ant--java.lang.LinkageError

 
 
Tom Koenning
Guest
Posts: n/a
 
      07-28-2003
I have a Junit test that runs fine from the command line, but when I
try to run it from Ant, it fails. I am using Junit 3.8.1, and the
exclude.properties file in Junit.jar is as follows:
#
# The list of excluded package paths for the TestCaseClassLoader
#
excluded.0=sun.*
excluded.1=com.sun.*
excluded.2=org.omg.*
excluded.3=javax.*
excluded.4=sunw.*
excluded.5=java.*
excluded.6=org.w3c.dom.*
excluded.7=org.xml.sax.*
excluded.8=net.jini.*

The path element I am using in ant is:
<path id="test.classpath" >
<pathelement location="${lib.dir}/httpunit.jar" />
<pathelement location="${lib.dir}/junit.jar" />
<pathelement location="${lib.dir}/Tidy.jar" />
<pathelement location="${lib.dir}/js.jar" />
<!-- <pathelement location="${lib.dir}/xalan.jar" /> -->
<pathelement location="${test.dir}" />
</path>

The error is:
[junit] Tests run: 1, Failures: 0, Errors: 1, Time elapsed: 0.651
sec

[junit] Testcase: testLogin(HttpUnitTest): Caused an ERROR
[junit] loader constraints violated when linking
org/xml/sax/InputSource class
[junit] java.lang.LinkageError: loader constraints violated when
linking org/xml/sax/InputSourc
class
[junit] at com.meterware.httpunit.parsing.NekoHTMLParser.pars e(NekoHTMLParser.java:41)
[junit] at com.meterware.httpunit.HTMLPage.parse(HTMLPage.jav a:244)
[junit] at com.meterware.httpunit.WebResponse.getReceivedPage (WebResponse.java:975)
[junit] at com.meterware.httpunit.WebResponse$Scriptable.load (WebResponse.java:577)
[junit] at com.meterware.httpunit.javascript.JavaScript$Windo w.initialize(JavaScript.java:4
9)
[junit] at com.meterware.httpunit.javascript.JavaScript.run(J avaScript.java:80)
[junit] at com.meterware.httpunit.javascript.JavaScriptEngine Factory.associate(JavaScriptEn
ineFactory.java:46)
[junit] at com.meterware.httpunit.FrameHolder.<init>(FrameHol der.java:44)
[junit] at com.meterware.httpunit.WebWindow.<init>(WebWindow. java:21
[junit] at com.meterware.httpunit.WebClient.<init>(WebClient. java:51)
[junit] at com.meterware.httpunit.WebConversation.<init>(WebC onversation.java:46)
[junit] at HttpUnitTest.testLogin(Unknown Source)


[junit] TEST HttpUnitTest FAILED

Any suggestions are greatly appreciated.

Thanks, Tom K
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Error when using junit to test dnsjava related code. eelco.batterink@gmail.com Java 0 06-03-2005 10:12 AM
JUnit - how to test application Rafal Majda Java 2 04-11-2005 10:04 AM
Using JUnit to test privately contained List? kk_oop@yahoo.com Java 14 03-02-2005 07:30 PM
Where to put JUnit test cases? Ken Java 2 07-16-2004 04:02 AM
test test test test test test test Computer Support 2 07-02-2003 06:02 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57