I don't mean to spoil your discovery, but isn't that kind of obvious?
All JUnit does is call:
setUp()
testFoo()
tearDown()
Once for each test.
So if you set a reference only in setUp(), the next time it gets set again will be in the
next time setUp() is called.
When one reference overwrites the other, then the old reference will be eligible for
garbage collection.
That's nothing special about how JUnit works, it's just Java references and gc.
View the original post :
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4249150#...
Reply to the post :
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&a...