Exemple #1
0
 public static void main1(String[] args) {
   new ClassPathXmlApplicationContext("/jar/config/test/spring/test.xml");
   JobManager jobManager = new JobManager();
   JobInfo jobInfo = job();
   jobManager.startJob(jobInfo, ImmutableList.of("1", "2", "3"));
   //        new
   // HtmlExtratorImpl().test(cnblogsJob(),"http://news.mtime.com/2015/08/12/1545670.html");
   //        htmlExtrator.doExtrat()
 }
Exemple #2
0
  @Test
  public void addSpider() {
    JobInfo jobInfo = job();

    jobInfo.setJobModel(Constants.JobModel.addSpider);
    //        jobManager.addSpider(jobInfo, "1");
    jobManager.addSpider(jobInfo, "1");
  }
Exemple #3
0
  @Test
  public void stop() {
    JobInfo jobInfo = job();

    jobManager.stopSpider(
        jobInfo,
        //                ImmutableList.of("10","20","30"),
        ImmutableList.of("1"));
  }
Exemple #4
0
 @Test
 public void pushUrl() {
   JobInfo jobInfo = job();
   jobManager.addUrl(jobInfo, "http://news.mtime.com/movie/2/index.html#nav");
 }
Exemple #5
0
 @Test
 public void start() {
   JobInfo jobInfo = job();
   jobManager.restartJob(jobInfo, ImmutableList.of("10", "20", "30"));
 }