| | |
| | | package com.hxh.spring.test; |
| | | |
| | | import com.yeshi.buwan.service.manager.SolrDataManager; |
| | | 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.web.WebAppConfiguration; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.List; |
| | | |
| | | |
| | | @RunWith(SpringJUnit4ClassRunner.class) //使用junit4进行测试 |
| | | @RunWith(SpringJUnit4ClassRunner.class) |
| | | @ContextConfiguration(locations = {"classpath:spring.xml"}) |
| | | @WebAppConfiguration |
| | | public class SolrTest { |
| | | |
| | | @Resource |
| | | private SolrDataManager solrDataManager; |
| | | private SolrAlbumDataManager solrDataManager; |
| | | |
| | | @Resource |
| | | private VideoInfoService videoInfoService; |
| | | |
| | | @Test |
| | | public void test1() { |
| | | solrDataManager.getSuggestKeyList("龙门"); |
| | | 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(); |
| | | } |
| | | |
| | | |
| | | } |