You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Derek Nerenberg <dn...@healthtrans.com> on 2004/08/16 20:35:06 UTC

junitreport

Sorry if this is redundant.  I didn't see the email from the list and
haven't heard anything back from anyone, so I'm guessing the first one I
sent didn't make it out.
 
I need someone help me getting a junitreport setup with Ant 1.6.1?  I've
been round and about 100 different ways and can seem to find the right
environment config.  I put the xalan.jar in the ANT_HOME/lib (which
kills ant from eclipse).  I have the xercesImpl.jar and xml-apis.jar in
the classpath.

In Eclipse I get:  Could not find xalan2 nor xalan1 in the classpath.

If you know how to fix this (preferably without hacking the plugin.xml),
I'd like to hear your suggestions.

>From command line I get:

test-report:
[junitreport] Parsing file: 'C:\Program
Files\eclipse\workspace\MyProject\tests\reports\TEST-com.project.tests.D
BConnectionManagerTest.xml'
[junitreport] Parsing file: 'C:\Program
Files\eclipse\workspace\MyProject\tests\reports\TEST-com.project.tests.D
isplayListDelegateTest.xml'
[junitreport] Parsing file: 'C:\Program
Files\eclipse\workspace\MyProject\tests\reports\TEST-com.project.tests.D
ownloadFileDelegateTest.xml'
[junitreport] Using Xalan version: Xalan Java 2.6.0

BUILD FAILED
java.lang.NoSuchMethodError
        at org.apache.tools.ant.Project.executeTarget(Project.java:1224)
        at
org.apache.tools.ant.Project.executeTargets(Project.java:1063)
        at org.apache.tools.ant.Main.runBuild(Main.java:632)
        at org.apache.tools.ant.Main.startAnt(Main.java:183)
        at org.apache.tools.ant.launch.Launcher.run(Launcher.java:197)
        at org.apache.tools.ant.launch.Launcher.main(Launcher.java:56)
--- Nested Exception ---
java.lang.NoSuchMethodError
        at
org.apache.xml.dtm.ref.dom2dtm.DOM2DTM.addNode(DOM2DTM.java:259)
        at
org.apache.xml.dtm.ref.dom2dtm.DOM2DTM.<init>(DOM2DTM.java:128)
        at
rg.apache.xml.dtm.ref.DTMManagerDefault.getDTM(DTMManagerDefault.java:24
6)
        at
org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.j
ava:663)
        at
org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.j
ava:1192)
        at
org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.j
ava:1170)
        at
org.apache.tools.ant.taskdefs.optional.junit.Xalan2Executor.execute(Xala
n2Executor.java:45)
        at
org.apache.tools.ant.taskdefs.optional.junit.AggregateTransformer.transf
orm(AggregateTransformer.java:147)
        at
org.apache.tools.ant.taskdefs.optional.junit.XMLResultAggregator.execute
(XMLResultAggregator.java:136)
        at
org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:269)
        at org.apache.tools.ant.Task.perform(Task.java:364)
        at org.apache.tools.ant.Target.execute(Target.java:301)
        at org.apache.tools.ant.Target.performTasks(Target.java:328)
        at org.apache.tools.ant.Project.executeTarget(Project.java:1215)
        at
org.apache.tools.ant.Project.executeTargets(Project.java:1063)
        at org.apache.tools.ant.Main.runBuild(Main.java:632)
        at org.apache.tools.ant.Main.startAnt(Main.java:183)
        at org.apache.tools.ant.launch.Launcher.run(Launcher.java:197)
        at org.apache.tools.ant.launch.Launcher.main(Launcher.java:56)

Environment:

ANT 1.6.1
Java 1.3.1 (don't laugh, it's not in my control)
Windows XP
Eclipse 2.1.3 (if you know how to make it work right from within
Eclipse)


Here's my build.xml excerpt:

(...)
		<pathelement location="${lib.home}/xalan.jar" />
		<pathelement location="${lib.home}/xercesImpl.jar" />
		<pathelement location="${lib.home}/xml-apis.jar" />
