Integration Tests with Multi-Tenant plugin

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
15 messages Options
Reply | Threaded
Open this post in threaded view
|

Integration Tests with Multi-Tenant plugin

lucastex
Hello all,

We're developing a mult-tenant app using the multi-tenant plugin.
But our integration tests are failing due it does not have a tentantId in the current request context.

No such property: tenantId for class: MultiTenantGrailsPlugin

groovy.lang.MissingPropertyException: No such property: tenantId for class: MultiTenantGrailsPlugin
at MultiTenantGrailsPlugin$_closure5_closure29_closure30.doCall(MultiTenantGrailsPlugin.groovy:226)
at MultiTenantGrailsPlugin$_closure5_closure29_closure30.doCall(MultiTenantGrailsPlugin.groovy)
at com.infusion.util.domain.event.hibernate.InterceptableSession.saveOrUpdate(InterceptableSession.java:569)
at $Proxy15.saveOrUpdate(Unknown Source)
at imob.web.AreaControllerTests.testListagemDasAreasComPaginacao(AreaControllerTests.groovy:59)


Is there some way to inject some dummy tenant in the current context, so tests would pass (I hope so) ?

Thanks a lot,

[]s,

Lucas


Lucas Frare Teixeira .·.
- [hidden email]
- lucastex.com.br
- blog.lucastex.com
- twitter.com/lucastex
Reply | Threaded
Open this post in threaded view
|

Re: Integration Tests with Multi-Tenant plugin

lucastex
Hello again,

Digging a little on this error, I've opened the MultiTenantGrailsPlugin class (multi-tenant plugin descriptor) and saw that the error (missing property tenantId in that class) points to the "doWithDynamicMethods" closure:

    def doWithDynamicMethods = {ctx ->

        if (ConfigurationHolder.config.tenant.mode != "singleTenant")
        {
            //Add a nullable contraint for tenantId.
            application.domainClasses.each {DefaultGrailsDomainClass domainClass ->
                domainClass.constraints?.get("tenantId")?.applyConstraint(ConstrainedProperty.NULLABLE_CONSTRAINT, true);
                domainClass.clazz.metaClass.beforeInsert = {
here =>             if (tenantId == null) tenantId = 0
                }
            }
        }

        TenantUtils.ready = true
    }

Looking into this closure (and in the class attributes) I couldn't find the declaration for the tenantId property.
This works with no problem when running the app (and the closure is executed), but when running tests, I got this error...

Does anybody know why is this happening and some way to solve it? It is breaking all integration tests that manipulate @multitenant marked domain classes.

Thanks a lot...

[]s,


Lucas Frare Teixeira .·.
- [hidden email]
- lucastex.com.br
- blog.lucastex.com
- twitter.com/lucastex


On Sat, Oct 16, 2010 at 9:18 PM, Lucas F. A. Teixeira <[hidden email]> wrote:
Hello all,

We're developing a mult-tenant app using the multi-tenant plugin.
But our integration tests are failing due it does not have a tentantId in the current request context.

No such property: tenantId for class: MultiTenantGrailsPlugin

groovy.lang.MissingPropertyException: No such property: tenantId for class: MultiTenantGrailsPlugin
at MultiTenantGrailsPlugin$_closure5_closure29_closure30.doCall(MultiTenantGrailsPlugin.groovy:226)
at MultiTenantGrailsPlugin$_closure5_closure29_closure30.doCall(MultiTenantGrailsPlugin.groovy)
at com.infusion.util.domain.event.hibernate.InterceptableSession.saveOrUpdate(InterceptableSession.java:569)
at $Proxy15.saveOrUpdate(Unknown Source)
at imob.web.AreaControllerTests.testListagemDasAreasComPaginacao(AreaControllerTests.groovy:59)


Is there some way to inject some dummy tenant in the current context, so tests would pass (I hope so) ?

Thanks a lot,

[]s,

Lucas


Lucas Frare Teixeira .·.
- [hidden email]
- lucastex.com.br
- blog.lucastex.com
- twitter.com/lucastex

Reply | Threaded
Open this post in threaded view
|

Re: Integration Tests with Multi-Tenant plugin

lucastex
Sorry for another mail on this, but I found some interesting point...

Ok, I saw that that closure was actually being injected in the domains class metaClass, so, that "tenantId" is actually being referenced inside the domain class, ok...

But the point is that the class that is being saved does not have the @MultiTenant annotation, so, it does not have the "tenantId", and that's why the test is failing.

But why this domain class save() method is being intercepted by the plugin if there isn't the annotation?

Shouldn't that closure validate if the domain class have this property (or the annotation) ?
But if I move the domain class save snippet to the Controller instead of the test, it works with no problem... Any ideas?

Thanks again ppl...

[]s,


Lucas Frare Teixeira .·.
- [hidden email]
- lucastex.com.br
- blog.lucastex.com
- twitter.com/lucastex


On Sat, Oct 16, 2010 at 10:39 PM, Lucas F. A. Teixeira <[hidden email]> wrote:
Hello again,

