Search the web
Sign In
New User? Sign Up
junitperf
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Want to share photos of your group with the world? Add a group photo to Flickr.

Best of Y! Groups

   Check them out and nominate your group.
Having problems with message search? Fill out this form to ensure your group is one of the first to be migrated to the new message search system.

Messages

  Messages Help
Advanced
Threaded test doesn't end   Message List  
Reply | Forward Message #31 of 94 |

Hi,

Im just playing with threaded tests. I try to simulate 5 users each running in a special thread.
But I don't see the result I think I should see :-)

The graphical UI tells me, that we had 7 runs, sometimes 6, sometimes 0.
The textui states that 2 Tests are ok. I want to see 10, because there are 5 tests for each user.

So the question is: What do I have to do, running correct threaded tests and seeing the expected results?

Thanks for your help

Frank

This is the test I run:
************************************************************************************
import com.clarkware.junitperf.*;
import junit.framework.*;

public class Example extends TestCase {

        static int pointerToArray = 0;
       
        private String[] letterArray = {"a","b","c","d","e","f"};
       
        public Example(String name) {
                super(name);
        }
       
        public static Test suite() {
                int maxUsers = 5;
       
                Test loadTest = new LoadTest(new TestSuite(Example.class), maxUsers);
                Test threadTest = new ThreadedTest( loadTest );
                TestSuite suite = new TestSuite();

                suite.addTest( threadTest );           
               
                return suite;
        }
       
        public void testSeitenaufbau() throws Exception
        {
        String letter =         this.letterArray[pointerToArray];
        pointerToArray++;
        System.out.println( this.toString() + ": " + "Letter: " + letter );
        String title;
        assertEquals( "wrong title", "ok", "ok" );
        }
       
        public void testEingabeKorrekterName() throws Exception
        {
        System.out.println( this.toString() + ": " + this.letterArray[pointerToArray] );
        assertEquals( "wrong title", "ok", "ok" );
        }
}
*************************************************************************************************



Thu Jun 26, 2003 6:13 pm

rogler_frank
Offline Offline
Send Email Send Email

Forward
Message #31 of 94 |
Expand Messages Author Sort by Date

Hi, Im just playing with threaded tests. I try to simulate 5 users each running in a special thread. But I don't see the result I think I should see :-) The...
Rogler, Frank
rogler_frank
Offline Send Email
Jun 26, 2003
6:13 pm

Hi Frank, ... Interesting. When I run it through the graphical runner, it consistently returns 10. Can you tell me more about how you're running it through...
Mike Clark
clarkware
Offline Send Email
Jun 26, 2003
7:42 pm

... sometimes 0. ... there ... observing. ... Hi Mike, I left out the threadedTest and it runs ok. Meanwhile, I've got another problem: I try to test a web...
rogler_frank
Offline Send Email
Jul 9, 2003
1:38 pm

... Is the user configured in setUp()? If so, you'll want to use the TestMethodFactory to ensure that each thread spawned by the LoadTest gets its own...
Mike Clark
clarkware
Offline Send Email
Jul 9, 2003
4:17 pm
Advanced

Copyright © 2009 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help