コード例 #1
0
  @Test
  public void getTemplateName() {
    assertEquals(null, content.getTemplateName());

    content.setTemplate("  test.vm ");
    assertEquals("test.vm", content.getTemplateName());
  }
コード例 #2
0
  @Test
  public void getPullService() {
    assertSame(null, content.getPullService());

    content.setPullService(pullService);
    assertSame(pullService, content.getPullService());
  }
コード例 #3
0
  @Test
  public void getTemplateService() {
    try {
      content.getTemplateService();
      fail();
    } catch (IllegalArgumentException e) {
      assertThat(e, exception("templateService"));
    }

    content.setTemplateService(templateService);
    assertSame(templateService, content.getTemplateService());
  }
コード例 #4
0
  protected final void initContent(
      TC content, boolean withTemplateService, boolean withPullService) {
    this.content = content;
    builder.setContent(content);

    if (withTemplateService) {
      content.setTemplateService(templateService);
    }

    if (withPullService) {
      content.setPullService(pullService);
    }
  }
コード例 #5
0
  protected final void initContent(
      String templateName, boolean withTemplateService, boolean withPullService) {
    initContent(createContent(), withTemplateService, withPullService);

    if (templateName != null) {
      content.setTemplate(templateName);
    }
  }