Digging a little on this error, I've opened the MultiTenantGrailsPlugin class (multi-tenant plugin descriptor) and saw that the error (missing property tenantId in that class) points to the "doWithDynamicMethods" closure:

    def doWithDynamicMethods = {ctx ->

        if (ConfigurationHolder.config.tenant.mode != "singleTenant")
        {
            //Add a nullable contraint for tenantId.
            application.domainClasses.each {DefaultGrailsDomainClass domainClass ->
                domainClass.constraints?.get("tenantId")?.applyConstraint(ConstrainedProperty.NULLABLE_CONSTRAINT, true);
                domainClass.clazz.metaClass.beforeInsert = {
here =>             if (tenantId == null) tenantId = 0
                }
            }
        }

        TenantUtils.ready = true
    }

Looking into this closure (and in the class attributes) I couldn't find the declaration for the tenantId property.
This works with no problem when running the app (and the closure is executed), but when running tests, I got this error...

Does anybody know why is this happening and some way to solve it? It is breaking all integration tests that manipulate @multitenant marked domain classes.


Thanks a lot...

[]s,


Lucas Frare Teixeira .·.
- [hidden email]
- lucastex.com.br
- blog.lucastex.com
- twitter.com/lucastex


On Sat, Oct 16, 2010 at 9:18 PM, Lucas F. A. Teixeira <[hidden email]> wrote:
Hello all,

We're developing a mult-tenant app using the multi-tenant plugin.
But our integration tests are failing due it does not have a tentantId in the current request context.

No such property: tenantId for class: MultiTenantGrailsPlugin

groovy.lang.MissingPropertyException: No such property: tenantId for class: MultiTenantGrailsPlugin
at MultiTenantGrailsPlugin$_closure5_closure29_closure30.doCall(MultiTenantGrailsPlugin.groovy:226)
at MultiTenantGrailsPlugin$_closure5_closure29_closure30.doCall(MultiTenantGrailsPlugin.groovy)
at com.infusion.util.domain.event.hibernate.InterceptableSession.saveOrUpdate(InterceptableSession.java:569)
at $Proxy15.saveOrUpdate(Unknown Source)
at imob.web.AreaControllerTests.testListagemDasAreasComPaginacao(AreaControllerTests.groovy:59)


Is there some way to inject some dummy tenant in the current context, so tests would pass (I hope so) ?

Thanks a lot,

[]s,

Lucas


Lucas Frare Teixeira .·.
- [hidden email]
- lucastex.com.br
- blog.lucastex.com
- twitter.com/lucastex


Reply | Threaded
Open this post in threaded view
|

Re: Integration Tests with Multi-Tenant plugin

scryan
I  apologize that no one has gotten back to you yet.  I am in the midst of working on the re-factor of the plugin into more manageable pieces along with several other developers.  We hope to make the plugin much more modular and add a lot of new function.  I am mainly working on the multiple database scenario code but I know there are developers working on the single database mode and hopefully they will be able to answer your question.  I will look into your issue at the beginning of the week and see if I can suggestion a solution.  Please feel free to let us know any improvements we can make to the plugin to make it easier to use or understand.  My integration tests run mainly against the multiple database scenario so I have not seen the issue.  During the re-factor we will be adding a lot more tests and a demo application as well.  We will be hosting the code on Github and posting more details on the plugin portal as we progress.  

I am sorry i don't have a solution right now as I am away from my computer but will try to look into in at the beginning of the week and hopefully one of the other developers can do the same


Scott Ryan









On Oct 16, 2010, at 8:15 PM, Lucas F. A. Teixeira wrote:

Sorry for another mail on this, but I found some interesting point...

Ok, I saw that that closure was actually being injected in the domains class metaClass, so, that "tenantId" is actually being referenced inside the domain class, ok...

But the point is that the class that is being saved does not have the @MultiTenant annotation, so, it does not have the "tenantId", and that's why the test is failing.

But why this domain class save() method is being intercepted by the plugin if there isn't the annotation?

Shouldn't that closure validate if the domain class have this property (or the annotation) ?
But if I move the domain class save snippet to the Controller instead of the test, it works with no problem... Any ideas?

Thanks again ppl...

[]s,


Lucas Frare Teixeira .·.
- [hidden email]
- lucastex.com.br
- blog.lucastex.com
- twitter.com/lucastex


On Sat, Oct 16, 2010 at 10:39 PM, Lucas F. A. Teixeira <[hidden email]> wrote:
Hello again,

Digging a little on this error, I've opened the MultiTenantGrailsPlugin class (multi-tenant plugin descriptor) and saw that the error (missing property tenantId in that class) points to the "doWithDynamicMethods" closure:

    def doWithDynamicMethods = {ctx ->

        if (ConfigurationHolder.config.tenant.mode != "singleTenant")
        {
            //Add a nullable contraint for tenantId.
            application.domainClasses.each {DefaultGrailsDomainClass domainClass ->
                domainClass.constraints?.get("tenantId")?.applyConstraint(ConstrainedProperty.NULLABLE_CONSTRAINT, true);
                domainClass.clazz.metaClass.beforeInsert = {
here =>             if (tenantId == null) tenantId = 0
                }
            }
        }

        TenantUtils.ready = true
    }

