ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "William E. Kempf" <weke...@cox.net>
Subject Re: JUnit and bootclasspath
Date Tue, 21 Jan 2003 06:54:48 GMT
Stefan Bodewig said:
> On Fri, 17 Jan 2003, William E. Kempf <wekempf@cox.net> wrote:
>
>>> If you are forking <junit>, you could specify the -bootclasspath
>>> option as <jvmarg>.  Adding <bootclasspath> to side <classpath>
to
>>> the JUnit task could be a very valid enhancement request.
>>
>> Part of my question is how to use a classpathref here.
>
> <property name="path.as.property" refid="your-ref"/>
> <junit fork="true"...>
>   ...
>   <jvmarg value="-Xbootclasspath:${path.as.property}"/>
> </junit>

OK, this is probably now much more of a general Java question than Ant
related, but since it has to do with the original question and answer...

Here's how I supply the bootclasspath:

<property name="bootclasspath" refid="mylib.classpath" />
<junit printsummary="no"
       errorProperty="test.failed"
       failureProperty="test.failed"
       fork="yes">
        <classpath refid="mylib.classpath"/>
        <jvmarg value="-Xbootclasspath:${bootclasspath}" />
        <sysproperty key="docs.dir" value="${junit.data.dir}" />
        <sysproperty key="index.dir" value="${junit.data.dir}/index" />
        <formatter type="xml" />
        <formatter type="brief" usefile="false" />
        <test name="${testcase}" if="testcase" />
        <batchtest todir="${junit.data.dir}" unless="testcase">
                <fileset dir="${build.dir}" includes="**/*Test.class" />
        </batchtest>
</junit>

And the result is:

    [junit] Error occurred during initialization of VM
    [junit] java/lang/NoClassDefFoundError: java/lang/Object
    [junit] TEST test.com.mylib.swing.DefaultMyJButtonTest FAILED

So, obviously setting the bootclasspath has issues, since it now doesn't
contain the normal path elements.  But what are the normal bootclasspath
elements?





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


Mime
View raw message