Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.

  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Appendices > Parameterized Test Case overriding runTest()

A.2. Parameterized Test Case overriding runTest()

Solution

This is a Parameterized Test Case that overrides runTest() and provides a meaningful name for each test. The test data is hard coded directly into the suite() method, although it could easily be extracted into a file.

Note

Be careful!— Overriding runTest() does not work if you are using a JUnit-related framework that already overrides this method for its own purpose. For example, you cannot employ this technique with Cactus, because its test case classes override runTest() to determine whether to execute the test entirely on the client or on the server. If your test case class extends something other than junit.framework.TestCase, then we recommend you look at the source for that customized test case class and ensure that this approach is compatible with those customizations.



  

You are currently reading a PREVIEW of this book.

                                                                                                                    

Get instant access to over $1 million worth of books and videos.

  

Start a Free Trial


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint