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

Popular posts from this blog

mysql - Dreamhost PyCharm Django Python 3 Launching a Site -

java - Sending SMS with SMSLib and Web Services -

java - How to resolve The method toString() in the type Object is not applicable for the arguments (InputStream) -