package com.hxh.spring.test; import java.util.List; import org.junit.Test; import com.newvideo.dao.VideoInfoDao; import com.newvideo.service.imp.StatisticsService; import com.newvideo.util.BeanUtil; import com.newvideo.util.news.SouGouParser; public class StatisticTest { @Test public void updateSouGou() {// SouGouParser SouGouParser souGouParser = (SouGouParser) BeanUtil.getBean("souGouParser"); souGouParser.startParse(); } // @Test public void refreshWatchCount() { StatisticsService statisticsService = (StatisticsService) BeanUtil.getBean("statisticsService"); VideoInfoDao videoInfoDao = (VideoInfoDao) BeanUtil.getBean("videoInfoDao"); for (int p = 2; p < 10; p++) { System.out.println("页码:" + p); List list = videoInfoDao.sqlList("select id from wk_video_video", (p - 1) * 10000, 10000, null); for (int j = 0; j < list.size(); j++) { statisticsService.refreshWatchCount(list.get(j) + ""); statisticsService.refreshVideoCommentCount(list.get(j) + ""); // statisticsService.refreshVideoDetailCount(list.get(j) + ""); } } } // @Test public void refreshCommentCount() { } //@Test public void playStatistics() { final StatisticsService statisticsService = (StatisticsService) BeanUtil.getBean("statisticsService"); statisticsService.areaPlayStatistic(); statisticsService.hotSearchStatistics(); statisticsService.categoryPlayStatistic(); statisticsService.secondCategoryPlayStatistic(); } }