postservicetest.java

来自「新技术论坛系统 v1.0 前后台管理的初始用户名 : admin 密码 123」· Java 代码 · 共 49 行

JAVA
49
字号
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 + =
减小字号Ctrl + -
显示快捷键?