ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 21947] - JUnit Task - XML formatter fails when type set to "xml": NullPointerException
Date Fri, 10 Aug 2007 14:51:16 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=21947>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=21947


tim@leftmoon.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
         OS/Version|Linux                       |All
         Resolution|WORKSFORME                  |
            Summary|Junit Task - Xml reporter   |JUnit Task - XML formatter
                   |don't work well             |fails when type set to
                   |                            |"xml": NullPointerException
            Version|1.5.3                       |1.7.0




------- Additional Comments From tim@leftmoon.com  2007-08-10 07:51 -------
This seems to be the same issue and yes, it is still happening in Ant 1.7.  My 
script works when I set the formatter type to "plain" and fails under "xml".  
Hopefully this can help in resolving the issue.  If you need more info, let me 
know.

Ant script:
================
<?xml version="1.0"?>

<project default="dist" basedir=".">

	<property name="src"        location="src"/>
	<property name="test"       location="test"/>
	<property name="report"     location="report"/>
	<property name="build"      location="build"/>
	<property name="dist"       location="dist"/>
	<property name="${where I work}.config.loc" 
location="${test}/config.xml"/>
	
	<target name="init">
		<!-- Create the time stamp -->
		<tstamp/>
		<!-- Create the build directory structure used by compile -->
		<mkdir dir="${build}"/>
	</target>
	
	<path id="wu.classpath">
		<pathelement path="${classpath}"/>
		<fileset dir="lib">
			<include name="**/*.jar"/>
		</fileset>
		<dirset dir="${build}"/>
	</path>
	
	<target name="compile" depends="init" description="compile the source " 
>
		<!-- Compile the java code from ${src} into ${build} -->
		<javac srcdir="${src}"  destdir="${build}" 
classpathref="wu.classpath"/>
		<javac srcdir="${test}" destdir="${build}" 
classpathref="wu.classpath"/>
	</target>
	
	<target name="test" depends="compile" description="excute unit tests">
		<mkdir dir="${report}/test-${DSTAMP}"/>
		<junit printsummary="yes" haltonerror="yes">
			<formatter type="xml"/>
			<sysproperty key="${where I work}.config.loc" 
value="test/config.xml"/>
			<classpath>
				<pathelement path="${classpath}"/>
				<fileset dir="lib">
					<include name="**/*.jar"/>
				</fileset>
				<dirset dir="${build}"/>
			</classpath>
			
			<batchtest todir="${report}/test-${DSTAMP}">
				<fileset dir="${test}">
				      <include name="**/test/*Test.java"/>
				      <exclude name="**/${where I work}
TestCase.java"/>
				</fileset>
			</batchtest>
		</junit>
	</target>
	
	<target name="reportTest" depends="test" description="make">
		<junitreport todir="${report}/test-${DSTAMP}">
		  <fileset dir="${report}/test-${DSTAMP}">
		    <include name="TEST-*.xml"/>
		  </fileset>
		  <report format="frames" todir="./report/html"/>
		</junitreport>
	</target>

	<target name="dist" depends="test" description="generate the 
distribution" >
		<!-- Create the distribution directory -->
		<mkdir dir="${dist}/lib"/>

		<!-- Put everything in ${build} into the superDuper-
${DSTAMP}.jar file -->
		<jar jarfile="${dist}/lib/superDuper-${DSTAMP}.jar" 
basedir="${build}">
			<fileset dir="${build}">
				<exclude name="**/*Test*"/>
			</fileset>
		</jar>
	</target>

  
</project>


Verbose output (stripped unimportant info like classnames):
======================

