use of com.adobe.granite.ui.components.ds.DataSource in project aem-core-wcm-components by Adobe-Marketing-Cloud.
the class VariationsDataSourceServletTest method testComponentPathStructured.
@Test
void testComponentPathStructured() throws ServletException, IOException {
DataSource dataSource = getDataSource(servlet, DS_COMPONENT_PATH_STRUCTURED);
assertDataSource(dataSource, VARIATION_NAMES, VARIATION_TITLES);
}
use of com.adobe.granite.ui.components.ds.DataSource in project aem-core-wcm-components by Adobe-Marketing-Cloud.
the class VariationsDataSourceServletTest method testNoConfig.
@Test
void testNoConfig() throws ServletException, IOException {
DataSource dataSource = getDataSource(servlet, DS_NO_CONFIG);
assertDataSource(dataSource, new String[0], new String[0]);
}
use of com.adobe.granite.ui.components.ds.DataSource in project aem-core-wcm-components by Adobe-Marketing-Cloud.
the class VariationsDataSourceServletTest method testFragmentPathInvalid.
@Test
void testFragmentPathInvalid() throws ServletException, IOException {
DataSource dataSource = getDataSource(servlet, DS_FRAGMENT_PATH_INVALID);
assertDataSource(dataSource, new String[0], new String[0]);
}
use of com.adobe.granite.ui.components.ds.DataSource in project aem-core-wcm-components by Adobe-Marketing-Cloud.
the class VariationsDataSourceServletTest method testComponentPathTextOnly.
@Test
void testComponentPathTextOnly() throws ServletException, IOException {
DataSource dataSource = getDataSource(servlet, DS_COMPONENT_PATH_TEXT_ONLY);
assertDataSource(dataSource, VARIATION_NAMES, VARIATION_TITLES);
}
use of com.adobe.granite.ui.components.ds.DataSource in project aem-core-wcm-components by Adobe-Marketing-Cloud.
the class EmbedDesignTabsDataSourceServletTest method testEmbedDesignTabsDataSourceServlet.
@Test
public void testEmbedDesignTabsDataSourceServlet() {
EmbedDesignTabsDataSourceServlet dataSourceServlet = new EmbedDesignTabsDataSourceServlet();
dataSourceServlet.doGet(request, context.response());
DataSource dataSource = (com.adobe.granite.ui.components.ds.DataSource) request.getAttribute(DataSource.class.getName());
assertNotNull(dataSource);
Iterator<Resource> resourceIterator = dataSource.iterator();
Resource resourceTab = resourceIterator.next();
assertNotNull(resourceTab);
Object[] expectedProperties = new Object[] { "jcr:primaryType", "nt:unstructured" };
MatcherAssert.assertThat(resourceTab, ResourceMatchers.nameAndProps("first", expectedProperties));
resourceTab = resourceIterator.next();
assertNotNull(resourceTab);
MatcherAssert.assertThat(resourceTab, ResourceMatchers.nameAndProps("second", expectedProperties));
Object[] expectedProperties2 = new Object[] { "jcr:primaryType", "nt:unstructured", "jcr:title", "YouTube Design Tab", "sling:resourceType", "granite/ui/components/coral/foundation/container" };
resourceTab = resourceIterator.next();
assertNotNull(resourceTab);
MatcherAssert.assertThat(resourceTab, ResourceMatchers.nameAndProps("cq:design_dialog", expectedProperties2));
resourceTab = resourceIterator.next();
assertNotNull(resourceTab);
MatcherAssert.assertThat(resourceTab, ResourceMatchers.nameAndProps("last", expectedProperties));
assertFalse(resourceIterator.hasNext());
}
Aggregations