Guice provision errors (CoreSession) in junit test

129 views
Skip to first unread message

Marc Dutoo

unread,
Feb 21, 2013, 9:31:55 AM2/21/13
to easysoa-dev
Hello


solution :

change
@RepositoryConfig(type = BackendType.H2, init = PublishRepositoryInit.class, user = "Administrator", cleanup = Granularity.METHOD)

to
Granularity.CLASS

see https://github.com/easysoa/EasySOA/wiki/Nuxeo-quick-reference

a+
Marc

Le 21/02/2013 14:31, Marc Dutoo a �crit :
> Error :
>
> -------------------------------------------------------------------------------
>
> Test set: org.nuxeo.snapshot.TestSnapshotEvent
> -------------------------------------------------------------------------------
>
> Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 2.588
> sec <<< FAILURE!
> testEvent(org.nuxeo.snapshot.TestSnapshotEvent) Time elapsed: 0.019
> sec <<< ERROR!
> com.google.inject.ProvisionException: Guice provision errors:
>
> 1) null returned by binding at
> org.nuxeo.runtime.test.runner.RuntimeFeature.bind0(RuntimeFeature.java:196)
> but org.nuxeo.snapshot.AbstractTestSnapshot.session is not @Nullable
> at
> org.nuxeo.runtime.test.runner.RuntimeFeature.bind0(RuntimeFeature.java:196)
> while locating org.nuxeo.ecm.core.api.CoreSession
> for field at
> org.nuxeo.snapshot.AbstractTestSnapshot.session(AbstractTestSnapshot.java:8)
> while locating org.nuxeo.snapshot.TestSnapshotEvent
>
> 1 error
> at
> com.google.inject.internal.InjectorImpl$4.get(InjectorImpl.java:987)
> at
> com.google.inject.internal.InjectorImpl.getInstance(InjectorImpl.java:1013)
> at
> org.nuxeo.runtime.test.runner.FeaturesRunner.createTest(FeaturesRunner.java:306)
> at
> org.junit.runners.BlockJUnit4ClassRunner$1.runReflectiveCall(BlockJUnit4ClassRunner.java:236)
> at
> org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
> at
> org.junit.runners.BlockJUnit4ClassRunner.methodBlock(BlockJUnit4ClassRunner.java:233)
> at
> org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:68)
> at
> org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:47)
> at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231)
> at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60)
> at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229)
> at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50)
> at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222)
> at org.junit.runners.ParentRunner.run(ParentRunner.java:300)
> at
> org.nuxeo.runtime.test.runner.FeaturesRunner.run(FeaturesRunner.java:289)
> at
> org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:53)
> at
> org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:123)
> at
> org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:104)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> at java.lang.reflect.Method.invoke(Method.java:597)
> at
> org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:164)
> at
> org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:110)
> at
> org.apache.maven.surefire.booter.SurefireStarter.invokeProvider(SurefireStarter.java:175)
> at
> org.apache.maven.surefire.booter.SurefireStarter.runSuitesInProcessWhenForked(SurefireStarter.java:107)
> at
> org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:68)


Arnaud Kervern

unread,
Feb 22, 2013, 6:17:19 AM2/22/13
to easys...@googlegroups.com
Hi all,

After some investigations; this issue is related to maven3. When using it, surefire executes the test cases with the wrong junit.
We are currently working on fixing this, you can track our changes with https://jira.nuxeo.com/browse/NXP-10821.

Marc, as EasySOA is aligned on a date based release; you'll need to update your poms to change the version to 5.7-SNAPSHOT. 


On 21 February 2013 15:31, Marc Dutoo <marc....@openwide.fr> wrote:
Hello


solution :

change
@RepositoryConfig(type = BackendType.H2, init = PublishRepositoryInit.class, user = "Administrator", cleanup = Granularity.METHOD)

to
Granularity.CLASS

see https://github.com/easysoa/EasySOA/wiki/Nuxeo-quick-reference

a+
Marc

--
--
EasySOA - lighter, agile, collaborative Service Integration and Management
http://www.easysoa.org
http://github.com/easysoa

You received this message because you are subscribed to the Google
Groups "easysoa-dev" group.
To post to this group, send email to easys...@googlegroups.com
To unsubscribe from this group, send email to
easysoa-dev+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/easysoa-dev?hl=fr

--- Vous recevez ce message, car vous êtes abonné au groupe Google Groupes easysoa-dev.
Pour vous désabonner de ce groupe et ne plus recevoir d'e-mails le concernant, envoyez un e-mail à l'adresse easysoa-dev+unsubscribe@googlegroups.com.
Pour plus d'options, visitez le site https://groups.google.com/groups/opt_out .



Marc Dutoo

unread,
Feb 25, 2013, 5:21:26 AM2/25/13
to easys...@googlegroups.com, Arnaud Kervern
Great news ! Because I've tried to switch to executing Maven 2 but Eclipse doesn't want to debug tests (local or remote) without complete classpath change ;_;
I'll do that ASAP.

Regards,
Marc

For more options, visit this group at
http://groups.google.com/group/easysoa-dev?hl=fr

--- Vous recevez ce message, car vous êtes abonné au groupe Google Groupes easysoa-dev.
Pour vous désabonner de ce groupe et ne plus recevoir d'e-mails le concernant, envoyez un e-mail à l'adresse easysoa-dev...@googlegroups.com.

Pour plus d'options, visitez le site https://groups.google.com/groups/opt_out .


--
--
EasySOA - lighter, agile, collaborative Service Integration and Management
http://www.easysoa.org
http://github.com/easysoa
 
You received this message because you are subscribed to the Google
Groups "easysoa-dev" group.
To post to this group, send email to easys...@googlegroups.com
To unsubscribe from this group, send email to

For more options, visit this group at
http://groups.google.com/group/easysoa-dev?hl=fr
 
---
Vous recevez ce message, car vous êtes abonné au groupe Google Groupes easysoa-dev.
Pour vous désabonner de ce groupe et ne plus recevoir d'e-mails le concernant, envoyez un e-mail à l'adresse easysoa-dev...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages