ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Wright, Clark" <cwri...@litle.com>
Subject Junit task failing on formatter="failure"
Date Tue, 06 Dec 2011 21:13:32 GMT
Just started using Ant 1.8.2, mostly in order to use the new "failure" formatter of the junit
task.

This macrodef:

                <macrodef name="unit-test-runner">
                                <attribute name="refid" />
                                <attribute name="fork" default="once" />

                                <sequential>
                                                <echo> Junit forkmode is @{fork}. </echo>
                                                <junit fork="yes" forkmode="@{fork}" printsummary="on"
haltonfailure="false" tempdir="${tmpdir}">
                                                                <sysproperty key="ant.junit.failureCollector"
value="${test.output}/FailedJUnit"/>

                                                                <classpath refid="test.classpath.runtime"
/>
                                           <jvmarg value="-DappProperties=${vap.context}"
/>
                                                <jvmarg value="-DVAP_OUTPUT=${output.root}"
/>



                                                                <batchtest fork="yes" todir="${test.output}">
                    <fileset refid="@{refid}" />

                        <formatter type="failure" usefile="false"/>
                                                                    <formatter type="plain"/>
                                                                </batchtest>
                                                </junit>
                                </sequential>
                </macrodef>

Causes this stacktrace:

    [echo]  Junit forkmode is perTest.
    [junit] Exception in thread "main" java.lang.reflect.InvocationTargetException
    [junit]     at org.apache.tools.ant.taskdefs.optional.junit.FormatterElement.createFormatter(FormatterElement.java:346)
    [junit]     at org.apache.tools.ant.taskdefs.optional.junit.FormatterElement.createFormatter(FormatterElement.java:256)
    [junit]     at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.transferFormatters(JUnitTestRunner.java:957)
    [junit]     at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.launch(JUnitTestRunner.java:1050)
    [junit]     at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.main(JUnitTestRunner.java:906)
    [junit] Caused by: java.lang.reflect.InvocationTargetException
    [junit]     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    [junit]     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    [junit]     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    [junit]     at java.lang.reflect.Method.invoke(Method.java:597)
    [junit]     at org.apache.tools.ant.taskdefs.optional.junit.FormatterElement.createFormatter(FormatterElement.java:340)
    [junit]     ... 4 more
    [junit] Caused by: java.lang.NullPointerException
    [junit]     at org.apache.tools.ant.taskdefs.optional.junit.FailureRecorder.setProject(FailureRecorder.java:153)
    [junit]     ... 9 more

BUILD FAILED
/usr/local/litle-home/cwright/cvs/build/mainBuild.xml:67: The following error occurred while
executing this line:
/usr/local/litle-home/cwright/cvs/tests/build.xml:240: The following error occurred while
executing this line:
/usr/local/litle-home/cwright/cvs/tests/build.xml:142: java.lang.StringIndexOutOfBoundsException:
String index out of range: -1
        at java.lang.String.substring(String.java:1938)
        at org.apache.tools.ant.taskdefs.optional.junit.FailureRecorder$TestInfos.<init>(FailureRecorder.java:354)
        at org.apache.tools.ant.taskdefs.optional.junit.FailureRecorder.addError(FailureRecorder.java:184)
        at org.apache.tools.ant.taskdefs.optional.junit.JUnitTaskMirrorImpl.addVmExit(JUnitTaskMirrorImpl.java:57)
        at org.apache.tools.ant.taskdefs.optional.junit.JUnitTask.logVmExit(JUnitTask.java:1668)
        at org.apache.tools.ant.taskdefs.optional.junit.JUnitTask.logVmCrash(JUnitTask.java:1617)
        at org.apache.tools.ant.taskdefs.optional.junit.JUnitTask.executeAsForked(JUnitTask.java:1099)
        at org.apache.tools.ant.taskdefs.optional.junit.JUnitTask.execute(JUnitTask.java:851)
        at org.apache.tools.ant.taskdefs.optional.junit.JUnitTask.executeOrQueue(JUnitTask.java:1899)
        at org.apache.tools.ant.taskdefs.optional.junit.JUnitTask.execute(JUnitTask.java:800)
        at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
        at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
        at org.apache.tools.ant.Task.perform(Task.java:348)
        at org.apache.tools.ant.taskdefs.Sequential.execute(Sequential.java:68)
        at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
        at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
        at org.apache.tools.ant.Task.perform(Task.java:348)
        at org.apache.tools.ant.taskdefs.MacroInstance.execute(MacroInstance.java:398)
        at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
        at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
        at org.apache.tools.ant.Task.perform(Task.java:348)
        at org.apache.tools.ant.Target.execute(Target.java:390)
        at org.apache.tools.ant.Target.performTasks(Target.java:411)
        at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1399)
        at org.apache.tools.ant.helper.SingleCheckExecutor.executeTargets(SingleCheckExecutor.java:38)
        at org.apache.tools.ant.Project.executeTargets(Project.java:1251)
        at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:442)
        at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
        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:597)
        at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
        at org.apache.tools.ant.Task.perform(Task.java:348)
        at org.apache.tools.ant.Target.execute(Target.java:390)
        at org.apache.tools.ant.Target.performTasks(Target.java:411)
        at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1399)
        at org.apache.tools.ant.Project.executeTarget(Project.java:1368)
        at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
        at org.apache.tools.ant.Project.executeTargets(Project.java:1251)
        at org.apache.tools.ant.Main.runBuild(Main.java:809)
        at org.apache.tools.ant.Main.startAnt(Main.java:217)
        at org.apache.tools.ant.launch.Launcher.run(Launcher.java:280)
        at org.apache.tools.ant.launch.Launcher.main(Launcher.java:109)


Removing the failure formatter, and the tests run just as they did with Ant 1.7.x

Any one have any suggestions?

-Clark.

The information in this message is for the intended recipient(s) only and may be the proprietary
and/or confidential property of Litle & Co., LLC, and thus protected from disclosure.
If you are not the intended recipient(s), or an employee or agent responsible for delivering
this message to the intended recipient, you are hereby notified that any use, dissemination,
distribution or copying of this communication is prohibited. If you have received this communication
in error, please notify Litle & Co. immediately by replying to this message and then promptly
deleting it and your reply permanently from your computer.

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message