|
From: Alias <ali...@gm...> - 2006-02-09 11:18:04
|
Hi there. Luke posted an entry on running Asynchronous tests on his blog a while back= : http://www.blogger.com/comment.g?blogID=3D5873661&postID=3D1132965891612765= 44 Essentially, you override the TestCase classes run(), setup() and teardown() methods, and when you're ready to do your asynchronous test you call them. It's quite sub-optimal, and I'm currently trying to figure out the best way to go about doing this in the general case, but at the moment I'm doing this: public function run(){ //override this method so that your testcase will do nothing until explicitly told to } public function setUp(){ //setup whatever you need for your tests //set a callback or some other method to signal to the test method that the //asynchronous process is finished someTest(); } public function tearDown(){ //delete your class instance, or whatever } public function someTest(){ //do test //... //tearDown(); } It's a pretty ugly hack, but it does allow you to continue using the framework with asynchronous objects. Read Luke's post all the way through though, and make sure that this is actually what you need. Hope this helps, Alias On 2/9/06, erixtekila <eri...@gm...> wrote: > Hi, > > > >> That will only work if you've got no asynchronous tests... > How do you guys achieve asynchronous tests with asUnit ? > Any pointer ? > > > Thanks. > Le 9 f=E9vr. 06, =E0 04:06, Peter Hall a =E9crit : > > > We will be writing a lot of asynchronous tests, which is why I didn't > > do simply as Paul suggests. Thanks Robert, the LocalConnection timing > > is something I hadn't considered, but I think we'll go a different > > route anyway, and dump out the results to text file, which should be > > more reliable. > > > > It's looking like I'll have to do some reworking of the guts of the > > framework. I was probably going to have to do some of that anyway, > > because asynchronous calls are currently executing concurrently, which > > is not ideal. > > > > Peter > > > ----------- > erixtekila > http://blog.v-i-a.net/ > > > > ------------------------------------------------------- > This SF.net email is sponsored by: Splunk Inc. Do you grep through log fi= les > for problems? Stop! Download the new AJAX search engine that makes > searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! > http://sel.as-us.falkag.net/sel?cmdlnk&kid=103432&bid#0486&dat=121642 > _______________________________________________ > Asunit-users mailing list > Asu...@li... > https://lists.sourceforge.net/lists/listinfo/asunit-users > |