Apache Ant version 1.7.0 compiled on December 13 2006
Buildfile: ${path}\build.xml
parsing buildfile ${path}\build.xml with URI = file${path}/build.xml
Project base dir set to: ${path}
[antlib:org.apache.tools.ant] Could not load definitions from resource 
org/apache/tools/ant/antlib.xml. It could not be found.
Property "classpath" has not been set
Build sequence for target(s) `dist' is [init, compile, test, dist]
Complete build sequence is [init, compile, test, dist, reportTest, ]
init:
    [mkdir] Skipping ${path}\build because it already exists.
compile:
    [javac] ${blah}.java omitted as ${blah}.class is up to date.
    [javac] config.xml skipped - don't know how to handle it
    [javac] log4j.properties skipped - don't know how to handle it
test:
    [mkdir] Skipping ${path}\test-20070810 because it already exists.
Property "classpath" has not been set
dropping ${path}\${classpath} from path as it doesn't exist
    [junit] Using System properties {java.runtime.name=Java(TM) 2 Runtime 
Environment, Standard Edition, sun.boot.library.path=C:\j2sdk1.4.2_15\jre\bin, 
java.vm.version=1.4.2_15-b02, ant.library.dir=N:\eclipse-java-europa-win32
\eclipse\plugins\org.apache.ant_1.7.0.v200706080842\lib, ${where I 
work}.config.loc=test/config.xml, java.vm.vendor=Sun Microsystems Inc., 
java.vendor.url=http://java.sun.com/, path.separator=;, java.vm.name=Java 
HotSpot(TM) Client VM, file.encoding.pkg=sun.io, user.country=US, 
sun.os.patch.level=Service Pack 2, java.vm.specification.name=Java Virtual 
Machine Specification, user.dir=N:\java\workspace\SuperDuper, 
java.runtime.version=1.4.2_15-b02, 
java.awt.graphicsenv=sun.awt.Win32GraphicsEnvironment, 
java.endorsed.dirs=C:\j2sdk1.4.2_15\jre\lib\endorsed, os.arch=x86, 
java.io.tmpdir=${d-drive}\LOCALS~1\Temp\, line.separator=
    [junit] , java.vm.specification.vendor=Sun Microsystems Inc., 
user.variant=, os.name=Windows XP, ant.home=N:\eclipse-java-europa-win32
\eclipse\plugins\org.apache.ant_1.7.0.v200706080842, sun.java2d.fontpath=, 
java.library.path=N:\eclipse-java-europa-win32
\eclipse;.;C:\WINDOWS\Sun\Java\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\Program 
Files\Java\jre1.6.0_01\bin\client;C:\Program Files\Java\jre1.6.0_01
\bin;C:\Perl\site\bin;C:\Perl\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\Syst
em32\Wbem;C:\Program Files\CA\SharedComponents\ScanEngine;C:\Program 
Files\CA\SharedComponents\CAUpdate\;C:\Program 
Files\CA\SharedComponents\ThirdParty\;C:\Program 
Files\CA\SharedComponents\SubscriptionLicense\;C:\Program 
Files\CA\eTrustITM;C:\Program Files\QuickTime\QTSystem\;N:\eclipse-java-europa-
win32\eclipse\configuration\org.eclipse.osgi\bundles\132\1\.cp, 
java.specification.name=Java Platform API Specification, 
java.class.version=48.0, 
java.util.prefs.PreferencesFactory=java.util.prefs.WindowsPreferencesFactory, 
os.version=5.1, user.home=C:\Documents and Settings\${me!!!}, 
user.timezone=America/Chicago, java.awt.printerjob=sun.awt.windows.WPrinterJob, 
file.encoding=Cp1252, java.specification.version=1.4, 
java.class.path=N:\eclipse-java-europa-win32
\eclipse\plugins\org.apache.ant_1.7.0.v200706080842\lib\ant.jar;N:\eclipse-java-
europa-win32\eclipse\plugins\org.apache.ant_1.7.0.v200706080842\lib\ant-
antlr.jar;N:\eclipse-java-europa-win32
\eclipse\plugins\org.apache.ant_1.7.0.v200706080842\lib\ant-apache-
bcel.jar;N:\eclipse-java-europa-win32
\eclipse\plugins\org.apache.ant_1.7.0.v200706080842\lib\ant-apache-
bsf.jar;N:\eclipse-java-europa-win32
\eclipse\plugins\org.apache.ant_1.7.0.v200706080842\lib\ant-apache-
log4j.jar;N:\eclipse-java-europa-win32
\eclipse\plugins\org.apache.ant_1.7.0.v200706080842\lib\ant-apache-
oro.jar;N:\eclipse-java-europa-win32
\eclipse\plugins\org.apache.ant_1.7.0.v200706080842\lib\ant-apache-
regexp.jar;N:\eclipse-java-europa-win32
\eclipse\plugins\org.apache.ant_1.7.0.v200706080842\lib\ant-apache-
resolver.jar;N:\eclipse-java-europa-win32
\eclipse\plugins\org.apache.ant_1.7.0.v200706080842\lib\ant-commons-
logging.jar;N:\eclipse-java-europa-win32
\eclipse\plugins\org.apache.ant_1.7.0.v200706080842\lib\ant-commons-
net.jar;N:\eclipse-java-europa-win32
\eclipse\plugins\org.apache.ant_1.7.0.v200706080842\lib\ant-jai.jar;N:\eclipse-
java-europa-win32\eclipse\plugins\org.apache.ant_1.7.0.v200706080842\lib\ant-
javamail.jar;N:\eclipse-java-europa-win32
\eclipse\plugins\org.apache.ant_1.7.0.v200706080842\lib\ant-
jdepend.jar;N:\eclipse-java-europa-win32
\eclipse\plugins\org.apache.ant_1.7.0.v200706080842\lib\ant-jmf.jar;N:\eclipse-
java-europa-win32\eclipse\plugins\org.apache.ant_1.7.0.v200706080842\lib\ant-
jsch.jar;N:\eclipse-java-europa-win32
\eclipse\plugins\org.apache.ant_1.7.0.v200706080842\lib\ant-
junit.jar;N:\eclipse-java-europa-win32
\eclipse\plugins\org.apache.ant_1.7.0.v200706080842\lib\ant-
launcher.jar;N:\eclipse-java-europa-win32
\eclipse\plugins\org.apache.ant_1.7.0.v200706080842\lib\ant-
netrexx.jar;N:\eclipse-java-europa-win32
\eclipse\plugins\org.apache.ant_1.7.0.v200706080842\lib\ant-
nodeps.jar;N:\eclipse-java-europa-win32
\eclipse\plugins\org.apache.ant_1.7.0.v200706080842\lib\ant-
starteam.jar;N:\eclipse-java-europa-win32
\eclipse\plugins\org.apache.ant_1.7.0.v200706080842\lib\ant-
stylebook.jar;N:\eclipse-java-europa-win32
\eclipse\plugins\org.apache.ant_1.7.0.v200706080842\lib\ant-
swing.jar;N:\eclipse-java-europa-win32
\eclipse\plugins\org.apache.ant_1.7.0.v200706080842\lib\ant-trax.jar;N:\eclipse-
java-europa-win32\eclipse\plugins\org.apache.ant_1.7.0.v200706080842\lib\ant-
weblogic.jar;N:\eclipse-java-europa-win32
\eclipse\configuration\org.eclipse.osgi\bundles\16\1
\.cp\lib\remoteAnt.jar;N:\eclipse-java-europa-win32
\eclipse\plugins\com.jcraft.jsch_0.1.31.jar;C:\j2sdk1.4.2_15
\lib\tools.jar;N:\eclipse-java-europa-win32
\eclipse\plugins\org.eclipse.swt.win32.win32.x86_3.3.0.v3346.jar, 
user.name=${me!!!}, java.vm.specification.version=1.0, 
java.home=C:\j2sdk1.4.2_15\jre, sun.arch.data.model=32, user.language=en, 
java.specification.vendor=Sun Microsystems Inc., 
awt.toolkit=sun.awt.windows.WToolkit, java.vm.info=mixed mode, 
java.version=1.4.2_15, java.ext.dirs=C:\j2sdk1.4.2_15\jre\lib\ext, 
sun.boot.class.path=C:\j2sdk1.4.2_15\jre\lib\rt.jar;C:\j2sdk1.4.2_15
\jre\lib\i18n.jar;C:\j2sdk1.4.2_15\jre\lib\sunrsasign.jar;C:\j2sdk1.4.2_15
\jre\lib\jsse.jar;C:\j2sdk1.4.2_15\jre\lib\jce.jar;C:\j2sdk1.4.2_15
\jre\lib\charsets.jar;C:\j2sdk1.4.2_15\jre\classes, java.vendor=Sun 
Microsystems Inc., file.separator=\, 
java.vendor.url.bug=http://java.sun.com/cgi-bin/bugreport.cgi, 
sun.io.unicode.encoding=UnicodeLittle, sun.cpu.endian=little, 
sun.cpu.isalist=pentium i486 i386}
    [junit] Running ${where I work}.authorization.test.BouncerFactoryTest
    [junit] junit.framework.TestListener: tests to run: 3
    [junit] junit.framework.TestListener: startTest(testGetBouncer)
    [junit] junit.framework.TestListener: endTest(testGetBouncer)
    [junit] junit.framework.TestListener: startTest(testNullResource)
    [junit] junit.framework.TestListener: endTest(testNullResource)
    [junit] junit.framework.TestListener: startTest(testMissingConfig)
    [junit] junit.framework.TestListener: endTest(testMissingConfig)
    [junit] Tests run: 3, Failures: 0, Errors: 0, Time elapsed: 4.39 secnull

BUILD FAILED
${path}\build.xml:35: java.lang.NullPointerException
	at org.apache.tools.ant.dispatch.DispatchUtils.execute
(DispatchUtils.java:115)
	at org.apache.tools.ant.Task.perform(Task.java:348)
	at org.apache.tools.ant.Target.execute(Target.java:357)
	at org.apache.tools.ant.Target.performTasks(Target.java:385)
	at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1329)
	at org.apache.tools.ant.Project.executeTarget(Project.java:1298)
	at org.apache.tools.ant.helper.DefaultExecutor.executeTargets
(DefaultExecutor.java:41)
	at 
org.eclipse.ant.internal.ui.antsupport.EclipseDefaultExecutor.executeTargets
(EclipseDefaultExecutor.java:32)
	at org.apache.tools.ant.Project.executeTargets(Project.java:1181)
	at org.eclipse.ant.internal.ui.antsupport.InternalAntRunner.run
(InternalAntRunner.java:423)
	at org.eclipse.ant.internal.ui.antsupport.InternalAntRunner.main
(InternalAntRunner.java:137)
Caused by: java.lang.NullPointerException
	at java.io.Writer.write(Writer.java:126)
	at org.apache.tools.ant.util.DOMElementWriter.write
(DOMElementWriter.java:210)
	at 
org.apache.tools.ant.taskdefs.optional.junit.XMLJUnitResultFormatter.endTestSuit
e(XMLJUnitResultFormatter.java:168)
	at 
org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.fireEndTestSuite
(JUnitTestRunner.java:620)
	at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.run
(JUnitTestRunner.java:453)
	at org.apache.tools.ant.taskdefs.optional.junit.JUnitTask.executeInVM
(JUnitTask.java:1245)
	at org.apache.tools.ant.taskdefs.optional.junit.JUnitTask.execute
(JUnitTask.java:814)
	at org.apache.tools.ant.taskdefs.optional.junit.JUnitTask.executeOrQueue
(JUnitTask.java:1657)
	at org.apache.tools.ant.taskdefs.optional.junit.JUnitTask.execute
(JUnitTask.java:764)
	at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke
(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke
(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:324)
	at org.apache.tools.ant.dispatch.DispatchUtils.execute
(DispatchUtils.java:105)
	... 10 more
--- Nested Exception ---
java.lang.NullPointerException
	at java.io.Writer.write(Writer.java:126)
	at org.apache.tools.ant.util.DOMElementWriter.write
(DOMElementWriter.java:210)
	at 
org.apache.tools.ant.taskdefs.optional.junit.XMLJUnitResultFormatter.endTestSuit
e(XMLJUnitResultFormatter.java:168)
	at 
org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.fireEndTestSuite
(JUnitTestRunner.java:620)
	at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.run
(JUnitTestRunner.java:453)
	at org.apache.tools.ant.taskdefs.optional.junit.JUnitTask.executeInVM
(JUnitTask.java:1245)
	at org.apache.tools.ant.taskdefs.optional.junit.JUnitTask.execute
(JUnitTask.java:814)
	at org.apache.tools.ant.taskdefs.optional.junit.JUnitTask.executeOrQueue
(JUnitTask.java:1657)
	at org.apache.tools.ant.taskdefs.optional.junit.JUnitTask.execute
(JUnitTask.java:764)
	at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke
(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke
(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:324)
	at org.apache.tools.ant.dispatch.DispatchUtils.execute
(DispatchUtils.java:105)
	at org.apache.tools.ant.Task.perform(Task.java:348)
	at org.apache.tools.ant.Target.execute(Target.java:357)
	at org.apache.tools.ant.Target.performTasks(Target.java:385)
	at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1329)
	at org.apache.tools.ant.Project.executeTarget(Project.java:1298)
	at org.apache.tools.ant.helper.DefaultExecutor.executeTargets
(DefaultExecutor.java:41)
	at 
org.eclipse.ant.internal.ui.antsupport.EclipseDefaultExecutor.executeTargets
(EclipseDefaultExecutor.java:32)
	at org.apache.tools.ant.Project.executeTargets(Project.java:1181)
	at org.eclipse.ant.internal.ui.antsupport.InternalAntRunner.run
(InternalAntRunner.java:423)
	at org.eclipse.ant.internal.ui.antsupport.InternalAntRunner.main
(InternalAntRunner.java:137)

Total time: 6 seconds


-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

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


Mime
View raw message