Looking into this closure (and in the class attributes) I couldn't find the declaration for the tenantId property.
This works with no problem when running the app (and the closure is executed), but when running tests, I got this error...

Does anybody know why is this happening and some way to solve it? It is breaking all integration tests that manipulate @multitenant marked domain classes.


Thanks a lot...

[]s,


Lucas Frare Teixeira .·.
- [hidden email]
- lucastex.com.br
- blog.lucastex.com
- twitter.com/lucastex


On Sat, Oct 16, 2010 at 9:18 PM, Lucas F. A. Teixeira <[hidden email]> wrote:
Hello all,

We're developing a mult-tenant app using the multi-tenant plugin.
But our integration tests are failing due it does not have a tentantId in the current request context.

No such property: tenantId for class: MultiTenantGrailsPlugin

groovy.lang.MissingPropertyException: No such property: tenantId for class: MultiTenantGrailsPlugin
at MultiTenantGrailsPlugin$_closure5_closure29_closure30.doCall(MultiTenantGrailsPlugin.groovy:226)
at MultiTenantGrailsPlugin$_closure5_closure29_closure30.doCall(MultiTenantGrailsPlugin.groovy)
at com.infusion.util.domain.event.hibernate.InterceptableSession.saveOrUpdate(InterceptableSession.java:569)
at $Proxy15.saveOrUpdate(Unknown Source)
at imob.web.AreaControllerTests.testListagemDasAreasComPaginacao(AreaControllerTests.groovy:59)


Is there some way to inject some dummy tenant in the current context, so tests would pass (I hope so) ?

Thanks a lot,

[]s,

Lucas


Lucas Frare Teixeira .·.
- [hidden email]
- lucastex.com.br
- blog.lucastex.com
- twitter.com/lucastex



Reply | Threaded
Open this post in threaded view
|

Re: Integration Tests with Multi-Tenant plugin

lucastex
Hello Scott,

I've digged more and more on this problem and made some tests. As expected, if I just add the @MultiTenant annotation in my class, or even if I add a simple "Integer tenantId" on that domain class, it would work, because the property would be found.
But I can't, since this class is shared among all tenants...

So, the behaviour I'm seeing, is that when the tenant mode is "singleTenant" is trying to deal with a tenantId attribute in all classes, even if they don't have the annotation.

This is what I saw, this is what the closure is doing, it does not check the annotation in *all* domain classes:

  application.domainClasses.each { DefaultGrailsDomainClass domainClass ->
    domainClass.constraints?.get("tenantId")?.applyConstraint(ConstrainedProperty.NULLABLE_CONSTRAINT, true);
    domainClass.clazz.metaClass.beforeInsert = {
       if (tenantId == null) tenantId = 0
    }
}


I've done a simple app with the plugin, just to simple domain classes, one annotated and the other not.
A simple controller that tries to save both instances. This is a simple app with NO OTHER stuff than this, and we can see the failing when trying to save a non-annotated domain class.

It is attached here, I'll raise a JIRA either.

I don't know about priorities on this project, but IMO, it is a blocker issue since it does not allow users to have non-multi-tenant domain classes in this kind of environment.

[]s,



Lucas Frare Teixeira .·.
- [hidden email]
- lucastex.com.br
- blog.lucastex.com
- twitter.com/lucastex


On Sun, Oct 17, 2010 at 12:53 AM, Scott Ryan <[hidden email]> wrote:
I  apologize that no one has gotten back to you yet.  I am in the midst of working on the re-factor of the plugin into more manageable pieces along with several other developers.  We hope to make the plugin much more modular and add a lot of new function.  I am mainly working on the multiple database scenario code but I know there are developers working on the single database mode and hopefully they will be able to answer your question.  I will look into your issue at the beginning of the week and see if I can suggestion a solution.  Please feel free to let us know any improvements we can make to the plugin to make it easier to use or understand.  My integration tests run mainly against the multiple database scenario so I have not seen the issue.  During the re-factor we will be adding a lot more tests and a demo application as well.  We will be hosting the code on Github and posting more details on the plugin portal as we progress.  

I am sorry i don't have a solution right now as I am away from my computer but will try to look into in at the beginning of the week and hopefully one of the other developers can do the same


Scott Ryan









On Oct 16, 2010, at 8:15 PM, Lucas F. A. Teixeira wrote:

Sorry for another mail on this, but I found some interesting point...

Ok, I saw that that closure was actually being injected in the domains class metaClass, so, that "tenantId" is actually being referenced inside the domain class, ok...

But the point is that the class that is being saved does not have the @MultiTenant annotation, so, it does not have the "tenantId", and that's why the test is failing.

But why this domain class save() method is being intercepted by the plugin if there isn't the annotation?

Shouldn't that closure validate if the domain class have this property (or the annotation) ?
But if I move the domain class save snippet to the Controller instead of the test, it works with no problem... Any ideas?

Thanks again ppl...

[]s,


