admin
2021-03-26 351b317c56487676b4f5a60b5bc3710a383d7a7b
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
package com.hxh.spring.test.video;
 
 
import com.yeshi.buwan.domain.video.InternetSearchVideo;
import com.yeshi.buwan.job.video.MogoTVVideoUpdate;
import com.yeshi.buwan.job.video.YouKuVideoUpdate;
import com.yeshi.buwan.mogotv.entity.MogoTVClipInfo;
import com.yeshi.buwan.service.inter.juhe.InternetSearchVideoService;
import com.yeshi.buwan.service.inter.juhe.MogoTVService;
import com.yeshi.buwan.service.inter.juhe.YouKuService;
import com.yeshi.buwan.util.factory.InternetSearchVideoFactory;
import com.yeshi.buwan.youku.YouKuApiUtil;
import com.yeshi.buwan.youku.entity.YouKuShowDetail;
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 MogoTest {
 
    @Resource
    private MogoTVService mogoTVService;
 
 
    @Resource
    private MogoTVVideoUpdate mogoTVVideoUpdate;
 
    @Resource
    private InternetSearchVideoService internetSearchVideoService;
 
 
    @Test
    public void test2() {
        try {
            mogoTVVideoUpdate.updateLatestVideo("综艺");
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
    @Test
    public void addToSearch() {
        List<MogoTVClipInfo> list = mogoTVService.list("电视剧", 1, 1000);
        for (MogoTVClipInfo info : list) {
            try {
                mogoTVService.addToInternetSearch(info);
            } catch (Exception e) {
                e.printStackTrace();
            }
        }
    }
 
 
}