[Seaside] I can't access the WASession in a SeasideTesting session.

David Shaffer cdshaffer at acm.org
Fri Dec 1 15:18:00 UTC 2006


Seb wrote:
> Hi,
>
> I use SeasideTesting to test my application and I run into a problem 
> every time I need to access the WASession:
> - the component session (self component session) is always nil.
>
> Note: I run #establishSession in the #setUp.
>
>
> Any hints?
> Thanks!
> Seb.
> _______________________________________________
> Seaside mailing list
> Seaside at lists.squeakfoundation.org
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Seb,

How are you accessing the session?  In your test case you should be able 
to send "self session" to get it.  If you are trying to use the dynamic 
variable WACurrentSession or sending #session to your component then it 
won't work b/c the dynamic binding is not on the call stack for the test 
case.  So, for example,

testNothing
    self newApplicationWithRootClass: MyComponent.
    self establishSession.
    self assert: self session notNil

should pass but:

testNothing
    self newApplicationWithRootClass: MyComponent.
    self establishSession.
    self assert: self component session notNil

will not.

Hope that helps.

David



More information about the Seaside mailing list