为了使用Junit 4进行测试,我设法设置了测试套件,如下所示
import org.junit.runner.RunWith;
import org.junit.runners.Suite;
import org.junit.runners.Suite.SuiteClasses;
@RunWith(Suite.class)
@SuiteClasses( { ClazzToTestA.class, ClazzToTestB.class })
但是我继续得到曲线下划线,这些行以@开头 说“令牌上的语法错误,删除那些令牌”
以下是我的整个代码:
package org.dale.testscript;
import net.sourceforge.jwebunit.junit.WebTester;
import org.junit.runner.RunWith;
import org.junit.runners.Suite;
import org.junit.runners.Suite.SuiteClasses;
@RunWith(Suite.class)
@SuiteClasses( { ClazzToTestA.class, ClazzToTestB.class })
public class JWebUnitTest extends WebTester {
public JWebUnitTest(String name) {
}
public void testsetUp() {
System.out.println("setup");
getTestContext().setBaseUrl("http://ser.col.com/myportal/retail");
getTestContext().setProxyAuthorization(null, null, "spxyapp.col.com.au", 8080);
System.out.println("setup done");
}
public void testSearch() {
System.out.println("enter testSearch()");
setTextField("userid", "user");
System.out.println("enter userid");
setTextField("password", "password1");
System.out.println("enter password");
submit("img_submit");
System.out.println("enter submit()");
}
}
任何人都可以帮助我吗?非常感谢