admin
2021-09-03 b41a6efe17ba61d150c5a9b7309651cebae54e0d
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
package com.hxh.spring.test;
 
import com.yeshi.buwan.dao.HomeVideoDao;
import com.yeshi.buwan.domain.HomeType;
import com.yeshi.buwan.domain.HomeVideo;
import com.yeshi.buwan.service.imp.HomeTypeService;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.test.context.web.WebAppConfiguration;
 
import javax.annotation.Resource;
import java.util.List;
 
@RunWith(SpringJUnit4ClassRunner.class) //使用junit4进行测试
@ContextConfiguration(locations = {"classpath:spring.xml"})
@WebAppConfiguration
public class HomeTypeTest {
 
 
    @Resource
    private HomeTypeService homeTypeService;
 
    @Resource
    private HomeVideoDao homeVideoDao;
 
 
    @Test
    public void addTest() {
        List<HomeType> homeTypeList = homeTypeService.getHomeTypeList("44", 109, "recommend", 1, 4);
        for (int i = 0; i < homeTypeList.size(); i++) {
//            List<HomeVideo> homeVideoList = homeTypeService.getHomeVideoList()
 
        }
        long count = homeTypeService.countHomeType("44", 109, "recommend");
 
        System.out.println(count);
    }
 
 
    @Test
    public void testHomeVideo() {
        HomeVideo homeVideo = homeVideoDao.find(HomeVideo.class, "47628");
        System.out.println(homeVideo);
    }
 
 
}