| | |
| | | import com.yeshi.buwan.service.imp.StatisticsService; |
| | | import com.yeshi.buwan.util.BeanUtil; |
| | | import com.yeshi.buwan.util.news.SouGouParser; |
| | | 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; |
| | | |
| | | @RunWith(SpringJUnit4ClassRunner.class) //使用junit4进行测试 |
| | | @ContextConfiguration(locations = {"classpath:spring.xml"}) |
| | | @WebAppConfiguration |
| | | public class StatisticTest { |
| | | // @Test |
| | | public void updateSouGou() {// SouGouParser |
| | |
| | | |
| | | } |
| | | |
| | | |
| | | @Resource |
| | | private StatisticsService statisticsService; |
| | | |
| | | @Test |
| | | public void playStatistics() { |
| | | final StatisticsService statisticsService = (StatisticsService) BeanUtil.getBean("statisticsService"); |
| | | statisticsService.categoryPlayStatistic(); |
| | | } |
| | | |