コード例 #1
0
  @Test
  public void testTemplateNamespace() throws Exception {
    String path = "View";

    SoyPortletHelper soyPortletHelper = new SoyPortletHelper(_mockBundle);

    Assert.assertEquals(path.concat(".render"), soyPortletHelper.getTemplateNamespace(path));
  }
コード例 #2
0
  protected String getPortletJavaScript(Bundle bundle, String path) throws Exception {

    SoyPortletHelper soyPortletHelper = new SoyPortletHelper(bundle);

    Template template = new MockTemplate();

    String portletJavaScript =
        soyPortletHelper.getPortletJavaScript(
            template, path, StringUtil.randomString(), Collections.<String>emptySet());

    return portletJavaScript;
  }
コード例 #3
0
  @Test
  public void testgetRequiredModulesWithBundleWithPackageFile() throws Exception {

    Bundle bundle = getBundleWithPackageFile();

    SoyPortletHelper soyPortletHelper = new SoyPortletHelper(bundle);

    Set<String> expectedRequiredModules = new HashSet<>();

    expectedRequiredModules.add("SampleModuleName/View.soy");

    Set<String> actualRequiredModules =
        soyPortletHelper.getRequiredModules("View", Collections.<String>emptySet());

    Assert.assertEquals(expectedRequiredModules, actualRequiredModules);
  }