📄 farmserverfunctionaltest.java
字号:
package jsunit.java.tests_server.net.jsunit;
import net.jsunit.configuration.Configuration;
import net.jsunit.model.ResultType;
import org.jdom.Document;
import java.net.URLEncoder;
public class FarmServerFunctionalTest extends FunctionalTestCase {
private JsUnitFarmServer farmServer;
private int otherPort;
public void setUp() throws Exception {
super.setUp();
otherPort = new TestPortManager().newPort();
farmServer = new JsUnitFarmServer(new Configuration(new FunctionalTestFarmConfigurationSource(otherPort, port)));
farmServer.start();
}
protected int webTesterPort() {
return otherPort;
}
public void testHitFarmRunner() throws Exception {
String url =
"/runner?url=" + URLEncoder.encode("http://localhost:" + port + "/jsunit/tests/jsUnitUtilityTests.html", "UTF-8");
webTester.beginAt(url);
Document document = responseXmlDocument();
assertEquals(ResultType.SUCCESS.name(), document.getRootElement().getAttribute("type").getValue());
}
public void tearDown() throws Exception {
farmServer.dispose();
super.tearDown();
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -