@Test public void testTemplateNamespace() throws Exception { String path = "View"; SoyPortletHelper soyPortletHelper = new SoyPortletHelper(_mockBundle); Assert.assertEquals(path.concat(".render"), soyPortletHelper.getTemplateNamespace(path)); }
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; }
@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); }