📄 logictagswebtestcase.java
字号:
/* * WebWork, Web Application Framework * * Distributable under Apache license. * See terms of license at opensource.org */package webwork.view.taglib;import junit.textui.TestRunner;import org.xml.sax.SAXException;import com.meterware.httpunit.GetMethodWebRequest;import com.meterware.httpunit.WebConversation;import com.meterware.httpunit.WebRequest;import com.meterware.httpunit.WebResponse;import com.meterware.httpunit.WebTable;import webwork.view.WebSupport;/** * @author Maurice C. Parker (maurice@vineyardenterprise.com) */public class LogicTagsWebTestCase extends WebSupport { public LogicTagsWebTestCase(String testName) { super(testName); } public void testIfTags() { WebConversation conversation = new WebConversation(); WebRequest request = new GetMethodWebRequest(TEST_HOME + "tests/expr.jsp"); WebResponse response = null; try { response = conversation.getResponse(request); } catch (Exception e) { fail(e); } WebTable table = null; try { table = response.getTables()[0]; } catch (SAXException e) { fail(e); } for (int i = 1; i < table.getRowCount(); i++) { if (table.asText()[i][3].equals("X")) { assertEquals("test " + i + " failed", 0, table.asText()[i][2].trim().length()); } else { assertEquals("test " + i + " failed", "Success", table.asText()[i][2].trim()); } } } public static void main(String[] args) { TestRunner.run(LogicTagsWebTestCase.class); }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -