为 JUnit 4 设置测试套件时出现语法错误
为了使用 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()");
}
}
任何人都可以在这里帮助我吗?非常感谢
In order to test with Junit 4, I manage to setup the test suite like the following
import org.junit.runner.RunWith;
import org.junit.runners.Suite;
import org.junit.runners.Suite.SuiteClasses;
@RunWith(Suite.class)
@SuiteClasses( { ClazzToTestA.class, ClazzToTestB.class })
But I keep getting curve underline for those lines starts with @
saying "syntax error on tokens, delete those tokens"
The following is my entire code:
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()");
}
}
Can anyone help me out here? Thanks very much
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论