Lucas Frare Teixeira .·.
- [hidden email]
- lucastex.com.br
- blog.lucastex.com
- twitter.com/lucastex


On Sat, Oct 16, 2010 at 10:39 PM, Lucas F. A. Teixeira <[hidden email]> wrote:
Hello again,

Digging a little on this error, I've opened the MultiTenantGrailsPlugin class (multi-tenant plugin descriptor) and saw that the error (missing property tenantId in that class) points to the "doWithDynamicMethods" closure:

    def doWithDynamicMethods = {ctx ->

        if (ConfigurationHolder.config.tenant.mode != "singleTenant")
        {
            //Add a nullable contraint for tenantId.
            application.domainClasses.each {DefaultGrailsDomainClass domainClass ->
                domainClass.constraints?.get("tenantId")?.applyConstraint(ConstrainedProperty.NULLABLE_CONSTRAINT, true);
                domainClass.clazz.metaClass.beforeInsert = {
here =>             if (tenantId == null) tenantId = 0
                }
            }
        }

        TenantUtils.ready = true
    }

Looking into this closure (and in the class attributes) I couldn't find the declaration for the tenantId property.
This works with no problem when running the app (and the closure is executed), but when running tests, I got this error...

Does anybody know why is this happening and some way to solve it? It is breaking all integration tests that manipulate @multitenant marked domain classes.


Thanks a lot...

[]s,


Lucas Frare Teixeira .·.
- [hidden email]
- lucastex.com.br
- blog.lucastex.com
- twitter.com/lucastex


On Sat, Oct 16, 2010 at 9:18 PM, Lucas F. A. Teixeira <[hidden email]> wrote:
Hello all,

We're developing a mult-tenant app using the multi-tenant plugin.
But our integration tests are failing due it does not have a tentantId in the current request context.

No such property: tenantId for class: MultiTenantGrailsPlugin

groovy.lang.MissingPropertyException: No such property: tenantId for class: MultiTenantGrailsPlugin
at MultiTenantGrailsPlugin$_closure5_closure29_closure30.doCall(MultiTenantGrailsPlugin.groovy:226)
at MultiTenantGrailsPlugin$_closure5_closure29_closure30.doCall(MultiTenantGrailsPlugin.groovy)
at com.infusion.util.domain.event.hibernate.InterceptableSession.saveOrUpdate(InterceptableSession.java:569)
at $Proxy15.saveOrUpdate(Unknown Source)
at imob.web.AreaControllerTests.testListagemDasAreasComPaginacao(AreaControllerTests.groovy:59)


Is there some way to inject some dummy tenant in the current context, so tests would pass (I hope so) ?

Thanks a lot,

[]s,

Lucas


Lucas Frare Teixeira .·.
- [hidden email]
- lucastex.com.br
- blog.lucastex.com
- twitter.com/lucastex





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

    http://xircles.codehaus.org/manage_email

