categorytest.java
来自「青年论坛设计想关代码」· Java 代码 · 共 44 行
JAVA
44 行
package com.luo.test;
import com.ql.bbs.model.TopicCategory;
import com.ql.bbs.service.TopicCategoryService;
import com.ql.bbs.service.impl.TopicCategoryServiceImpl;
import junit.framework.TestCase;
public class CategoryTest extends TestCase {
public void testSave1() {
TopicCategory category = new TopicCategory();
category.setName("J2EE");
category.setDescrption("j2ee is very popular");
category.setGrade(0);
category.setPid(0);
TopicCategoryService categoryService = new TopicCategoryServiceImpl();
categoryService.addTopicCategory(category);
}
public void testSave2() {
TopicCategory category = new TopicCategory();
category.setName("java");
category.setDescrption("java is very popular");
category.setGrade(1);
category.setPid(1);
TopicCategoryService categoryService = new TopicCategoryServiceImpl();
categoryService.addTopicCategory(category);
}
public void testdel() {
TopicCategoryService categoryService = new TopicCategoryServiceImpl();
categoryService.delTopicCategory(2);
}
public void testUpdate() {
TopicCategory category = new TopicCategory();
category.setId(1);
category.setName("java");
category.setDescrption("java is very popular");
TopicCategoryService categoryService = new TopicCategoryServiceImpl();
categoryService.updateTopicCategory(category);
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?