Hi Roger,
[Note: I solved the problem midway through this message. Read only if
you're curious about what happened.]
I do something similar to pull in my project-specific JARs, too.
However, I have to have junit.jar in ant/lib or on the CLASSPATH,
otherwise the <junit> task fails to be created by Ant. Does this make
sense? I do see, however, that I should be able to put the XML
parser/generator in the <classpath> subtask. I'll try that out.
While I'd like to keep ant/lib to a bare minimum, that's not really a
*problem*. The problem is that I need to use weblogic.jar during my
tests, but it contains an XML parser that causes problems during my
tests as the application uses an XML parser too. I get the following
exceptions for any tests that try to do XML parsing (validation rules
for commons-validator, parsed using commons-digester):
java.lang.LinkageError: loader constraints violated when linking
org/xml/sax/DTDHandler class
at
org.apache.commons.digester.Digester.getXMLReader(Digester.java:895)
at org.apache.commons.digester.Digester.parse(Digester.java:1514)
at
org.apache.commons.validator.ValidatorResourcesInitializer.initialize(Va
lidatorResourcesInitializer.java:259)
at dd.bl.ValidateEntityBLO.lookupValidatorResources(Unknown Source)
at dd.bl.ValidateEntityBLO.validate(Unknown Source)
at dd.bl.ValidateEntityBLO.set(Unknown Source)
at dd.bl.identity.User.setGender(User.java:1132)
at
dd.bl.identity.cis.TestUserValidation.testValidGender(TestUserValidation
.java:61)
Holy shit! Sorry, but I just played with it a little and somehow got it
to work. I've never had fork="yes" work, but I just got it working
(added optional.jar and crimson.jar to classpath of junit task) and not
only did fork work, but now I don't get the loader constraints. It must
have been the other JARs in ant/lib (xmlParserAPIs.jar, xml-apis.jar, or
xercesImpl.jar).
Anyway, ignore this message now. Thanks for your help. Something you
said must have pointed me in the right direction. Cool.
David Harkness
Sony Pictures Digital Networks
(310) 482-4756
-----Original Message-----
From: Roger Wegner [mailto:[EMAIL PROTECTED]
Sent: Thursday, August 07, 2003 2:55 AM
To: [EMAIL PROTECTED]
Subject: Re: [Xdoclet-user] Newbie : J2EE classes error
Hi David,
I did my junit / junitreport stuff this way:
<!-- junittest -->
<target name="junittest" depends="init">
<junit printsummary ="on"
fork ="yes"
haltonerror ="off"
haltonfailure="off"
filtertrace ="off">
<classpath>
<fileset dir="${dir.common.lib}">
<patternset refid="pset.all.jar.rec"/>
</fileset>
<fileset dir="${dir.jboss.client}">
<patternset refid="pset.all.jar.rec"/>
</fileset>
<pathelement location="${dir.project.dst}"/>
</classpath>
<formatter type="xml"/>
<test name="de.xxx.yyy.JUnitTestAll"
todir="${dir.project.log}">
</test>
</junit>
</target>
<!-- junitreport -->
<target name="junitreport" depends="junittest">
<junitreport todir="${dir.project.log}">
<fileset dir="${dir.project.log}">
<include name="TEST-*.xml"/>
</fileset>
<report todir ="${dir.project.log}"
format ="noframes"
styledir="${basedir}/xsl"/>
</junitreport>
<exec executable="c:/Program Files/xxx/yyy/netscape/netscp.exe">
<arg
line="file:///D:/data/xxx.yyy/log/junit-noframes.html"/>
</exec>
</target>
where pset.all.jar.rec is defined as
<patternset id="pset.all.jar.rec">
<include name="**/*.jar"/>
</patternset>
If used as above this includes all jar files in a directory and all of
it's subdirectories.
Harkness, David wrote:
zip
>One thing I haven't been able to figure out is how to do the same thing
>for the <junit> and <junitreport> tasks. Since those tasks are already
>defined, I can't give them a new classpath to include junit.jar,
>crimson.jar, and xalan-j.jar. Thus, all those have to go either in my
>ant/lib or on the CLASSPATH. Has anyone else found a way around this?
>
>
zip
-------------------------------------------------------
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01
/01
_______________________________________________
xdoclet-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/xdoclet-user
-------------------------------------------------------
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01
_______________________________________________
xdoclet-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/xdoclet-user