Uploaded image for project: 'Wicket'
  1. Wicket
  2. WICKET-3772

Destroy WicketTester after each test that uses it

    XMLWordPrintableJSON

Details

    • Task
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 1.5-RC4
    • 1.5-RC5
    • None
    • None
    • Wicket's own tests

    Description

      I found that org.apache.wicket.ApplicationSettingsTest was leaking the Application thread local because of wrong usage of @After - the test was JUnit 3 based (i.e. extends TestCase) and thus JUnit4 annotations are ignored.
      With this ticket most of the tests that use WicketTester are made to extend WicketTestCase which has proper setUp() and tearDown() methods to start WicketTester and destroy it.
      WicketTestCase uses the new WicketJUnitRunner which is a JUnit4 runner that can run both JUnit3 tests and JUnit4 tests. This is needed because many of the old tests are still JUnit3 based. Now they can be easily migrated to JUnit4 when someone needs to touch them.

      Attachments

        Activity

          People

            mgrigorov Martin Tzvetanov Grigorov
            mgrigorov Martin Tzvetanov Grigorov
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: