将参数传递给测试方法并仅在testsuite中运行特定方法

时间:2013-04-03 06:25:00

标签: java junit

这是我的测试套件

@RunWith(Suite.class)
@SuiteClasses({ LoginTest.class })
public class SmokeTestSuite {

}

这是我的LoginTest.class文件

public class LoginTest extends MSTestBase {

    @Test
    public void User1LoginTest() throws Exception { 
        /*code*/
    }

    @Test
    public void User2LoginTest() throws Exception {         
        /*code*/
    }

    @Test
    public void User3LoginTest() throws Exception {         
        /*code*/
    }
}

我有2个问题,

1- Can I run my SmokeTestSuite so it only execute User3LoginTest() method from LoginTest.class file?
2. Can I pass parameter to my Test Method from SmokeTestSuite file?

0 个答案:

没有答案