Closed GoogleCodeExporter closed 8 years ago
I can confirm, that I have the same issue, where I create the mock in the def
setup() methode. The first test methode works, but subsequently they fail with
StackOverflowError here:
org.codehaus.groovy.util.AbstractConcurrentMap.getOrPut(AbstractConcurrentMap.ja
va:35)
Original comment by soe...@glasius.dk
on 10 Apr 2012 at 1:11
ok, I will check whether it is the problem of gmock or is of spock once I have
time.
Original comment by JohnnyJianHY
on 10 Apr 2012 at 1:15
We have the same issue in our project as well, and we are not using Spock. We
are running Grails 2.0.3 with GMock 0.8.2.
We found a dodgy work-around for this. If we add:
File.metaClass.constructor = { path -> new File(path) }
before calling the mock() with constructor, it seems to work most of the times.
Original comment by w...@vith.me
on 12 Apr 2012 at 11:25
Original comment by JohnnyJianHY
on 14 Apr 2012 at 4:49
A fix is uploaded on the trunk, please confirm that it works.
This is all because of the buggy MetaClassRegistryCleaner of Grails. It's
really a mess, one fix brings more bugs. So I need to temporarily disable it
while setting metaclasses.
Original comment by JohnnyJianHY
on 1 May 2012 at 5:01
I've built the latest from trunk and added it to my grails lib folder (and
removed 0.8.2 from BuildConfig.groovy). I've also updated to grails 2.0.3.
Now my spec gives the following error:
1: A transform used a generics containing ClassNode groovy.lang.Closure <V
extends java.lang.Object -> java.lang.Object> for the method protected
java.lang.Object ordered(groovy.lang.Closure closure) { ... } directly. You
are not suppposed to do this. Please create a new ClassNode refering to the old
ClassNode and use the new ClassNode instead of the old one. Otherwise the
compiler will create wrong descriptors and a potential NullPointerException in
TypeResolver in the OpenJDK. If this is not your own doing, please report this
bug to the writer of the transform.
Original comment by gus.j.po...@gmail.com
on 3 Jun 2012 at 3:11
That bug of the transformation has been fixed before, please refer to issue 115.
I tried to checkout and build a snapshot of the latest trunk, create a new app
using grails 2.0.4, and copy the built gmock jar into the app's lib folder.
Then I write a simple unit test using the "@WithGMock" transformation, it works
fine!
Maybe you should do "grails clean" on your app first?
Original comment by JohnnyJianHY
on 30 Jun 2012 at 4:37
Hi,
Just to let you know that I encountered this stackoverflow bug and with the
snapshot from trunk everything is working fine.
I am using Grails 2.1.1, Spock 0.6 and of course GMock snapshot.
Regarding this bug as a critical one for me, could you please release the 0.8.3
as an interim version before getting this to the 0.9? (Or is there any change
to backport this fix into 0.8.2 and make the 0.8.3 release?)
Original comment by chanwit
on 15 Nov 2012 at 3:39
Original comment by JohnnyJianHY
on 19 Feb 2013 at 11:47
Original issue reported on code.google.com by
gus.j.po...@gmail.com
on 18 Feb 2012 at 5:27