% $Id: NewFutureServerTest.oz,v 1.7 2012/04/12 14:59:55 leavens Exp leavens $ \insert 'NewFutureServerInClass2.oz' \insert 'TestingNoStop.oz' {StartTesting 'NewFutureServerTest $Revision: 1.7 $'} declare FS = {NewFutureServer} local R1 R2 R3 R4 in {StartTesting 'initial requests'} {Send FS request(R1)} {Send FS request(R2)} {Send FS request(R3)} {Delay 1000} {Send FS compute(fun {$} {Pow 3 24} end)} {Wait R1} {Test R1 '==' 282429536481} {Test R2 '==' 282429536481} {Test R3 '==' 282429536481} {Send FS request(R4)} {Test R4 '==' 282429536481} local R5 in {Send FS compute(fun {$} {Pow 3 4} end)} {Send FS request(R5)} {Test R5 '==' 81} end end {StartTesting 'first part done'} FS2 = {NewFutureServer} local R1 R2 in {Send FS2 request(R1)} {Send FS2 request(R2)} {Send FS2 compute(fun {$} nil end)} {Wait R2} {Test R1 '==' nil} {Test R2 '==' nil} end {StartTesting 'second part done'} FS3 = {NewFutureServer} local R1 R2 in {Send FS3 compute(fun {$} 4000+20 end)} {Send FS3 request(R1)} {Send FS3 request(R2)} {Wait R2} {Test R1 '==' 4020} {Test R2 '==' 4020} end {DoneTesting}