java - JUnit running test methods conditionally -
import static org.junit.assert.asserttrue; import org.junit.before; import org.junit.test; public class swifttest { swiftutil swiftutil = new swiftutil(); boolean result; @test public void checkinpathfolder() { result = swiftutil.checkinpathfolder(); asserttrue(result); } @test public void checkcustomobjectexists() { result=swiftutil.validatewfid(); asserttrue(result); } @test public void runswift() { result=swiftutil.runswiftbatch(); asserttrue(result); } @test public void checktreatedfolder() { result=swiftutil.checktreatedfolder(); asserttrue(result); } @test public void checkexceptionfolder() { result=swiftutil.checkexceptionfolder(); asserttrue(result); } }
above test case. based on 2 cases want execute set of above test methods. eg: on condition x, checkinpathfolder(),checkcustomobjectexists(),runswift() should executed. on condition y , checkinpathfolder(),runswift(),checkexceptionfolder() should executed.
use junit's assume
mechanism described here. need use either theories
of parameterized
cause junit
execute more once if want drive 2 conditions.
Comments
Post a Comment