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

Adding Unit Tests #1

Closed
wants to merge 19 commits into from
Closed

Adding Unit Tests #1

wants to merge 19 commits into from

Conversation

mrserverless
Copy link
Collaborator

Merging in some unit tests I wrote as part of my guice-bridge PR HubSpot#47

Updated dropwizard version to 0.8.0-rc3-SNAPSHOT because that version is in oss.sonatype.org

The github diff seem to be showing up incorrectly. Maybe it's easier to do a diff against my jersey2-guice branch.

… after Dropwizard run() method, in ServletContainer.init().
updated README.md to reflect Tasks need to be injected with a name in order to use AutoConfig
…nto jersey2-guice

Conflicts:
	pom.xml
	src/main/java/com/hubspot/dropwizard/guice/AutoConfig.java
	src/main/java/com/hubspot/dropwizard/guice/GuiceBundle.java
	src/main/java/com/hubspot/dropwizard/guice/GuiceContainer.java
Conflicts:
	pom.xml
	src/main/java/com/hubspot/dropwizard/guice/AutoConfig.java
	src/main/java/com/hubspot/dropwizard/guice/GuiceBundle.java
	src/main/java/com/hubspot/dropwizard/guice/GuiceContainer.java
… need to be moved to HK2LinkerTest.

also moved test objects into separate package for clarity.
…dency.

Also added back JerseyModule which was missed in the merge.
@oillio oillio closed this Jan 22, 2015
@oillio
Copy link
Owner

oillio commented Jan 22, 2015

I merged it in manually.

Also, I may have misunderstood the issues with the JIT functionality.
I was playing around with the tests in my version vs. your version.
Both versions seem to handle JIT bindings the same way. For instance, InjectedTask should be JIT bound. Both versions will createAndInitialize it without issue.
In your implementation, what are you doing that requires an explicit binding?

@mrserverless
Copy link
Collaborator Author

Yes top level JIT objects such as InjectedTask works. But JIT objects one level down doesn't work in guice-bridge.

See my H2Linker test in https://github.com/yunspace/dropwizard-guice/tree/jersey2-guice. A JITResource contains a JITDao, guice-bridge fails to resolve the JITDao but using jersey2-guice works.

Feel free to pull this one in, this is possibly the most crucial test.

oillio pushed a commit that referenced this pull request May 12, 2015
Altered GuiceBundle to allow setting of ServletContextListeners
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

Successfully merging this pull request may close these issues.

2 participants