|
Seems we cannot get in control of how the datastore provider is instantiated portably across all tests (bootstrapping via JPA allows only String-typed settings). So one alternative may be to establish a setting (VM property) which let's the provider not release the connection in stop(). That property would be set in the test run through the RedisTestHelper. The same would trigger release of the connection by means of a VM shutdown hook. That'd add a bit of test-only code to RedisDatastoreProvider, but I think it's still acceptable. There could be one test which explicitly overrides that setting to test the normal release upon stop().
|