Overriding session class for SeasideTesting based test cases...?

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

Overriding session class for SeasideTesting based test cases...?

Rick Flower
I'm again trying to setup some nice test cases for my web-app with the
help of David Shaffer's SeasideTesting package.  The one think that I'm
stumped with (for today anyway) is that my application requires the use
of a custom session class, but I don't see an obvious way to override
what the SeasideTesting framework is using for the session.  Has anyone
done this in the past and if so how?

Thanks!

-- Rick
_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: Overriding session class for SeasideTesting based test cases...?

cdavidshaffer
Rick Flower wrote:

> I'm again trying to setup some nice test cases for my web-app with the
> help of David Shaffer's SeasideTesting package.  The one think that
> I'm stumped with (for today anyway) is that my application requires
> the use
> of a custom session class, but I don't see an obvious way to override
> what the SeasideTesting framework is using for the session.  Has
> anyone done this in the past and if so how?
>
> Thanks!
>
> -- Rick
> _______________________________________________
> Seaside mailing list
> [hidden email]
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Rick,

You can override #configureApplicationForComponent: to set your session
class.  I have pasted an example from the online tutorial below:

configureApplicationForComponent: aComponentClass
        super configureApplicationForComponent: aComponentClass.
        app configuration addAncestor: MyCustomConfiguration localConfiguration.
        app preferenceAt: #sessionClass put: MyCustomSession.
        FakeMailer reset.
        app preferenceAt: #mailerFactory put: FakeMailer


David


_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: Overriding session class for SeasideTesting based test cases...?

Rick Flower
David Shaffer wrote:

> You can override #configureApplicationForComponent: to set your session
> class.  I have pasted an example from the online tutorial below:
>
> configureApplicationForComponent: aComponentClass
> super configureApplicationForComponent: aComponentClass.
> app configuration addAncestor: MyCustomConfiguration localConfiguration.
> app preferenceAt: #sessionClass put: MyCustomSession.
> FakeMailer reset.
> app preferenceAt: #mailerFactory put: FakeMailer
>
>  
Thanks David.. I plopped that (with a few mods obviously) into my test
class (not the main Seaside class being tested) and it magically started
picking up my proper session..

-- Rick

_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside