[Laszlo-dev] setUp and tearDown methods in LzUnit
P T Withington
ptw at openlaszlo.org
Tue Feb 20 15:38:46 PST 2007
There's no way to enforce read-only=ness, so you can clobber it,
which surely will lead to confusion.
On 2007-02-20, at 18:25 EST, Jim Grandy wrote:
> I believe canvas.runtime is a read only attribute. (Hrm, it's not
> documented at all in the new RefGuide; I'll write a bug.)
>
> jim
>
> On Feb 19, 2007, at 3:44 PM, Frisco Del Rosario wrote:
>
>> I launched the following application by loading
>> http://127.0.0.1:8080/lps-4.0b1/my-apps/testChangedRuntime.lzx?
>> lzr=dhtml
>> in my browser, after which the following LzUnit script runs green.
>>
>> Isn't this the kind of thing for which setUp and tearDown was meant?
>>
>>
>> <canvas debug="true">
>> <include href="lzunit"/>
>>
>> <TestSuite>
>> <TestCase>
>>
>> <method name="setUp">
>> canvas.setAttribute('runtime', 'swf7');
>> assertTrue('swf7'==canvas.runtime);
>> Debug.write('I am running in SWF after setup method'); //do
>> tests in
>> swf7
>> </method>
>>
>> <method name="tearDown">
>> canvas.setAttribute('runtime', 'dhtml');
>> assertTrue('dhtml'==canvas.runtime);
>> Debug.write('I am running in DHTML after teardown method'); //do
>> tests in dhtml
>> </method>
>>
>> <method name="testChangedRuntime">
>> assertTrue(canvas.isinited);
>> Debug.write('App was launched with lzr=dhtml, but setup method
>> changed runtime to swf7');
>> </method>
>>
>> </TestCase>
>> </TestSuite>
>>
>> </canvas>
>> --
>> assertEquals(Frisco Del Rosario, OpenLaszlo tester)
>>
>
More information about the Laszlo-dev
mailing list