java - Is tearDown() supposed to run after each test? -
java - Is tearDown() supposed to run after each test? -
i thought teardown()
supposed run after each test, see logs is started after setup()
method. can guys clarify?
public class launchmanageractivitytest extends activityinstrumentationtestcase2<launchmanageractivity> { private solo solo; public launchmanageractivitytest() { super(launchmanageractivity.class); } protected void setup() throws exception { super.setup(); log.e("dev", "setup"); solo = new solo(getinstrumentation(), getactivity()); } protected void teardown() throws exception { super.teardown(); log.e("dev", "teardown "); }
output:
02-11 11:33:33.095: e/dev(26779): setup 02-11 11:33:34.395: e/dev(26779): teardown
you have no tests in class posted ran setup , teardown. expected behaviour, if had test run:
constructor() setup(); testxxx(); teardown();
if had 2 tests run
constructor() setup(); testxxx(); teardown(); setup(); testxxx2(); teardown();
remember test in junit 3 (which android uses) has start word test , in same class.
to test said add together next methods in:
public void testxxx(){ log.d("dev", "testxxx "); } public void testxxx2(){ log.d("dev", "testxxx2 "); }
java android unit-testing robotium
Comments
Post a Comment