You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Ola Lie <ol...@tip.no> on 2005/08/04 03:50:54 UTC

junit task problem

Hi,

 

I have a class with a method getNames() which returns a List ( ArrayList).

Then I have test class with a testGetNames() method

which assertTrue if the List contains certain elements. 

 

The testGetNames() passes when I compile and run the test from the command
prompt.

(java "test class name"  - which calls junit.textui.TestRunner.run(suite());
from main) 

 

However, when I try to use ant, the getNames() method of the class I am
testing

runs, but returns an empty List so the same testGetNames() fails.

(<test name="${test.class.name}" />)

 

I am uncertain how to troubleshoot this problem. In the java program? In the
configuration?

In the build.xml?  Appreciate all advice I can get.

 

Thanks

Ola


Re: SV: junit task problem

Posted by Steve Loughran <st...@apache.org>.
Ola Lie wrote:
> Hi again,
> 
> The Java Communications API calls caused my problem. When I installed
> comm.jar og javax.comm.properties in the ant\lib directory and win32com.dll
> in the ant\bin directory, it worked all right.
> 
> However, I do not know why this is necessary as long as I had the classpath
> set to the java directory where I originally installed java comm api.
> 
> Best regards
> Ola

Adding native libraries to Java is trouble; you need to have them in one 
of a few blessed places. As for javax.* packages, some are extra special 
"endorsed libraries" that can only be updated in recent JVMs by also 
putting them in special places.

Java Web Start works around some of this, so there may be tricks that 
ant junit could use in future, if only we knew what they were...

-steve

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


SV: junit task problem

Posted by Ola Lie <ol...@tip.no>.
Hi again,

The Java Communications API calls caused my problem. When I installed
comm.jar og javax.comm.properties in the ant\lib directory and win32com.dll
in the ant\bin directory, it worked all right.

However, I do not know why this is necessary as long as I had the classpath
set to the java directory where I originally installed java comm api.

Best regards
Ola



-----Opprinnelig melding-----
Fra: Ola Lie [mailto:ola@tip.no] 
Sendt: 4. august 2005 03:51
Til: user@ant.apache.org
Emne: junit task problem

Hi,

 

I have a class with a method getNames() which returns a List ( ArrayList).

Then I have test class with a testGetNames() method

which assertTrue if the List contains certain elements. 

 

The testGetNames() passes when I compile and run the test from the command
prompt.

(java "test class name"  - which calls junit.textui.TestRunner.run(suite());
from main) 

 

However, when I try to use ant, the getNames() method of the class I am
testing

runs, but returns an empty List so the same testGetNames() fails.

(<test name="${test.class.name}" />)

 

I am uncertain how to troubleshoot this problem. In the java program? In the
configuration?

In the build.xml?  Appreciate all advice I can get.

 

Thanks

Ola



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