📄 postservicetest.java
字号:
package com.ntsky.bbs.service;
import java.util.Date;
import com.ntsky.bbs.domain.Post;
public class PostServiceTest extends NTskyServiceTestCase{
private PostService postService;
private Post post = new Post();
protected void setUp() throws Exception {
//postService = (PostService)super.getBean("postService");
}
public void testCreatePost(){
post.setTopicId(1);
post.setForumId(1);
post.setTitle("ntsky is very good!");
post.setContent("I like ntsky and it's very good!");
post.setUserId(1);
post.setUsername("ntsky");
post.setDateCreated(new Date());
postService.createPost(post);
}
public void testEditPost(){
postService.editPost(postService.getPost(1));
}
public void testGetPost(){
//assertNull(postService.getPost(1));
}
public void testDeletePost(){
postService.deletePost(1);
}
public void setDown(){
post = null;
postService = null;
}
public static void main(String[] args) {
junit.textui.TestRunner.run(PostServiceTest.class);
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -