📄 helpservicetest.java
字号:
package com.ntsky.bbs.service;
import java.util.Date;
import com.ntsky.bbs.domain.Help;
import com.ntsky.bbs.util.page.Pagination;
public class HelpServiceTest extends NTskyServiceTestCase{
private HelpService helpService;
private Help help = null;
protected void setUp() throws Exception {
helpService = (HelpService)super.getBean("helpService");
help = new Help();
help.setTitle("create topic");
help.setContent("crete topic info more.");
help.setType(1);
help.setDateCreated(new Date());
}
public void testCreateHelp(){
helpService.createHelp(help);
}
public void testHelpException(){
helpService.deleteHelp(1);
}
public void testDeleteHelp(){
try {
helpService.deleteHelp(2);
/*Help help = (Help)helpService.getHelp(2);
assertNull(help);*/
} catch (Exception e) {
System.out.println("Exception : " + e.getMessage());
// TODO: handle exception
}
}
public void testGetHelp(){
try {
helpService.getHelp(2);
System.out.println("getHelp");
} catch (Exception e) {
System.out.println("sasa");
}
}
public void testGetHelps(){
helpService.getHelps("",new Pagination(0));
}
public static void main(String[] args) {
junit.textui.TestRunner.run(HelpServiceTest.class);
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -