Subject: Re: Seaside Testing - - msg#00074
List: lang.smalltalk.squeak.seaside
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
Was this page helpful?
Thread at a glance:
Previous Message by Date:
click to view message preview
Seaside Testing -
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.
Next Message by Date:
click to view message preview
Re: Seaside Testing -
C. David Shaffer wrote:
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
In fact, I just went ahead and published it. It seems to work fine.
Here is an example from WACounterTest:
testPreBuilt
self newApplicationWithRootClass: WACounter initializeWith: [:comp |
comp increase; increase].
self establishSession.
self assert: self component count = 2
David
--
C. David Shaffer
http://www.cs.westminster.edu/~shaffer
http://www.shaffer-consulting.com
Previous Message by Thread:
click to view message preview
Seaside Testing -
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.
Next Message by Thread:
click to view message preview
Re: Seaside Testing -
C. David Shaffer wrote:
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
In fact, I just went ahead and published it. It seems to work fine.
Here is an example from WACounterTest:
testPreBuilt
self newApplicationWithRootClass: WACounter initializeWith: [:comp |
comp increase; increase].
self establishSession.
self assert: self component count = 2
David
--
C. David Shaffer
http://www.cs.westminster.edu/~shaffer
http://www.shaffer-consulting.com