Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Properly reset ServiceLocatorGenerator / RuntimeDelegate in a test environment #50

Open
BenRomberg opened this issue Mar 12, 2015 · 1 comment

Comments

@BenRomberg
Copy link

I had problems using the DropwizardAppRule together with a legacy embedded Jersey Server not using Dropwizard, running in the same JVM for our tests.

The dropwizard-guice module overrides the ServiceLocatorGenerator and RuntimeDelegate in BootstrapUtils.install without ever resetting them, breaking our legacy Jersey server when it wants to boot up (saying that the ServiceLocatorImpl "has been shut down").

This can be fixed manually by enhancing the DropwizardAppRule with

BootstrapUtils.reset();

after the Rule has shutdown.

Unfortunately I couldn't find any references to BootstrapUtils.reset() in the dropwizard-guice code. Maybe there's a way to call that generally when the Jersey server is shutting down or at least in the test environment enhancing the DropwizardAppRule (prolly by providing an own test-rule).

@mrserverless
Copy link
Contributor

Yes this workaround was mentioned in #45 and @oillio added BootstrapUtils.reset() into the GuiceBundleTest: oillio@611a334

This should be documented into the README... along with the rest of the updated 0.8.0 information ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants