[Seaside] Seaside Testing -

C. David Shaffer cdshaffer at acm.org
Fri Nov 12 17:48:00 CET 2004


Rob Lally wrote:

>
> Hi,
>
> In the web documentation for Seaside Testing it describes a method 
> 'newApplicationWithRootInstance:' that should be on 
> SCComponentTestCase. It doesn't seem to exist. Am I doing something 
> wrong?
>
> I am trying to test a component that must be preconfigured before use, 
> and this method promises to allow just that. Is there a way to do this 
> with the API as it stands?
>
> Thanks,
>
>
> Rob.
>

Hi Rob,

I suspect that my documentation got ahead of the version on SqueakMap.  
In fact, this feature is broken by the new initialization scheme used in 
Seaside 2.5 anyway (there's a session reference in the initialize method 
which causes all kind of problems with creating components outside of 
the server's request handling look).  I've only written one test case 
that needed it but it is on my list of bug fixes for the next release (I 
posted the list to the mailling list a short while ago).  I have an idea 
to kind of fix it though: I can provide a hook so a test case can be 
passed the component once the first request creates it.  It isn't 
perfect but maybe it would meet your needs for now.  It would look 
something like:

self newApplicationWithRootClass: SomeComponent initializeWith: [:comp | 
"do something to comp"].

How does that sound?  If it will work for you I'll try to get it working.

David

-- 
C. David Shaffer
http://www.cs.westminster.edu/~shaffer
http://www.shaffer-consulting.com



More information about the Seaside mailing list