(...)
	<target name="test">
		<mkdir dir="${tests.reports}" />
		<mkdir dir="${tests.reports}/html" />

		<junit printsummary="true" 
				haltonerror="true"
				haltonfailure="true" 
				errorproperty="test.error" 
				showoutput="on">

			<!--// SET THE CLASSPATH //-->
			<classpath refid="class.path" />


			<!--// SET THE FORMATTER //-->
			<formatter type="brief" usefile="false" />
			<formatter type="plain" />
			<formatter type="xml" />

			<!--// RUN ALL THE TESTS //-->
			<batchtest fork="yes" todir="${tests.reports}">
				<fileset dir="${tests.src}">
					<include name="**/*Test*.java"/>
					<exclude
name="**/AllTests.java"/>
					<exclude
name="**/*Helper*.java"/>	
				</fileset>
			</batchtest>
		</junit>
		
		<junitreport todir="${tests.reports}">
			<fileset dir="${tests.reports}">
				<include name="TEST-*.xml" />
			</fileset>
			<report format="frames"
todir="${tests.reports}/html"/>
		</junitreport>
	</target>
	
	<target name="test-report">
		<junitreport todir="${tests.reports}">
			<fileset dir="${tests.reports}">
				<include name="TEST-*.xml" />
			</fileset>
			<report format="frames"
todir="${tests.reports}/html"/>
		</junitreport>
	</target>
(...)

Thanks
Derek

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Re: junitreport

Posted by "mail.laconiadatasystems.com" <we...@laconiadatasystems.com>.
Need to use Eclipse IDE to add xalan.jar the to Eclipse classpath
http://www.purposesolutions.com/Resources/EclipseJ2EE.html
HTH,
-Martin
----- Original Message ----- 
From: "Derek Nerenberg" <dn...@healthtrans.com>
To: "Ant Users List" <us...@ant.apache.org>
Sent: Monday, August 16, 2004 2:35 PM
Subject: junitreport


Sorry if this is redundant.  I didn't see the email from the list and
haven't heard anything back from anyone, so I'm guessing the first one I
sent didn't make it out.
 
I need someone help me getting a junitreport setup with Ant 1.6.1?  I've
been round and about 100 different ways and can seem to find the right
environment config.  I put the xalan.jar in the ANT_HOME/lib (which
kills ant from eclipse).  I have the xercesImpl.jar and xml-apis.jar in
the classpath.

In Eclipse I get:  Could not find xalan2 nor xalan1 in the classpath.

If you know how to fix this (preferably without hacking the plugin.xml),
I'd like to hear your suggestions.

>From command line I get:

test-report:
[junitreport] Parsing file: 'C:\Program
Files\eclipse\workspace\MyProject\tests\reports\TEST-com.project.tests.D
BConnectionManagerTest.xml'
[junitreport] Parsing file: 'C:\Program
Files\eclipse\workspace\MyProject\tests\reports\TEST-com.project.tests.D
isplayListDelegateTest.xml'
[junitreport] Parsing file: 'C:\Program
Files\eclipse\workspace\MyProject\tests\reports\TEST-com.project.tests.D
ownloadFileDelegateTest.xml'
[junitreport] Using Xalan version: Xalan Java 2.6.0

BUILD FAILED
java.lang.NoSuchMethodError
        at org.apache.tools.ant.Project.executeTarget(Project.java:1224)
        at
org.apache.tools.ant.Project.executeTargets(Project.java:1063)
        at org.apache.tools.ant.Main.runBuild(Main.java:632)
        at org.apache.tools.ant.Main.startAnt(Main.java:183)
        at org.apache.tools.ant.launch.Launcher.run(Launcher.java:197)
        at org.apache.tools.ant.launch.Launcher.main(Launcher.java:56)
--- Nested Exception ---
java.lang.NoSuchMethodError
        at
org.apache.xml.dtm.ref.dom2dtm.DOM2DTM.addNode(DOM2DTM.java:259)
        at
org.apache.xml.dtm.ref.dom2dtm.DOM2DTM.<init>(DOM2DTM.java:128)
        at
