|
View:
New views
3 Messages
—
Rating Filter:
Alert me
|
|
|
Specifying the order of tests and test classes?Hello,
I'm looking for some advice on the best way to setup this test scenario... * Tests are run from Ant using a fileset with wildcards (so that we don't have to manually maintain a list of tests) * These tests are for a web application where there is a login screen * We want to test the login screen with LoginTest.class, but the tests in that class only need to run once. Once the test has logged in successfully, the other application tests will already be logged in. So, what is the best way to force LoginTest to run before all other tests and to force the order of LoginTest tests (because we want to test all the failure scenarios before finally testing the success scenario)? Is it possible to maintain the low-maintainance flexibility of the Ant fileset while specifying order? Is it possible to create a TestSuite dynamically that would allow us to specify order? |
|
|
RE: Specifying the order of tests and test classes?Dear Andy,
I haven't used Ant in a number of years, but perhaps you could separate the login tests, main tests, and logout tests into three separate Ant tasks. You could then use Ant to force the order of execution and test the return value from your test runner to see if any test cases failed and then act accordingly. Since this is a web app, I'm assuming that it doesn't really matter which process makes the HTTP request as long as it comes in with the same credentials. Hope that helps, Rocco From: junit@... [mailto:junit@...] On Behalf Of kokaku71 Sent: Tuesday, October 13, 2009 10:18 AM To: junit@... Subject: [junit] Specifying the order of tests and test classes? Hello, I'm looking for some advice on the best way to setup this test scenario... * Tests are run from Ant using a fileset with wildcards (so that we don't have to manually maintain a list of tests) * These tests are for a web application where there is a login screen * We want to test the login screen with LoginTest.class, but the tests in that class only need to run once. Once the test has logged in successfully, the other application tests will already be logged in. So, what is the best way to force LoginTest to run before all other tests and to force the order of LoginTest tests (because we want to test all the failure scenarios before finally testing the success scenario)? Is it possible to maintain the low-maintainance flexibility of the Ant fileset while specifying order? Is it possible to create a TestSuite dynamically that would allow us to specify order? [Non-text portions of this message have been removed] |
|
|
Re: Specifying the order of tests and test classes?Hello!
I'd like to extend on Rocco's suggestion: Test for the login and logout in one class (test case). Then in another class do rest of your tests - in particular if you are concerned with the time to execute the tests - place the login-code in a method of a class testing the rest of your application with a @BeforeClass annotation. That way, there should be no dependency of the test outcomes on the sequence in which the tests are executed (a good idea anyhow!). You may force ant (for convinience only!) to have the login test done early to make the root cause of the failures more evident. Greetings, Georg --- In junit@..., "Pigneri, Rocco" <rpigneri@...> wrote: > > Dear Andy, > > I haven't used Ant in a number of years, but perhaps you could separate the login tests, main tests, and logout tests into three separate Ant tasks. You could then use Ant to force the order of execution and test the return value from your test runner to see if any test cases failed and then act accordingly. Since this is a web app, I'm assuming that it doesn't really matter which process makes the HTTP request as long as it comes in with the same credentials. > > Hope that helps, > > Rocco > > From: junit@... [mailto:junit@...] On Behalf Of kokaku71 > Sent: Tuesday, October 13, 2009 10:18 AM > To: junit@... > Subject: [junit] Specifying the order of tests and test classes? > > > > Hello, > > I'm looking for some advice on the best way to setup this test scenario... > > * Tests are run from Ant using a fileset with wildcards (so that we don't have to manually maintain a list of tests) > > * These tests are for a web application where there is a login screen > > * We want to test the login screen with LoginTest.class, but the tests in that class only need to run once. Once the test has logged in successfully, the other application tests will already be logged in. > > So, what is the best way to force LoginTest to run before all other tests and to force the order of LoginTest tests (because we want to test all the failure scenarios before finally testing the success scenario)? > > Is it possible to maintain the low-maintainance flexibility of the Ant fileset while specifying order? Is it possible to create a TestSuite dynamically that would allow us to specify order? > > > > [Non-text portions of this message have been removed] > |
| Free embeddable forum powered by Nabble | Forum Help |