how to annotate system tests and distinguish in custom runner
flexunit gurus,
for our team's junit tests, we've created custom runner (set @runwith) , testphase annotation lets distinguish unit tests functional/component/system tests in same file. our nightly built runs tests marked @testphase(target = "unit"), whereas our system test invocations additionally invoke tests annotated @testphase(target = "system"). tests must still annotated @test annotation. @testphase optional , defaults "unit", , can set @ class level or method level. specify test phase target run, supply environment variable @ runtime, e.g. -dtestphasetarget=system.
i'm trying think through how might implement same flexunit, both work within flash builder , through ant invocation. can set runwith annotation easy enough, , trust i'd need ensure custom runner in flash builder library path <flexunit> ant task's library path. how might pass test phase argument custom runner? i'm curious both how i'd property passed runner (i.e. <flexunit> ant task inherit environment properties defined in build file, flash builder runner have access property if set in flash builder) , how runner read property (i didn't come across way read environment variables in action script). there recommended runner should subclass perform test method filtering i've described? there alternative implementing own runner should consider? i'd prefer using same style syntax we've implemented junit, if there's better alternative i'm open it. of course simplest alternative not write custom runner @ , separate unit test code system test code @ directory level, e.g. separate test/ , functional_test/ dirs. that'll fallback if there's not way implement testphase approach flexunit , actionscript.
thanks.
-mike
mike-
we similar , happy know 95% of want available without need custom runner. block runner runs flexunit tests support filtering every test through implementation of ifilter. so, on flex side, need annotate tests , create custom filter uses annotation see fit.
the first link give general info on approach. second link example filter uses categories isolate tests. neither want, of major puzzle pieces there.
http://docs.flexunit.org/index.php?title=filtering
http://docs.flexunit.org/index.php?title=myfilter
now 5% not elegant passing player during runtime works flash builder , ant. happy have others chime in on this, there many better ways this, here first thought occurs me morning:
in both of these cases, can pass conditional compilation value in... take @ our flexunit tests project's additional compilation arguments , see this:
-define=config::useflexclasses,true
you have along lines of:
-define=config::unitphase,true
and use value in filter.
this allow isolate code filter uses these arguments , achieve needed functionality... .
more come when occurs me,
mike
More discussions in Archived Spaces
adobe
Comments
Post a Comment