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

[2.4.0-M2] Function tests using testServer / Selenium Webdriver makes Guice blow up #3895

Closed
igmar opened this issue Feb 4, 2015 · 6 comments

Comments

@igmar
Copy link

igmar commented Feb 4, 2015

Hi,

I'm trying to unit-test my new shiny 2.4.0-M2 app. That doesn't end well : I see Guice blowing up the moment the testServer() code starts to run. The application works fine outside the testscope.

The stacktrace is pretty much useless due to issue #3768

Any clues on how to proceed ? I can help debug this, since it's running on my devbox.

@jroper
Copy link
Member

jroper commented Feb 5, 2015

Can you test it with Java 7?

@jroper
Copy link
Member

jroper commented Feb 5, 2015

Another straight forward fix is to add this to your libraryDependencies:

"com.google.inject" % "guice" % "3.0" classifier "no_aop"

@igmar
Copy link
Author

igmar commented Feb 5, 2015

testing with Java7 is going to be an issue : The code is full of stuff that is Java8 only. I'll apply your fix, and see if I can get a decent stacktrace.

@igmar
Copy link
Author

igmar commented Feb 5, 2015

That shed some light :

[error] Test CoolgamesRouterTest.testRoutes failed: java.lang.RuntimeException: com.google.inject.ProvisionException: Guice provision errors:
[error]
[error] 1) No implementation for com.bm.template.TemplateRenderer was bound.
[error] while locating com.bm.template.TemplateRenderer
[error] for field at controllers.Asset.renderer(Unknown Source)
[error] while locating controllers.Asset
[error] for parameter 3 at Routes.(Unknown Source)
[error] while locating Routes
[error] at play.api.test.FakeBuiltinModule.bindings(Fakes.scala:299):
[error] Binding(interface play.core.Router$Routes to ProviderTarget(play.api.test.FakeRoutesProvider@78ff57e))
[error] while locating play.core.Router$Routes

I'll recheck : This is probably an error on my part, or the play.modules.enabled don't work. I'll reopen if this is really an issue with Play!

@igmar igmar closed this as completed Feb 5, 2015
@igmar
Copy link
Author

igmar commented Feb 5, 2015

Related question : Is it handy that I run Play from the master branch ? For testing etc ?

@jroper
Copy link
Member

jroper commented Feb 6, 2015

Yes.

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