make application context for test framework more consistent with runtime

backport of #441.
Merge branch '2.3.x' of git://github.com/geoserver/geoserver into 2.3.x