You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by Detlef Brendle <de...@canoo.com> on 2001/07/17 08:47:27 UTC

ant problem with JUnit AllTest class

hi all,
has anybody encountered the same problem as me ?
If I compile a project including JUnit AllTest classes such as

**************************************source code
start*****************************
package com.xxx.yyy.zzz;

import junit.framework.*;

public class AllTests extends TestCase
{

    public AllTests(String name)
    {
        super(name);
    }

    public static Test suite()
    {
        TestSuite suite = new TestSuite();

        suite.addTest(com.xxx.yyy.zzz.aaa.AllTests.suite());
        suite.addTest(com.xxx.yyy.zzz.bbb.AllTests.suite());

        return suite;
    }

    public static void main(String[] args)
    {
        junit.textui.TestRunner.run(suite());
    }
}
**************************************source code
end*****************************

my Ant script does not compile this class for some strange reason.
However if I add the import statement of my sub AllTest classes it runs
allright.

I got suspicious about the optimzue flag in the javac compiler call and
switched it off but without success.

Can anybody help,.


cheers,

detlef


RE: ant problem with JUnit AllTest class

Posted by Detlef Brendle <de...@canoo.com>.
it doesnt compile this java source?.

-----Original Message-----
From: ant-user-return-10355-detlef.brendle=canoo.com@jakarta.apache.org
[mailto:ant-user-return-10355-detlef.brendle=canoo.com@jakarta.apache.or
g]On Behalf Of Stefan Bodewig
Sent: Wednesday, July 18, 2001 11:21 AM
To: ant-user@jakarta.apache.org
Subject: Re: ant problem with JUnit AllTest class


On Tue, 17 Jul 2001, Detlef Brendle <de...@canoo.com> wrote:

> my Ant script does not compile this class for some strange reason.

Does not compile as in "doesn't try to compile" or "tries, but
generates errors"?  In the later case, what are the error messages?

Stefan


Re: ant problem with JUnit AllTest class

Posted by Stefan Bodewig <bo...@apache.org>.
On Tue, 17 Jul 2001, Detlef Brendle <de...@canoo.com> wrote:

> my Ant script does not compile this class for some strange reason.

Does not compile as in "doesn't try to compile" or "tries, but
generates errors"?  In the later case, what are the error messages?

Stefan

Re: ant problem with JUnit AllTest class

Posted by Stephen Tjasink <st...@hyperlink-interactive.co.uk>.
> my Ant script does not compile this class for some strange reason.
> However if I add the import statement of my sub AllTest classes it runs
> allright.

Well why don't you just leave the import statements in then? 

In fact, judging by the code that you posted, they should definitely be 
in there as the classes that you're accessing are in different packages 
so you couldn't reasonably expect it to compile without the import 
statements.  It's not an ant-specific issue, it's a general Java one.

Stephen