admin
2020-10-10 81db7b3b070c003e6f5f0d1c757ab30b6f42c944
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
package com.hxh.spring.test;
 
import com.yeshi.buwan.domain.SolrVideo;
import com.yeshi.buwan.domain.VideoInfo;
import com.yeshi.buwan.iqiyi.util.IqiyiUtil;
import com.yeshi.buwan.service.imp.VideoInfoService;
import com.yeshi.buwan.service.manager.SolrAlbumDataManager;
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)
@ContextConfiguration(locations = {"classpath:spring.xml"})
@WebAppConfiguration
public class SolrTest {
 
    @Resource
    private SolrAlbumDataManager solrDataManager;
 
    @Resource
    private VideoInfoService videoInfoService;
 
    @Test
    public void test1() {
        List<SolrVideo> list = solrDataManager.findByKey("苍", 1, 150, 1);
        System.out.println(list.size());
        list = solrDataManager.findByKey("苍", 0, 150, 1);
        System.out.println(list.size());
        list = solrDataManager.findByKey("苍", 1, 151, 1);
        System.out.println(list.size());
    }
 
    @Test
    public void addSolrAlbum() {
        solrDataManager.syncAllAlbum();
    }
 
 
}