コード例 #1
0
 @Override
 protected void currentConfiguration(Configuration cfg) {
   channelService = mock(ChannelDaoable.class);
   Channel channel = new Channel();
   channel.setId(1L);
   when(channelService.findPublishByUri(any(Long.class), any(String.class))).thenReturn(channel);
   templateService = mock(TemplateDaoable.class);
   when(templateService.findUniquePath(any(Long.class), any(Long.class), any(String.class)))
       .thenReturn("2/1/include.html");
   IncludeDirective directive = new IncludeDirective(channelService, templateService);
   cfg.setSharedVariable("include", directive);
 }
コード例 #2
0
ファイル: SiteTask.java プロジェクト: hhywangwei/publication
  @Override
  protected void regSubtask(PublishRunnerable pubRunner) {
    Channel root = channelDao.findRoot(site.getId());
    Taskable task =
        new ChannelTask(
                id,
                site,
                root,
                cfg,
                tempRoot,
                again,
                true,
                resourceDao,
                sourceDao,
                channelDao,
                templateDao,
                articleDao)
            .setCache(new LRUCache<String, String>(DEFAULT_CACHE_SIZE));

    task.regTask(pubRunner);
  }