keeganwitt / gmock

Automatically exported from code.google.com/p/gmock
6 stars 2 forks source link

Tests with gmock fail on Grails 2.0 RC2 and RC3 #120

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Run tests using gmock in bulk

What is the expected output? What do you see instead?
I expect tests to pass, but they fail.

What version of the product are you using? On what operating system?
Newest version from svn.

Please provide any additional information below.
Tests pass when run individually, but they fail when run alltogether though.

Caused by: groovy.lang.MissingMethodException: No signature of method: 
org.gmock.internal.recorder.MethodRecorder.plus() is applicable for argument 
types: (org.codehaus.groovy.runtime.GStringImpl) values: [config.]
Possible solutions: stub(), is(java.lang.Object), use([Ljava.lang.Object;), 
split(groovy.lang.Closure), wait(), once()
    ... 1 more

Original issue reported on code.google.com by Cygan.Kr...@gmail.com on 5 Dec 2011 at 8:12

GoogleCodeExporter commented 8 years ago
Please submit a reproducible test.

Original comment by JohnnyJianHY on 5 Dec 2011 at 8:35

GoogleCodeExporter commented 8 years ago
I've sent it to your mail, as I shouldn't upload it on public.

Original comment by Cygan.Kr...@gmail.com on 5 Dec 2011 at 8:53

GoogleCodeExporter commented 8 years ago
I have checked the test. It looks like some cleaning up is not doing properly. 
I need some time to debug.

Original comment by JohnnyJianHY on 13 Dec 2011 at 12:13

GoogleCodeExporter commented 8 years ago
I have located the issue. It is because you mock a String in 
EncodeUrlTitleTests.shouldSetUrlTitleToEncodedVersionOfTitle(), which is an 
empty string. And the empty mocked string is later used by Grails.

I think a potential fix of this bug is giving the String type special treatment 
while creating an instance of String inside Gmock.

Original comment by JohnnyJianHY on 14 Dec 2011 at 4:59

GoogleCodeExporter commented 8 years ago
OK, I finally figure it out. It is a bug of MetaClassRegistryCleaner in Grails. 
I cannot fix it on the side of Gmock. A patch to Grails is needed.

Original comment by JohnnyJianHY on 14 Dec 2011 at 7:38

GoogleCodeExporter commented 8 years ago
Please refer to http://jira.grails.org/browse/GRAILS-8488

Original comment by JohnnyJianHY on 14 Dec 2011 at 8:08

GoogleCodeExporter commented 8 years ago
Thanks for spending your time on this. I hope Grails team will get it fixed, as 
gmock is by far the best mocking framework for Groovy.

Original comment by Cygan.Kr...@gmail.com on 14 Dec 2011 at 9:12

GoogleCodeExporter commented 8 years ago
I am trying fix the bug, as I have already spent much time on it. :)

Original comment by JohnnyJianHY on 14 Dec 2011 at 9:15

GoogleCodeExporter commented 8 years ago
A patch is submitted, but you may have to wait for Grails 2.0.1.

Original comment by JohnnyJianHY on 15 Dec 2011 at 5:36

GoogleCodeExporter commented 8 years ago
Thanks, I really appreciate your effort.

Original comment by Cygan.Kr...@gmail.com on 15 Dec 2011 at 8:28