ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Erik Price <epr...@ptc.com>
Subject Re: unit test failure w/junit task
Date Wed, 05 Mar 2003 21:46:34 GMT


Jim Allers wrote:
> 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?

I hadn't tried until now.  I was ready to say "it doesn't work".  But it 
seems I might be wrong... I created a new test case and the following 
test seems to have succeeded:

     public void testConcurrentConn() throws RemoteServerException {
         CaliberServer server1 = new CaliberServer(this.url);
         CaliberServer server2 = new CaliberServer(this.url);

         Session session1 = server1.login(this.name, this.pass);
         Session session2 = server2.login(this.name, this.pass);

         Requirement req1 = session1.getRequirement(21570);
         Requirement req2 = session2.getRequirement(21570);

         assertEquals(req1.getIDNumber(), req2.getIDNumber());
     }

So it looks like I was wrong in assuming that I couldn't have two 
concurrent accesses.  I'll have to play with this a bit tomorrow and 
figure out what causes that error of trying to load the native library 
twice.  Maybe using the "fork" property is the solution, who knows. 
Thanks again Jim.


Erik


Mime
View raw message