TestSuite Example

WindowTester allows you to easily create and run unit tests for every GUI they build. It can also be used to generate system level tests.

Moderators: gnebling, Eric Clayberg, Dan Rubel, keertip, Phil Quitslund

TestSuite Example

Postby Phil Quitslund » Thu Sep 28, 2006 7:08 am

Using test suites to organize and aggregate your tests is easy. Here's a quick example.

Suppose you have three tests:

Code: Select all
public class TestA extends UITestCase { ... }


Code: Select all
public class TestB extends UITestCase { ... }


Code: Select all
public class TestC extends UITestCase { ... }


Putting them in a suite is as simple as defining a class like this:

Code: Select all
public class MyTestSuite extends TestCase
{
    public static TestSuite suite()
    {
        TestSuite suite = new TestSuite();       
        suite.addTestSuite(TestA.class);
        suite.addTestSuite(TestB.class);
        suite.addTestSuite(TestC.class);
        return suite;
    }
}


Running this test suite can be done with the standard PDE Junit Test Case launch configuration (Run>Run as>JUnit Plug-in Test).

For more info see this topic...
viewtopic.php?f=5&t=1742&start=0&st=0&sk=t&sd=a&hilit=tearDown

Happy testing!
--
Phil Quitslund
Software Engineer
Google, Inc.
Phil Quitslund
Moderator
 
Posts: 491
Joined: Fri Apr 28, 2006 6:26 am

Re: TestSuite Example

Postby Phil Quitslund » Sun Nov 08, 2009 8:24 pm

Glad the examples helped. If you have any specific questions, please post them and I'll be happy to see what I can do to answer them.

Cheers!
--
Phil Quitslund
Software Engineer
Google, Inc.
Phil Quitslund
Moderator
 
Posts: 491
Joined: Fri Apr 28, 2006 6:26 am


Return to Window Tester

Who is online

Users browsing this forum: No registered users and 1 guest