Junit test not running testwatcher methods in scalatest -
i have few classes of junit tests wanna use testwatcher class so
class extends c { @test def testa = { //tests } }
class b
class b extends c{ @test def testb ={ //tests } }
class c below
trait c extends testwatcher { override def failed(er:throwable, des:description) { val writer = new filewriter(new file("d:\\test_"+des.getmethodname+".txt" )) writer.write("false") writer.close() } override def succeeded(des:description) { val writer = new filewriter(new file("d:\\test_"+des.getmethodname+".txt" )) writer.write("true") writer.close() } }
it seems when run tests, succeeded , fail methods in c never ran , files never created.
i have tried using @runwith(classof[junitrunner]) doesn't work either
any ideas?
Comments
Post a Comment