ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jim Allers" <...@advancedreality.com>
Subject RE: unit test failure w/junit task
Date Wed, 05 Mar 2003 21:21:47 GMT
Do you have the same problem when you run the Junit test not through
Ant?

Forking a test is easy. You may already be doing it.
<junit printsummary="yes" fork="yes" haltonfailure="yes">
  <formatter type="plain" />
  <test name="my.test.TestCase" />
</junit>

Maybe, it's the third party library that is to blame. Can you normally
make two separate connections to the remote application?


-----Original Message-----
From: Erik Price [mailto:eprice@ptc.com] 
Sent: Wednesday, March 05, 2003 3:01 PM
To: Ant Users List
Subject: Re: unit test failure w/junit task




Jim Allers wrote:
> jvb.dll is probably a JNI library used during your test.
> 
> You should fork your tests when running. "junit" has a "fork" 
> property.
> 
> The error means exactly what it says. "jvb.dll" cannot be loaded by 
> more than one classloader. If the classloader that loaded jvb.dll is 
> garbage collected, then "jvb.dll" can be loaded again by a different 
> classloader. Since there is no way of guaranteeing that a classloader 
> is garbage collected, I recommend forking.
> 
> If you're really adventurous, there are various ways you can try to 
> solve the problem without creating a new process, but I think you'll 
> have to ask some real experts.

Arg.  I don't know anything about JNI and classloaders.  I'm using a 3rd

party library to make a connection to a remote application in my setUp()

method so I can retrieve an object, then I'm using that same library to 
make a separate connection to the remote application to retrieve another

object to perform assertEquals() tests etc.

I will hunt down some references to "forking", but I'm skeptical that 
this will solve my problem since the concurrent accesses are happening 
within the same unit test.

Thanks Jim,


Erik


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


Mime
View raw message