📄 listtest.xdt
字号:
<XDtTagDef:tagDef namespace="Form" handler="org.example.antbook.xdoclet.FormTagsHandler"/>package <XDtForm:parentPackageName/>.webapp.action;
import <XDtPackage:packageName/>.<XDtForm:className/>;
import <XDtForm:parentPackageName/>.service.Manager;
public class <XDtForm:className/>ListTest extends BasePageTestCase {
private <XDtForm:className/>List page;
protected void setUp() throws Exception {
super.setUp();
page = (<XDtForm:className/>List) getPage(<XDtForm:className/>List.class);
// these can be mocked if you want a more "pure" unit test
page.setManager((Manager) ctx.getBean("manager"));
page.setRequestCycle(getCycle(request, response));
}
protected void tearDown() throws Exception {
super.tearDown();
page = null;
}
public void testEdit() throws Exception {
MockRequestCycle cycle = (MockRequestCycle) page.getRequestCycle();
cycle.addServiceParameter(new <XDtMethodEx:idField getType="propertyType"/>("1"));
page.edit(cycle);
// TODO: Figure out how to verify the next page has been activated
// and the <XDtForm:classNameLower/> object is not null
assertFalse(page.hasErrors());
}
public void testSearch() throws Exception {
assertTrue(page.get<XDtForm:className/>s().size() >= 1);
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -