forked from wuweiit/mushroom
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCategoryServiceTest.java
More file actions
65 lines (54 loc) · 1.66 KB
/
Copy pathCategoryServiceTest.java
File metadata and controls
65 lines (54 loc) · 1.66 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
package unit.services;
/**
*
* 吴伟 版权所有
*/
import java.util.List;
import java.util.Map;
import org.junit.Assert;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.marker.mushroom.service.impl.CategoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.AbstractJUnit4SpringContextTests;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
/**
* 单元测试
* @author marker
* @version 1.0
* @blog www.yl-blog.com
* @weibo http://t.qq.com/wuweiit
*/
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations = "classpath:/config/spring/*.xml")
public class CategoryServiceTest extends AbstractJUnit4SpringContextTests {
@Autowired CategoryService categoryService;
@Test
public void test(){
//
// String model = categoryService.findModelById(1);
// Assert.assertEquals("test category 1 model!=article","article", model);
//
// String model2 = categoryService.findModelById(2);
// Assert.assertEquals("test category 2 model!=article","article", model2);
//
//
// List<Map<String, Object>> list = categoryService.list();
//
// Assert.assertNotNull("category is null!", list);
//
// List<Map<String, Object>> list2 = categoryService.list("article");
//
// Assert.assertNotNull("category is null!", list2);
//
// System.out.println(""+list2);
//
//
//
// boolean a = categoryService.hasChild(19);
// Assert.assertTrue("19 not has child", a);
// boolean b = categoryService.hasChild(256156);
// Assert.assertFalse("256156 not has child", b);
}
}