rg.apache.xml.dtm.ref.DTMManagerDefault.getDTM(DTMManagerDefault.java:24
6)
        at
org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.j
ava:663)
        at
org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.j
ava:1192)
        at
org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.j
ava:1170)
        at
org.apache.tools.ant.taskdefs.optional.junit.Xalan2Executor.execute(Xala
n2Executor.java:45)
        at
org.apache.tools.ant.taskdefs.optional.junit.AggregateTransformer.transf
orm(AggregateTransformer.java:147)
        at
org.apache.tools.ant.taskdefs.optional.junit.XMLResultAggregator.execute
(XMLResultAggregator.java:136)
        at
org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:269)
        at org.apache.tools.ant.Task.perform(Task.java:364)
        at org.apache.tools.ant.Target.execute(Target.java:301)
        at org.apache.tools.ant.Target.performTasks(Target.java:328)
        at org.apache.tools.ant.Project.executeTarget(Project.java:1215)
        at
org.apache.tools.ant.Project.executeTargets(Project.java:1063)
        at org.apache.tools.ant.Main.runBuild(Main.java:632)
        at org.apache.tools.ant.Main.startAnt(Main.java:183)
        at org.apache.tools.ant.launch.Launcher.run(Launcher.java:197)
        at org.apache.tools.ant.launch.Launcher.main(Launcher.java:56)

Environment:

ANT 1.6.1
Java 1.3.1 (don't laugh, it's not in my control)
Windows XP
Eclipse 2.1.3 (if you know how to make it work right from within
Eclipse)


Here's my build.xml excerpt:

(...)
<pathelement location="${lib.home}/xalan.jar" />
<pathelement location="${lib.home}/xercesImpl.jar" />
<pathelement location="${lib.home}/xml-apis.jar" />
(...)
<target name="test">
<mkdir dir="${tests.reports}" />
<mkdir dir="${tests.reports}/html" />

<junit printsummary="true" 
haltonerror="true"
haltonfailure="true" 
errorproperty="test.error" 
showoutput="on">

<!--// SET THE CLASSPATH //-->
<classpath refid="class.path" />


<!--// SET THE FORMATTER //-->
<formatter type="brief" usefile="false" />
<formatter type="plain" />
<formatter type="xml" />

<!--// RUN ALL THE TESTS //-->
<batchtest fork="yes" todir="${tests.reports}">
<fileset dir="${tests.src}">
<include name="**/*Test*.java"/>
<exclude
name="**/AllTests.java"/>
<exclude
name="**/*Helper*.java"/> 
</fileset>
</batchtest>
</junit>

<junitreport todir="${tests.reports}">
<fileset dir="${tests.reports}">
<include name="TEST-*.xml" />
</fileset>
<report format="frames"
todir="${tests.reports}/html"/>
</junitreport>
</target>

<target name="test-report">
<junitreport todir="${tests.reports}">
<fileset dir="${tests.reports}">
<include name="TEST-*.xml" />
</fileset>
<report format="frames"
todir="${tests.reports}/html"/>
</junitreport>
</target>
(...)

Thanks
Derek

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Re: junitreport

Posted by James Black <jb...@ieee.org>.
Derek Nerenberg wrote:

>Sorry if this is redundant.  I didn't see the email from the list and
>haven't heard anything back from anyone, so I'm guessing the first one I
>sent didn't make it out.
> 
>I need someone help me getting a junitreport setup with Ant 1.6.1?  I've
>been round and about 100 different ways and can seem to find the right
>environment config.  I put the xalan.jar in the ANT_HOME/lib (which
>kills ant from eclipse).  I have the xercesImpl.jar and xml-apis.jar in
>the classpath.
>
>  
>
  xercesImpl.jar and xml-apis.jar should go in 
$JAVA_HOME/jre/lib/endorsed/ which you may have to create.  This will 
override the default xml parsing classes (crimson.jar I believe).

  That should at least solve some of your problems.

  Good luck.

-- 
"Love is mutual self-giving that ends in self-recovery." Fulton Sheen
James Black    james@usf.edu


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org