FINRAOS/JTAF-ExtWebDriver — pull request #20 by bryantrobbins (2013-12-20 22:33:59+00:00)
Title: Fix for #19:

SessionManager now correctly persists sessionFactory setting ThreadLocal.

Some design notes:

1) The problem was that getInstance() in the previous version was setting the factory to DefaultSessionFactory().

2) To get around this, we needed to set the factory to the user's desired factory (sessionFactory) instead.

3) The desired factory cannot be local, as it would not be accessible from getInstance(), which must be static.

4) The factory should have the same scope as the SessionManager, which is thread local. This allows test suites to mix factories at a test or class level. This is a desired feature, and is an intended behavior of SessionManager.

5) I changed sessionFactory to a ThreadLocal with a default value of the DefaultSessionFactory.

6) With this functionality working as intended, we need to update our SessionManager tests to appropriately set the factory back to default after each test execution.