test-mt.zip (254K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Integration Tests with Multi-Tenant plugin

lucastex
I've opened the issue...

It is here:  http://jira.codehaus.org/browse/GRAILSPLUGINS-2579

Thanks a lot,

[]s,

Lucas Frare Teixeira .·.
- [hidden email]
- lucastex.com.br
- blog.lucastex.com
- twitter.com/lucastex


On Sun, Oct 17, 2010 at 1:30 PM, Lucas F. A. Teixeira <[hidden email]> wrote:
Hello Scott,

I've digged more and more on this problem and made some tests. As expected, if I just add the @MultiTenant annotation in my class, or even if I add a simple "Integer tenantId" on that domain class, it would work, because the property would be found.
But I can't, since this class is shared among all tenants...

So, the behaviour I'm seeing, is that when the tenant mode is "singleTenant" is trying to deal with a tenantId attribute in all classes, even if they don't have the annotation.

This is what I saw, this is what the closure is doing, it does not check the annotation in *all* domain classes:


  application.domainClasses.each { DefaultGrailsDomainClass domainClass ->
    domainClass.constraints?.get("tenantId")?.applyConstraint(ConstrainedProperty.NULLABLE_CONSTRAINT, true);
    domainClass.clazz.metaClass.beforeInsert = {
       if (tenantId == null) tenantId = 0
    }
}


I've done a simple app with the plugin, just to simple domain classes, one annotated and the other not.
A simple controller that tries to save both instances. This is a simple app with NO OTHER stuff than this, and we can see the failing when trying to save a non-annotated domain class.

It is attached here, I'll raise a JIRA either.

I don't know about priorities on this project, but IMO, it is a blocker issue since it does not allow users to have non-multi-tenant domain classes in this kind of environment.
On Sun, Oct 17, 2010 at 12:53 AM, Scott Ryan <[hidden email]> wrote:
I  apologize that no one has gotten back to you yet.  I am in the midst of working on the re-factor of the plugin into more manageable pieces along with several other developers.  We hope to make the plugin much more modular and add a lot of new function.  I am mainly working on the multiple database scenario code but I know there are developers working on the single database mode and hopefully they will be able to answer your question.  I will look into your issue at the beginning of the week and see if I can suggestion a solution.  Please feel free to let us know any improvements we can make to the plugin to make it easier to use or understand.  My integration tests run mainly against the multiple database scenario so I have not seen the issue.  During the re-factor we will be adding a lot more tests and a demo application as well.  We will be hosting the code on Github and posting more details on the plugin portal as we progress.  

I am sorry i don't have a solution right now as I am away from my computer but will try to look into in at the beginning of the week and hopefully one of the other developers can do the same


Scott Ryan









On Oct 16, 2010, at 8:15 PM, Lucas F. A. Teixeira wrote:

Sorry for another mail on this, but I found some interesting point...

Ok, I saw that that closure was actually being injected in the domains class metaClass, so, that "tenantId" is actually being referenced inside the domain class, ok...

But the point is that the class that is being saved does not have the @MultiTenant annotation, so, it does not have the "tenantId", and that's why the test is failing.

But why this domain class save() method is being intercepted by the plugin if there isn't the annotation?

Shouldn't that closure validate if the domain class have this property (or the annotation) ?
But if I move the domain class save snippet to the Controller instead of the test, it works with no problem... Any ideas?

Thanks again ppl...

[]s,


Lucas Frare Teixeira .·.
- [hidden email]
- lucastex.com.br
- blog.lucastex.com
- twitter.com/lucastex


On Sat, Oct 16, 2010 at 10:39 PM, Lucas F. A. Teixeira <[hidden email]> wrote:
Hello again,

Digging a little on this error, I've opened the MultiTenantGrailsPlugin class (multi-tenant plugin descriptor) and saw that the error (missing property tenantId in that class) points to the "doWithDynamicMethods" closure:

    def doWithDynamicMethods = {ctx ->

        if (ConfigurationHolder.config.tenant.mode != "singleTenant")
        {
            //Add a nullable contraint for tenantId.
            application.domainClasses.each {DefaultGrailsDomainClass domainClass ->
                domainClass.constraints?.get("tenantId")?.applyConstraint(ConstrainedProperty.NULLABLE_CONSTRAINT, true);
                domainClass.clazz.metaClass.beforeInsert = {
here =>             if (tenantId == null) tenantId = 0
                }
            }
        }

        TenantUtils.ready = true
    }

Looking into this closure (and in the class attributes) I couldn't find the declaration for the tenantId property.
This works with no problem when running the app (and the closure is executed), but when running tests, I got this error...

Does anybody know why is this happening and some way to solve it? It is breaking all integration tests that manipulate @multitenant marked domain classes.


Thanks a lot...

[]s,


Lucas Frare Teixeira .·.
- [hidden email]
- lucastex.com.br
- blog.lucastex.com
- twitter.com/lucastex


On Sat, Oct 16, 2010 at 9:18 PM, Lucas F. A. Teixeira <[hidden email]> wrote:
Hello all,

We're developing a mult-tenant app using the multi-tenant plugin.
But our integration tests are failing due it does not have a tentantId in the current request context.

No such property: tenantId for class: MultiTenantGrailsPlugin

groovy.lang.MissingPropertyException: No such property: tenantId for class: MultiTenantGrailsPlugin
at MultiTenantGrailsPlugin$_closure5_closure29_closure30.doCall(MultiTenantGrailsPlugin.groovy:226)
at MultiTenantGrailsPlugin$_closure5_closure29_closure30.doCall(MultiTenantGrailsPlugin.groovy)
at com.infusion.util.domain.event.hibernate.InterceptableSession.saveOrUpdate(InterceptableSession.java:569)
at $Proxy15.saveOrUpdate(Unknown Source)
at imob.web.AreaControllerTests.testListagemDasAreasComPaginacao(AreaControllerTests.groovy:59)


Is there some way to inject some dummy tenant in the current context, so tests would pass (I hope so) ?

Thanks a lot,

[]s,

Lucas


Lucas Frare Teixeira .·.
- [hidden email]
- lucastex.com.br
- blog.lucastex.com
- twitter.com/lucastex





Reply | Threaded
Open this post in threaded view
|

Re: Integration Tests with Multi-Tenant plugin

BalaTR
In reply to this post by lucastex
Lucas F. A. Teixeira <lucastex <at> gmail.com> writes:

>
> Hello all,We're developing a mult-tenant app using the multi-tenant plugin.But
our integration tests are failing due it does not have a tentantId in the
current request context.No such property: tenantId for class:
MultiTenantGrailsPlugingroovy.lang.MissingPropertyException: No such property:
tenantId for class: MultiTenantGrailsPlugin at
MultiTenantGrailsPlugin$_closure5_closure29_closure30.doCall(MultiTenantGrailsPl
ugin.groovy:226) at
MultiTenantGrailsPlugin$_closure5_closure29_closure30.doCall(MultiTenantGrailsPl
ugin.groovy)
>
> at
com.infusion.util.domain.event.hibernate.InterceptableSession.saveOrUpdate(Inter
ceptableSession.java:569) at $Proxy15.saveOrUpdate(Unknown Source)
at
imob.web.AreaControllerTests.testListagemDasAreasComPaginacao(AreaControllerTest
s.groovy:59)Is there some way to inject some dummy tenant in the current
context, so tests would pass (I hope so) ?Thanks a lot,[]s,LucasLucas Frare
Teixeira .·.- lucastex <at> gmail.com
>
> - lucastex.com.br- blog.lucastex.com- twitter.com/lucastex


===================================

Hi Lucas

I saw your blog post related to Grails MultiTenancy plugin error:
No such property: tenantId for class: MultiTenantGrailsPlugin

I got the same error trying to use the plugin with grails 1.3.5,spring security
and multitenancy plugin 1.0

Did you figure out a way to get this to work
Can you please share if you have

Thanks
Bala


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

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|

Re: Integration Tests with Multi-Tenant plugin

lucastex
I've send a pull request that solves this issue: https://github.com/multi-tenant/grails-multi-tenant-core/pull/3

But we're discussing it right now on the link.

[]s,

Lucas Frare Teixeira .·.
- [hidden email]
- lucastex.com.br
- blog.lucastex.com
- twitter.com/lucastex


On Sat, Dec 11, 2010 at 7:39 PM, bala <[hidden email]> wrote:
Lucas F. A. Teixeira <lucastex <at> gmail.com> writes:

>
> Hello all,We're developing a mult-tenant app using the multi-tenant plugin.But
our integration tests are failing due it does not have a tentantId in the
current request context.No such property: tenantId for class:
MultiTenantGrailsPlugingroovy.lang.MissingPropertyException: No such property:
tenantId for class: MultiTenantGrailsPlugin     at
MultiTenantGrailsPlugin$_closure5_closure29_closure30.doCall(MultiTenantGrailsPl
ugin.groovy:226)        at
MultiTenantGrailsPlugin$_closure5_closure29_closure30.doCall(MultiTenantGrailsPl
ugin.groovy)
>
>       at
com.infusion.util.domain.event.hibernate.InterceptableSession.saveOrUpdate(Inter
ceptableSession.java:569)       at $Proxy15.saveOrUpdate(Unknown Source)
at
imob.web.AreaControllerTests.testListagemDasAreasComPaginacao(AreaControllerTest
s.groovy:59)Is there some way to inject some dummy tenant in the current
context, so tests would pass (I hope so) ?Thanks a lot,[]s,LucasLucas Frare
Teixeira .·.- lucastex <at> gmail.com
>
> - lucastex.com.br- blog.lucastex.com- twitter.com/lucastex


===================================

Hi Lucas

I saw your blog post related to Grails MultiTenancy plugin error:
No such property: tenantId for class: MultiTenantGrailsPlugin

I got the same error trying to use the plugin with grails 1.3.5,spring security
and multitenancy plugin 1.0

Did you figure out a way to get this to work
Can you please share if you have

Thanks
Bala


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

   http://xircles.codehaus.org/manage_email



Reply | Threaded
Open this post in threaded view
|

Re: Integration Tests with Multi-Tenant plugin

scryan
I merged your request with the code base on GIThub and am having a merge conflict with another change that I am working through.  I plan to release 1.0.1 with your changes and others later this week in snapshot form for testing.  The holiday and end of year releases will impact my work the rest of this month so i apologize


Let me know if you have questions.

Scott Ryan


On Dec 12, 2010, at 6:02 AM, Lucas F. A. Teixeira wrote:

I've send a pull request that solves this issue: https://github.com/multi-tenant/grails-multi-tenant-core/pull/3

But we're discussing it right now on the link.

[]s,

Lucas Frare Teixeira .·.
- [hidden email]
- lucastex.com.br
- blog.lucastex.com
- twitter.com/lucastex


On Sat, Dec 11, 2010 at 7:39 PM, bala <[hidden email]> wrote:
Lucas F. A. Teixeira <lucastex <at> gmail.com> writes:

>
> Hello all,We're developing a mult-tenant app using the multi-tenant plugin.But
our integration tests are failing due it does not have a tentantId in the
current request context.No such property: tenantId for class:
MultiTenantGrailsPlugingroovy.lang.MissingPropertyException: No such property:
tenantId for class: MultiTenantGrailsPlugin     at
MultiTenantGrailsPlugin$_closure5_closure29_closure30.doCall(MultiTenantGrailsPl
ugin.groovy:226)        at
MultiTenantGrailsPlugin$_closure5_closure29_closure30.doCall(MultiTenantGrailsPl
ugin.groovy)
>
>       at
com.infusion.util.domain.event.hibernate.InterceptableSession.saveOrUpdate(Inter
ceptableSession.java:569)       at $Proxy15.saveOrUpdate(Unknown Source)
at
imob.web.AreaControllerTests.testListagemDasAreasComPaginacao(AreaControllerTest
s.groovy:59)Is there some way to inject some dummy tenant in the current
context, so tests would pass (I hope so) ?Thanks a lot,[]s,LucasLucas Frare
Teixeira .·.- lucastex <at> gmail.com
>
> - lucastex.com.br- blog.lucastex.com- twitter.com/lucastex


===================================

Hi Lucas

I saw your blog post related to Grails MultiTenancy plugin error:
No such property: tenantId for class: MultiTenantGrailsPlugin

I got the same error trying to use the plugin with grails 1.3.5,spring security
and multitenancy plugin 1.0

Did you figure out a way to get this to work
Can you please share if you have

Thanks
Bala


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

   http://xircles.codehaus.org/manage_email




Reply | Threaded
Open this post in threaded view
|

Re: Integration Tests with Multi-Tenant plugin

scryan
In reply to this post by BalaTR
I have merged the change with the code base and working though some issues.  If I can resolve them I will push up 1.0.1 later this week

Scott Ryan
President/CTO
Soaring Eagle L.L.C.
[hidden email]
(303) 263-3044

On Dec 11, 2010, at 2:39 PM, bala wrote:

> Lucas F. A. Teixeira <lucastex <at> gmail.com> writes:
>
>>
>> Hello all,We're developing a mult-tenant app using the multi-tenant plugin.But
> our integration tests are failing due it does not have a tentantId in the
> current request context.No such property: tenantId for class:
> MultiTenantGrailsPlugingroovy.lang.MissingPropertyException: No such property:
> tenantId for class: MultiTenantGrailsPlugin at
> MultiTenantGrailsPlugin$_closure5_closure29_closure30.doCall(MultiTenantGrailsPl
> ugin.groovy:226) at
> MultiTenantGrailsPlugin$_closure5_closure29_closure30.doCall(MultiTenantGrailsPl
> ugin.groovy)
>>
>> at
> com.infusion.util.domain.event.hibernate.InterceptableSession.saveOrUpdate(Inter
> ceptableSession.java:569) at $Proxy15.saveOrUpdate(Unknown Source)
> at
> imob.web.AreaControllerTests.testListagemDasAreasComPaginacao(AreaControllerTest
> s.groovy:59)Is there some way to inject some dummy tenant in the current
> context, so tests would pass (I hope so) ?Thanks a lot,[]s,LucasLucas Frare
> Teixeira .·.- lucastex <at> gmail.com
>>
>> - lucastex.com.br- blog.lucastex.com- twitter.com/lucastex
>
>
> ===================================
>
> Hi Lucas
>
> I saw your blog post related to Grails MultiTenancy plugin error:
> No such property: tenantId for class: MultiTenantGrailsPlugin
>
> I got the same error trying to use the plugin with grails 1.3.5,spring security
> and multitenancy plugin 1.0
>
> Did you figure out a way to get this to work
> Can you please share if you have
>
> Thanks
> Bala
>
>
> ---------------------------------------------------------------------
> 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: Integration Tests with Multi-Tenant plugin

lucastex
ok Scott,

I'll reach you in PVT.

[]s,


Lucas Frare Teixeira .·.
- [hidden email]
- lucastex.com.br
- blog.lucastex.com
- twitter.com/lucastex


On Mon, Dec 13, 2010 at 12:57 PM, Scott Ryan <[hidden email]> wrote:
I have merged the change with the code base and working though some issues.  If I can resolve them I will push up 1.0.1 later this week

Scott Ryan
President/CTO
Soaring Eagle L.L.C.
[hidden email]
(303) 263-3044

On Dec 11, 2010, at 2:39 PM, bala wrote:

> Lucas F. A. Teixeira <lucastex <at> gmail.com> writes:
>
>>
>> Hello all,We're developing a mult-tenant app using the multi-tenant plugin.But
> our integration tests are failing due it does not have a tentantId in the
> current request context.No such property: tenantId for class:
> MultiTenantGrailsPlugingroovy.lang.MissingPropertyException: No such property:
> tenantId for class: MultiTenantGrailsPlugin   at
> MultiTenantGrailsPlugin$_closure5_closure29_closure30.doCall(MultiTenantGrailsPl
> ugin.groovy:226)      at
> MultiTenantGrailsPlugin$_closure5_closure29_closure30.doCall(MultiTenantGrailsPl
> ugin.groovy)
>>
>>      at
> com.infusion.util.domain.event.hibernate.InterceptableSession.saveOrUpdate(Inter
> ceptableSession.java:569)     at $Proxy15.saveOrUpdate(Unknown Source)
> at
> imob.web.AreaControllerTests.testListagemDasAreasComPaginacao(AreaControllerTest
> s.groovy:59)Is there some way to inject some dummy tenant in the current
> context, so tests would pass (I hope so) ?Thanks a lot,[]s,LucasLucas Frare
> Teixeira .·.- lucastex <at> gmail.com
>>
>> - lucastex.com.br- blog.lucastex.com- twitter.com/lucastex
>
>
> ===================================
>
> Hi Lucas
>
> I saw your blog post related to Grails MultiTenancy plugin error:
> No such property: tenantId for class: MultiTenantGrailsPlugin
>
> I got the same error trying to use the plugin with grails 1.3.5,spring security
> and multitenancy plugin 1.0
>
> Did you figure out a way to get this to work
> Can you please share if you have
>
> Thanks
> Bala
>
>
> ---------------------------------------------------------------------
> 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: Integration Tests with Multi-Tenant plugin

Stefan Armbruster
In reply to this post by scryan
Scott,

if you release 1.0.1, please do also upgrade the dependency in
multi-tenant-sprint-security plugin. This currently depends on =1.0.0 of
multi-tenant. I think we should change this to "1.0.0 > *"

Regards,
Stefan

Am Montag, den 13.12.2010, 07:56 -0700 schrieb Scott Ryan:

> I merged your request with the code base on GIThub and am having a
> merge conflict with another change that I am working through.  I plan
> to release 1.0.1 with your changes and others later this week in
> snapshot form for testing.  The holiday and end of year releases will
> impact my work the rest of this month so i apologize
>
>
>
> Let me know if you have questions.
>
> Scott Ryan
>
>
>
> On Dec 12, 2010, at 6:02 AM, Lucas F. A. Teixeira wrote:
>
> > I've send a pull request that solves this issue:
> > https://github.com/multi-tenant/grails-multi-tenant-core/pull/3
> >
> > But we're discussing it right now on the link.
> >
> > []s,
> >
> > Lucas Frare Teixeira .·.
> > - [hidden email]
> > - lucastex.com.br
> > - blog.lucastex.com
> > - twitter.com/lucastex
> >
> >
> > On Sat, Dec 11, 2010 at 7:39 PM, bala <[hidden email]> wrote:
> >         Lucas F. A. Teixeira <lucastex <at> gmail.com> writes:
> >        
> >         >
> >         > Hello all,We're developing a mult-tenant app using the
> >         multi-tenant plugin.But
> >         our integration tests are failing due it does not have a
> >         tentantId in the
> >         current request context.No such property: tenantId for
> >         class:
> >        
> >         MultiTenantGrailsPlugingroovy.lang.MissingPropertyException:
> >         No such property:
> >         tenantId for class: MultiTenantGrailsPlugin     at
> >         MultiTenantGrailsPlugin
> >         $_closure5_closure29_closure30.doCall(MultiTenantGrailsPl
> >         ugin.groovy:226)        at
> >         MultiTenantGrailsPlugin
> >         $_closure5_closure29_closure30.doCall(MultiTenantGrailsPl
> >         ugin.groovy)
> >         >
> >         >       at
> >         com.infusion.util.domain.event.hibernate.InterceptableSession.saveOrUpdate(Inter
> >         ceptableSession.java:569)       at
> >         $Proxy15.saveOrUpdate(Unknown Source)
> >         at
> >         imob.web.AreaControllerTests.testListagemDasAreasComPaginacao(AreaControllerTest
> >         s.groovy:59)Is there some way to inject some dummy tenant in
> >         the current
> >         context, so tests would pass (I hope so) ?Thanks a
> >         lot,[]s,LucasLucas Frare
> >        
> >         Teixeira .·.- lucastex <at> gmail.com
> >         >
> >         > - lucastex.com.br- blog.lucastex.com- twitter.com/lucastex
> >        
> >        
> >        
> >         ===================================
> >        
> >         Hi Lucas
> >        
> >         I saw your blog post related to Grails MultiTenancy plugin
> >         error:
> >         No such property: tenantId for class:
> >         MultiTenantGrailsPlugin
> >        
> >        
> >         I got the same error trying to use the plugin with grails
> >         1.3.5,spring security
> >         and multitenancy plugin 1.0
> >        
> >         Did you figure out a way to get this to work
> >         Can you please share if you have
> >        
> >         Thanks
> >         Bala
> >        
> >        
> >         ---------------------------------------------------------------------
> >         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: Integration Tests with Multi-Tenant plugin

BalaTR
In reply to this post by lucastex
Hi Lucas

Does the workaround cover this use case as well:
Multitenant mode(not SingleTenant) and domain classes with @MultiTenant annotation

I am not able to confirm from your email chain that the above is covered
Thanks for clarifying

Bala
Reply | Threaded
Open this post in threaded view
|

Re: Integration Tests with Multi-Tenant plugin

lucastex
what is actually the problem with this scenario?

basically, it just confirms if the instance being saved have the 'tenantId' field. If not, just avoid it.
In this case, non annotaded classes does not get this field injected.

[]s,

Lucas Frare Teixeira .·.
- [hidden email]
- lucastex.com.br
- blog.lucastex.com
- twitter.com/lucastex


On Mon, Dec 13, 2010 at 6:00 PM, BalaTR <[hidden email]> wrote:

Hi Lucas

Does the workaround cover this use case as well:
Multitenant mode(not SingleTenant) and domain classes with @MultiTenant
annotation

I am not able to confirm from your email chain that the above is covered
Thanks for clarifying

Bala
--
View this message in context: http://grails.1312388.n4.nabble.com/Integration-Tests-with-Multi-Tenant-plugin-tp2998709p3086002.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: Integration Tests with Multi-Tenant plugin

BalaTR
Even the annotated classes do not get this field injected.
Thats the issue - did you by any chance try the annotation on for a domain class and verify tenantId is getting injected