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

Destroy WicketTester after each test that uses it

    Details

    • Type: Task
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 1.5-RC4
    • Fix Version/s: 1.5-RC5
    • Component/s: None
    • Labels:
      None
    • Environment:
      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

            • Assignee:
              mgrigorov Martin Grigorov
              Reporter:
              mgrigorov Martin Grigorov
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: