Fix Python 2.5 compatibility
Fix Oracle JDK unit tests
Refactor unit test to use assertRaises()