junit4 - JUnit - invoke a test method without testing it -
junit4 - JUnit - invoke a test method without testing it -
soft ball here. short question you.
suppose have 2 methods
@test public void methoda() {//do something} @test public void methodb() {//do something}
is possible invoke methoda
methodb
without execute 1 time again test on method a
? if not, how can factorize code should tested @ to the lowest degree 1 time (ie methoda
shold tested once)? if possible, assertx
evaluated again?
extract parts of methoda
that should used methodb
.
@test public void methoda() { commoncode(); //do } @test public void methodb() { commoncode(); //do } private void commoncode() { //do }
junit junit4
Comments
Post a Comment