test-app unit: or integration: works, but test-app do not

classic Classic list List threaded Threaded
13 messages Options
Reply | Threaded
Open this post in threaded view
|

test-app unit: or integration: works, but test-app do not

moskinson
We have a problem in our project.

When we do 'grails test-app unit': or 'integration:' everything goes right, but when we do 'grails test-app' it fails with a MethodMissingException for some domain classes at integration tests,  unit tests passes.

Looking for a solution we discover this case:
We delete all unit tests unless one, with a domain class mocked.
In this unique unit test, If we delete the @Mock and only make "assert 1==1" everything goes right, and when we returned to use @Mock and use the domain class everything failed.

Now we are with no possible solutions,

Thanks for any help.
Reply | Threaded
Open this post in threaded view
|

Re: test-app unit: or integration: works, but test-app do not

moskinson
Anyone has the same problem?

test-app unit:  everything goes OK
test-app integration:  everything goes OK
test-app ERROR,
Reply | Threaded
Open this post in threaded view
|

Re: test-app unit: or integration: works, but test-app do not

alxndrsn
Are you using JUnit?

On 18 June 2012 12:17, moskinson <[hidden email]> wrote:

> Anyone has the same problem?
>
> test-app unit:  everything goes OK
> test-app integration:  everything goes OK
> test-app ERROR,
>
> --
> View this message in context: http://grails.1312388.n4.nabble.com/test-app-unit-or-integration-works-but-test-app-do-not-tp4629973p4630286.html
> Sent from the Grails - user mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
>    http://xircles.codehaus.org/manage_email
>
>

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|

Re: test-app unit: or integration: works, but test-app do not

moskinson
Yes, we are using JUnit, which is integrated with Grails 2.0
Reply | Threaded
Open this post in threaded view
|

Re: test-app unit: or integration: works, but test-app do not

Sebastian Gozin
In reply to this post by moskinson
I used to in grails-1.3 which had something to do with the in memory datasource being kept alive between integration and functional phase.

On 18 Jun 2012, at 11:17, moskinson wrote:

> Anyone has the same problem?
>
> test-app unit:  everything goes OK
> test-app integration:  everything goes OK
> test-app ERROR,
>
> --
> View this message in context: http://grails.1312388.n4.nabble.com/test-app-unit-or-integration-works-but-test-app-do-not-tp4629973p4630286.html
> Sent from the Grails - user mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
>    http://xircles.codehaus.org/manage_email
>
>


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|

Re: test-app unit: or integration: works, but test-app do not

basejump (Josh)
In reply to this post by moskinson
Same issue on some of our projects.
I cleared on up by removing export on hibernate dep

Same thing happens to me on another but I can't narrow down why
Reply | Threaded
Open this post in threaded view
|

Re: test-app unit: or integration: works, but test-app do not

moskinson
Thanks for your reply, we have already this configuration
runtime ":hibernate:$grailsVersion"
Reply | Threaded
Open this post in threaded view
|

Re: test-app unit: or integration: works, but test-app do not

rosenfeld
In reply to this post by moskinson
Em 18-06-2012 06:17, moskinson escreveu:
> Anyone has the same problem?

I had it once. I just gave up...

>
> test-app unit:  everything goes OK
> test-app integration:  everything goes OK
> test-app ERROR,
>


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|

Re: test-app unit: or integration: works, but test-app do not

moskinson
We have this configuration of hibernate and still failing...

With grails 2.04 Still it failing?
Reply | Threaded
Open this post in threaded view
|

Re: test-app unit: or integration: works, but test-app do not

Graeme Rocher
Administrator
Please raise a JIRA and attach an example that reproduces the problem

Cheers

On Wed, Jun 20, 2012 at 2:46 PM, moskinson <[hidden email]> wrote:

> We have this configuration of hibernate and still failing...
>
> With grails 2.04 Still it failing?
>
> --
> View this message in context: http://grails.1312388.n4.nabble.com/test-app-unit-or-integration-works-but-test-app-do-not-tp4629973p4630419.html
> Sent from the Grails - user mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
>    http://xircles.codehaus.org/manage_email
>
>



--
Graeme Rocher
Grails Project Lead
SpringSource - A Division of VMware
http://www.springsource.com

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|

Re: test-app unit: or integration: works, but test-app do not

moskinson
In reply to this post by Sebastian Gozin
How can I check this? And clean the memory?

thnaks everyone for the help
Reply | Threaded
Open this post in threaded view
|

Re: test-app unit: or integration: works, but test-app do not

Matt Sheehan
Maybe try this:

http://naleid.com/blog/2012/05/22/fixing-grails-tests-that-pass-in-isolation-but-fail-when-run-as-a-suite/


On Wed, Jun 20, 2012 at 10:09 AM, moskinson <[hidden email]> wrote:
How can I check this? And clean the memory?

thnaks everyone for the help

--
View this message in context: http://grails.1312388.n4.nabble.com/test-app-unit-or-integration-works-but-test-app-do-not-tp4629973p4630425.html
Sent from the Grails - user mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

   http://xircles.codehaus.org/manage_email



Reply | Threaded
Open this post in threaded view
|

Re: test-app unit: or integration: works, but test-app do not

moskinson
Thanks to everyone! I have resolved it!

This steps were the solution for me:
Into Integration test apply these rules:
- Not do mockDomains
- Not use annotations like @TestFor or @TestMixin
- Not make tests of TagLibs into Integration tests

We are a team of 10 devs and we have no time to control the code as we like.


Thanks, your help was the key!