Search in sources :

Example 81 with List

use of org.kie.dmn.model.v1_1.List in project aem-core-wcm-components by Adobe-Marketing-Cloud.

the class ListIT method setup.

protected void setup() throws ClientException {
    // add 2 tags
    tag1Path = Commons.addTag(adminClient, tag1);
    tag2Path = Commons.addTag(adminClient, tag2);
    // create a separate parent page
    parentPath = authorClient.createPage("parent_page", "parent_page", rootPage, defaultPageTemplate).getSlingPath();
    // add page 1
    page1Path = authorClient.createPage("page_1", "page_1", parentPath, defaultPageTemplate).getSlingPath();
    // set tag on the page
    String[] tags = new String[] { tag1 };
    Commons.setTagsToPage(adminClient, page1Path, tags, 200);
    HashMap<String, String> data = new HashMap<String, String>();
    data.put("jcr:description", description);
    Commons.editNodeProperties(adminClient, page1Path + "/jcr:content", data);
    // add page 2
    page2Path = authorClient.createPage("page_2", "page_2", parentPath, defaultPageTemplate).getSlingPath();
    // add a text component
    String text1Path = Commons.addComponent(adminClient, Commons.rtText_v1, page2Path + Commons.relParentCompPath, "text", null);
    // set some text in the text component
    data.clear();
    data.put("text", searchValue);
    Commons.editNodeProperties(adminClient, text1Path, data);
    // create subpage for page 2
    page21Path = authorClient.createPage("sub_2_1", "sub_2_1", page2Path, defaultPageTemplate).getSlingPath();
    // create second sub page for page 2
    page22Path = authorClient.createPage("sub_2_2", "sub_2_2", page2Path, defaultPageTemplate).getSlingPath();
    // add page 3
    page3Path = authorClient.createPage("page_3", "page_3", parentPath, defaultPageTemplate).getSlingPath();
    // set 2 tags on the page
    tags = new String[] { tag1, tag2 };
    Commons.setTagsToPage(adminClient, page3Path, tags, 200);
    // create page 4
    page4Path = authorClient.createPage("page_4", "page_4", parentPath, defaultPageTemplate).getSlingPath();
    // create a sub page for page 4
    String page41Path = authorClient.createPage("sub_4_1", "sub_4_1", page4Path, defaultPageTemplate).getSlingPath();
    // add a text component
    String text2Path = Commons.addComponent(adminClient, Commons.rtText_v1, page41Path + Commons.relParentCompPath, "text", null);
    // set some text in the text component
    data.clear();
    data.put("text", searchValue);
    Commons.editNodeProperties(adminClient, text2Path, data);
    // create page 5
    page5Path = authorClient.createPage("page_5", "page_5", parentPath, defaultPageTemplate).getSlingPath();
    // set tag on the page
    tags = new String[] { tag2 };
    Commons.setTagsToPage(adminClient, page5Path, tags, 200);
    // create the test page containing the list component, store page path in 'testPagePath'
    testPage = authorClient.createPage("testPage", "Test Page Title", rootPage, defaultPageTemplate).getSlingPath();
    // create a proxy component
    proxyPath = Commons.createProxyComponent(adminClient, listRT, Commons.proxyPath, null, null);
    // add the component to test page
    compPath = Commons.addComponent(adminClient, proxyPath, testPage + Commons.relParentCompPath, "list", null);
    // open test page in page editor
    editorPage = new PageEditorPage(testPage);
    editorPage.open();
    list = new List();
}
Also used : HashMap(java.util.HashMap) PageEditorPage(com.adobe.cq.testing.selenium.pageobject.PageEditorPage) List(com.adobe.cq.wcm.core.components.it.seljup.util.components.list.v1.List)

Aggregations

Test (org.junit.Test)54 List (org.kie.workbench.common.dmn.api.definition.v1_1.List)26 ItemDefinition (org.kie.dmn.model.v1_1.ItemDefinition)21 QName (javax.xml.namespace.QName)17 ArrayList (java.util.ArrayList)15 List (java.util.List)14 DMNMessage (org.kie.dmn.api.core.DMNMessage)14 Import (org.kie.dmn.model.v1_1.Import)13 LiteralExpression (org.kie.workbench.common.dmn.api.definition.v1_1.LiteralExpression)13 CoreMatchers.is (org.hamcrest.CoreMatchers.is)11 DMNMessageType (org.kie.dmn.api.core.DMNMessageType)11 DMNGridRow (org.kie.workbench.common.dmn.client.widgets.grid.model.DMNGridRow)11 GraphCommandExecutionContext (org.kie.workbench.common.stunner.core.graph.command.GraphCommandExecutionContext)10 RuleViolation (org.kie.workbench.common.stunner.core.rule.RuleViolation)10 Definitions (org.kie.dmn.model.v1_1.Definitions)9 IOException (java.io.IOException)8 Collectors (java.util.stream.Collectors)8 AbstractCanvasHandler (org.kie.workbench.common.stunner.core.client.canvas.AbstractCanvasHandler)8 CanvasViolation (org.kie.workbench.common.stunner.core.client.command.CanvasViolation)8 Reader (java.io.Reader)7