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

Guice Configuration Errors when running tests #50

Open
tenstriker opened this issue Dec 28, 2017 · 1 comment
Open

Guice Configuration Errors when running tests #50

tenstriker opened this issue Dec 28, 2017 · 1 comment

Comments

@tenstriker
Copy link

tenstriker commented Dec 28, 2017

I have few test classes defined in my maven-play2 project setup. All tests run fine from ScalaIDE when running as ScalaTest Suite/File/Package. But when I try to run it via maven command line it fails.
It also ignores @ignore decoration on test class and still runs it.

Here's the stacktrace
Cause: com.google.inject.ConfigurationException: Guice configuration errors:

  1. No implementation for com.mycomp.myproj.kap.KapDaoClient was bound.
    while locating com.mycomp.myproj.kap.KapDaoClient
    for the 1st parameter of com.mycomp.myproj.kap.KapServices

1 error
at com.google.inject.internal.InjectorImpl.getProvider(InjectorImpl.java:1045)
at com.google.inject.internal.InjectorImpl.getProvider(InjectorImpl.java:1004)
at com.google.inject.internal.InjectorImpl.getInstance(InjectorImpl.java:1054)
at play.api.inject.guice.GuiceInjector.instanceOf(GuiceInjectorBuilder.scala:409)
at play.api.inject.guice.GuiceInjector.instanceOf(GuiceInjectorBuilder.scala:404)
at play.api.inject.ContextClassLoaderInjector$$anonfun$instanceOf$2.apply(Injector.scala:117)
at play.api.inject.ContextClassLoaderInjector.withContext(Injector.scala:126)
at play.api.inject.ContextClassLoaderInjector.instanceOf(Injector.scala:117)
at com.mycomp.myproj.tests.functional.MetadataServiceSpec.(MetadataServiceSpec.scala:20)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
...
Run completed in 4 seconds, 585 milliseconds.
Total number of tests run: 4
Suites: completed 2, aborted 4
Tests: succeeded 2, failed 2, canceled 0, ignored 0, pending 0
*** 4 SUITES ABORTED ***
*** 2 TESTS FAILED ***

Plugin Configuration

		<plugin>
	      <groupId>org.scalatest</groupId>
	      <artifactId>scalatest-maven-plugin</artifactId>
	      <version>2.0.0</version>
		  <configuration>
		    <reportsDirectory>${project.build.directory}/target/surefire-reports</reportsDirectory>
		    <junitxml>.</junitxml>
		    <filereports>WDF_TestSuite.txt</filereports>
		    <parallel>false</parallel>
		    <forkMode>never</forkMode>
		  </configuration>
		  <executions>
		    <execution>
		      <id>test</id>
		      <goals>
		        <goal>test</goal>
		      </goals>
		    </execution>
		  </executions>
		</plugin>
@tenstriker
Copy link
Author

Looks like never caused an issue. It may be have to do with GuiceOneAppPerSuite class. If that's the case then that plugin option should be re-evaluated or be ignored if forkCount=0

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

1 participant