Correctness of tests is order dependent, ThreadContext.detach not always called
-------------------------------------------------------------------------------

                 Key: WICKET-3178
                 URL: https://issues.apache.org/jira/browse/WICKET-3178
             Project: Wicket
          Issue Type: Bug
          Components: wicket
    Affects Versions: 1.5-M3
         Environment: My own build env which uses Ant.
            Reporter: Richard Emberson


I have my own build/test env for Wicket and the order in which tests are 
executed are not necessarily the same as the order that Maven drives
the tests in the standard test env.

If you can manage to run only the tests
org.apache.wicket.request.cycle.RequestCycleListenerTest testBasicOperations
followed by test 
org.apache.wicket.request.mapper.BasicResourceReferenceMapperTest testDecode1
the BasicResourceReferenceMapperTest test will fail because it
requires that the ThreadContext have NO application, but the
RequestCycleListenerTest does not have a tearDown method
that calls ThreadContext.detach (nor does it use the BaseWicketTester
with its tearDown method) so it leaves an application in the ThreadContext.
Also, BasicResourceReferenceMapperTest does not use the
BaseWicketTester which calls detach in its constructor.

The solution is to add the following to BasicResourceReferenceMapperTest

protected void setUp() { org.apache.wicket.ThreadContext.detach(); }

In my test env it is simply two lines in a property file to have only the above
two tests execute (and in the order specified). Don't know how to do that in 
Maven.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to