java - How do I specificy the order of execution for methods in my testing? -
i have .java file called mytest.java , inside of have 2 test methods (in order created) called:
public void testgrabsubdevicedata(){ // , assert } public void testsubdevice(){ // again , assert }
for reason executes "testsubdevice()" method first, , there must sort of alphabetical method execution set. how turn off executes in order placed it?
edit:
this eclipse jee neon , maven plugin.
you can use
import org.junit.fixmethodorder; @fixmethodorder(methodsorters.name_ascending) public class whatevertest {
this guarantee junit runs test in specific order. there aren't many such orders; 1 fits needs.
but word of warning: bad practice! fixing execution order should when have reasons so.
finally: read java naming style guides. class names start uppercase; always; tests.
Comments
Post a Comment