Example usage for org.apache.wicket Component getPageRelativePath

List of usage examples for org.apache.wicket Component getPageRelativePath

Introduction

In this page you can find the example usage for org.apache.wicket Component getPageRelativePath.

Prototype

@Override
public final String getPageRelativePath() 

Source Link

Document

Gets the path to this component relative to its containing page, i.e.

Usage

From source file:org.apache.syncope.fit.console.PoliciesITCase.java

License:Apache License

@Test
public void createComposeDeleteAccountPolicy() {
    final String description = "Account Policy To Be Composed";
    createAccountPolicy(description);/*from  w  ww  . j  a  v a 2 s . c  o  m*/

    Component component = findComponentByProp("description", "body:content:tabbedPanel:panel:container:content:"
            + "searchContainer:resultTable:tablePanel:groupForm:checkgroup:dataTable", description);

    Assert.assertNotNull(component);
    TESTER.clickLink(component.getPageRelativePath() + ":cells:9:cell:panelCompose:composeLink");
    TESTER.assertComponent("body:content:tabbedPanel:panel:outerObjectsRepeater:0:outer", Modal.class);

    Component modal = TESTER
            .getComponentFromLastRenderedPage("body:content:tabbedPanel:panel:outerObjectsRepeater:3:outer");

    TESTER.clickLink(
            "body:content:tabbedPanel:panel:outerObjectsRepeater:3:outer:form:content:container:content:add");

    FormTester formTester = TESTER.newFormTester("body:content:tabbedPanel:panel:outerObjectsRepeater:3:"
            + "outer:form:content:container:content:wizard:form");
    formTester.setValue("view:name:textField", "myrule");
    formTester.setValue("view:configuration:dropDownChoiceField", "0");
    formTester.submit("buttons:next");

    TESTER.assertModelValue("body:content:tabbedPanel:panel:outerObjectsRepeater:3:outer:form:content:"
            + "container:content:wizard:form:view:bean:propView:1:value:spinner", 0);

    formTester = TESTER.newFormTester("body:content:tabbedPanel:panel:outerObjectsRepeater:3:"
            + "outer:form:content:container:content:wizard:form");
    formTester.submit("buttons:finish");

    TESTER.assertInfoMessages("Operation executed successfully");
    TESTER.cleanupFeedbackMessages();

    component = findComponentByProp("name", "body:content:tabbedPanel:panel:outerObjectsRepeater:3:outer:form:"
            + "content:container:content:searchContainer:resultTable:tablePanel:groupForm:checkgroup:dataTable",
            "myrule");

    Assert.assertNotNull(component);

    TESTER.clickLink(
            "body:content:tabbedPanel:panel:outerObjectsRepeater:3:outer:form:content:container:content:exit");

    closeCallBack(modal);

    deleteAccountPolicy(description);
}

From source file:org.apache.syncope.fit.console.PoliciesITCase.java

License:Apache License

@Test
public void createUpdateDeletePasswordPolicy() {
    final String description = "Password Policy To Be Updated";
    createPasswordPolicy(description);//  w  w w.  j a  va2s . c  om

    Component component = findComponentByProp("description", "body:content:tabbedPanel:panel:container:content:"
            + "searchContainer:resultTable:tablePanel:groupForm:checkgroup:dataTable", description);

    Assert.assertNotNull(component);
    TESTER.clickLink(component.getPageRelativePath() + ":cells:8:cell:panelEdit:editLink");
    TESTER.assertComponent("body:content:tabbedPanel:panel:outerObjectsRepeater:0:outer", Modal.class);

    Component modal = TESTER
            .getComponentFromLastRenderedPage("body:content:tabbedPanel:panel:outerObjectsRepeater:0:outer");

    FormTester formTester = TESTER
            .newFormTester("body:content:tabbedPanel:panel:outerObjectsRepeater:0:outer:form");
    formTester.setValue("content:fields:1:field:spinner", "2");

    TESTER.clickLink(
            "body:content:tabbedPanel:panel:outerObjectsRepeater:0:outer:dialog:footer:inputs:0:submit");

    TESTER.assertInfoMessages("Operation executed successfully");
    TESTER.cleanupFeedbackMessages();

    closeCallBack(modal);

    component = findComponentByProp("description", "body:content:tabbedPanel:panel:container:content:"
            + "searchContainer:resultTable:tablePanel:groupForm:checkgroup:dataTable", description);

    Assert.assertNotNull(component);
    TESTER.assertLabel(component.getPageRelativePath() + ":cells:6:cell", "2");

    TESTER.clickLink(component.getPageRelativePath() + ":cells:8:cell:panelEdit:editLink");
    TESTER.assertComponent("body:content:tabbedPanel:panel:outerObjectsRepeater:0:outer", Modal.class);

    TESTER.assertModelValue("body:content:tabbedPanel:panel:outerObjectsRepeater:0:outer:form"
            + ":content:fields:1:field:spinner", 2);

    TESTER.executeAjaxEvent(
            "body:content:tabbedPanel:panel:outerObjectsRepeater:0:outer:dialog:footer:buttons:0:button",
            Constants.ON_CLICK);

    deletePasswordPolicy(description);
}

From source file:org.apache.syncope.fit.console.PoliciesITCase.java

License:Apache License

@Test
public void createComposeDeletePasswordPolicy() {
    final String description = "Password Policy To Be Composed";
    createPasswordPolicy(description);//from   w  ww .j  a  va  2  s  . c  o m

    Component component = findComponentByProp("description", "body:content:tabbedPanel:panel:container:content:"
            + "searchContainer:resultTable:tablePanel:groupForm:checkgroup:dataTable", description);

    Assert.assertNotNull(component);
    TESTER.clickLink(component.getPageRelativePath() + ":cells:8:cell:panelCompose:composeLink");
    TESTER.assertComponent("body:content:tabbedPanel:panel:outerObjectsRepeater:3:outer", Modal.class);

    Component modal = TESTER
            .getComponentFromLastRenderedPage("body:content:tabbedPanel:panel:outerObjectsRepeater:3:outer");

    TESTER.clickLink(
            "body:content:tabbedPanel:panel:outerObjectsRepeater:3:outer:form:content:container:content:add");

    FormTester formTester = TESTER.newFormTester("body:content:tabbedPanel:panel:outerObjectsRepeater:3:"
            + "outer:form:content:container:content:wizard:form");
    formTester.setValue("view:name:textField", "myrule");
    formTester.setValue("view:configuration:dropDownChoiceField", "0");
    formTester.submit("buttons:next");

    TESTER.assertModelValue("body:content:tabbedPanel:panel:outerObjectsRepeater:3:outer:form:content:"
            + "container:content:wizard:form:view:bean:propView:0:value:spinner", 0);

    formTester = TESTER.newFormTester("body:content:tabbedPanel:panel:outerObjectsRepeater:3:"
            + "outer:form:content:container:content:wizard:form");
    formTester.submit("buttons:finish");

    TESTER.assertInfoMessages("Operation executed successfully");
    TESTER.cleanupFeedbackMessages();

    component = findComponentByProp("name", "body:content:tabbedPanel:panel:outerObjectsRepeater:3:outer:form:"
            + "content:container:content:searchContainer:resultTable:tablePanel:groupForm:checkgroup:dataTable",
            "myrule");

    Assert.assertNotNull(component);

    TESTER.clickLink(
            "body:content:tabbedPanel:panel:outerObjectsRepeater:3:outer:form:content:container:content:exit");

    closeCallBack(modal);

    deletePasswordPolicy(description);
}

From source file:org.apache.syncope.fit.console.PoliciesITCase.java

License:Apache License

@Test
public void createUpdateDeletePullPolicy() {
    final String description = "Pull Policy To Be Updated";
    createPullPolicy(description);/*  w ww .jav  a  2s  . c o  m*/

    Component component = findComponentByProp("description", "body:content:tabbedPanel:panel:container:content:"
            + "searchContainer:resultTable:tablePanel:groupForm:checkgroup:dataTable", description);

    Component modal = TESTER
            .getComponentFromLastRenderedPage("body:content:tabbedPanel:panel:outerObjectsRepeater:0:outer");

    Assert.assertNotNull(component);
    TESTER.clickLink(component.getPageRelativePath() + ":cells:6:cell:panelEdit:editLink");
    TESTER.assertComponent("body:content:tabbedPanel:panel:outerObjectsRepeater:0:outer", Modal.class);

    FormTester formTester = TESTER
            .newFormTester("body:content:tabbedPanel:panel:outerObjectsRepeater:0:outer:form");
    formTester.setValue("content:fields:0:field:textField", description + "2");

    TESTER.clickLink(
            "body:content:tabbedPanel:panel:outerObjectsRepeater:0:outer:dialog:footer:inputs:0:submit");

    TESTER.assertInfoMessages("Operation executed successfully");
    TESTER.cleanupFeedbackMessages();

    closeCallBack(modal);

    component = findComponentByProp("description",
            "body:content:tabbedPanel:panel:container:content:"
                    + "searchContainer:resultTable:tablePanel:groupForm:checkgroup:dataTable",
            description + "2");

    Assert.assertNotNull(component);
    TESTER.clickLink(component.getPageRelativePath() + ":cells:6:cell:panelEdit:editLink");
    TESTER.assertComponent("body:content:tabbedPanel:panel:outerObjectsRepeater:0:outer", Modal.class);

    TESTER.assertModelValue("body:content:tabbedPanel:panel:outerObjectsRepeater:0:outer:form"
            + ":content:fields:0:field:textField", description + "2");

    TESTER.executeAjaxEvent(
            "body:content:tabbedPanel:panel:outerObjectsRepeater:0:outer:dialog:footer:buttons:0:button",
            Constants.ON_CLICK);

    deletePullPolicy(description + "2");
}

From source file:org.apache.syncope.fit.console.PoliciesITCase.java

License:Apache License

@Test
public void createComposeDeletePullPolicy() {
    final String description = "Pull Policy To Be Composed";
    createPullPolicy(description);//  w w w .j  a  va2s .co  m

    Component component = findComponentByProp("description", "body:content:tabbedPanel:panel:container:content:"
            + "searchContainer:resultTable:tablePanel:groupForm:checkgroup:dataTable", description);

    Assert.assertNotNull(component);
    TESTER.clickLink(component.getPageRelativePath() + ":cells:6:cell:panelCompose:composeLink");
    TESTER.assertComponent("body:content:tabbedPanel:panel:outerObjectsRepeater:4:outer", Modal.class);

    Component modal = TESTER
            .getComponentFromLastRenderedPage("body:content:tabbedPanel:panel:outerObjectsRepeater:4:outer");

    FormTester formTester = TESTER
            .newFormTester("body:content:tabbedPanel:panel:outerObjectsRepeater:4:outer:form");

    TESTER.executeAjaxEvent(
            "body:content:tabbedPanel:panel:outerObjectsRepeater:4:outer:form:content:"
                    + "correlationRules:multiValueContainer:innerForm:content:panelPlus:add",
            Constants.ON_CLICK);

    formTester.setValue("content:conflictResolutionAction:dropDownChoiceField", "1");
    formTester.setValue("content:correlationRules:multiValueContainer:innerForm:content:view:0:panel:"
            + "jsonRule:paletteField:recorder", "fullname");

    TESTER.clickLink(
            "body:content:tabbedPanel:panel:outerObjectsRepeater:4:outer:dialog:footer:inputs:0:submit");

    TESTER.assertInfoMessages("Operation executed successfully");
    TESTER.cleanupFeedbackMessages();

    closeCallBack(modal);

    component = findComponentByProp("description", "body:content:tabbedPanel:panel:container:content:"
            + "searchContainer:resultTable:tablePanel:groupForm:checkgroup:dataTable", description);

    Assert.assertNotNull(component);
    TESTER.clickLink(component.getPageRelativePath() + ":cells:6:cell:panelCompose:composeLink");
    TESTER.assertComponent("body:content:tabbedPanel:panel:outerObjectsRepeater:4:outer", Modal.class);

    TESTER.assertModelValue(
            "body:content:tabbedPanel:panel:outerObjectsRepeater:4:outer:form:"
                    + "content:conflictResolutionAction:dropDownChoiceField",
            ConflictResolutionAction.FIRSTMATCH);

    TESTER.assertModelValue("body:content:tabbedPanel:panel:outerObjectsRepeater:4:outer:form:"
            + "content:correlationRules:multiValueContainer:innerForm:content:view:0:panel:"
            + "jsonRule:paletteField:recorder", "fullname");

    TESTER.clickLink(
            "body:content:tabbedPanel:panel:outerObjectsRepeater:4:outer:dialog:footer:buttons:0:button");

    closeCallBack(modal);

    deletePullPolicy(description);
}

From source file:org.apache.syncope.fit.console.RealmsITCase.java

License:Apache License

@Test
public void verifyPropagation() {
    TESTER.executeAjaxEvent("body:content:realmChoicePanel:container:realms:btn", Constants.ON_CLICK);
    TESTER.executeAjaxEvent("body:content:realmChoicePanel:container:realms:dropdown-menu:buttons:2:button",
            Constants.ON_CLICK);//from  ww  w. j av a  2s.  co m

    TESTER.clickLink(
            "body:content:body:container:content:tabbedPanel:panel:actions:actions:panelEdit:editLink");
    TESTER.assertComponent("body:content:body:outerObjectsRepeater:0:outer", Modal.class);
    TESTER.assertModelValue("body:content:body:outerObjectsRepeater:0:outer:form:content:form:view:details:"
            + "container:generics:name:textField", "two");

    FormTester formTester = TESTER
            .newFormTester("body:content:body:outerObjectsRepeater:0:outer:form:content:form");
    formTester.setValue("view:details:container:resources:paletteField:recorder", "resource-ldap-orgunit");

    formTester.submit("buttons:finish");

    TESTER.assertInfoMessages("Operation executed successfully");
    TESTER.cleanupFeedbackMessages();

    // ----------------------------------
    // Check for propagation rsults
    // ----------------------------------
    Component component = findComponentByProp("resource", "body:content:body:outerObjectsRepeater:0:outer:form:"
            + "content:customResultBody:firstLevelContainer:first:container", "resource-ldap-orgunit");

    TESTER.clickLink(component.getPageRelativePath() + ":actions:panelView:viewLink");

    TESTER.assertLabel(
            "body:content:body:outerObjectsRepeater:0:outer:form:content:customResultBody:"
                    + "secondLevelContainer:second:remoteObject:propView:2:value:oldAttribute:field-label",
            "ou");

    TESTER.assertModelValue("body:content:body:outerObjectsRepeater:0:outer:form:content:customResultBody:"
            + "secondLevelContainer:second:remoteObject:propView:0:value:oldAttribute:textField", null);

    TESTER.assertModelValue("body:content:body:outerObjectsRepeater:0:outer:form:content:customResultBody:"
            + "secondLevelContainer:second:remoteObject:propView:1:value:oldAttribute:textField", null);

    TESTER.assertModelValue("body:content:body:outerObjectsRepeater:0:outer:form:content:customResultBody:"
            + "secondLevelContainer:second:remoteObject:propView:2:value:oldAttribute:textField", null);

    TESTER.assertLabel(
            "body:content:body:outerObjectsRepeater:0:outer:form:content:customResultBody:"
                    + "secondLevelContainer:second:remoteObject:propView:2:value:newAttribute:field-label",
            "ou");

    TESTER.assertModelValue(
            "body:content:body:outerObjectsRepeater:0:outer:form:content:customResultBody:"
                    + "secondLevelContainer:second:remoteObject:propView:2:value:newAttribute:textField",
            "two");

    TESTER.clickLink("body:content:body:outerObjectsRepeater:0:outer:form:content:customResultBody:"
            + "secondLevelContainer:back");

    assertNotNull(
            findComponentByProp("resource",
                    "body:content:body:outerObjectsRepeater:0:outer:form:"
                            + "content:customResultBody:firstLevelContainer:first:container",
                    "resource-ldap-orgunit"));
    // ----------------------------------

    TESTER.executeAjaxEvent(
            "body:content:body:outerObjectsRepeater:0:outer:form:content:action:panelClose:closeLink",
            Constants.ON_CLICK);

    TESTER.clickLink(
            "body:content:body:container:content:tabbedPanel:panel:actions:actions:panelEdit:editLink");
    TESTER.assertComponent("body:content:body:outerObjectsRepeater:0:outer", Modal.class);
    TESTER.assertModelValue("body:content:body:outerObjectsRepeater:0:outer:form:content:form:view:details:"
            + "container:generics:name:textField", "two");

    formTester = TESTER.newFormTester("body:content:body:outerObjectsRepeater:0:outer:form:content:form");
    formTester.setValue("view:details:container:resources:paletteField:recorder", "");

    formTester.submit("buttons:finish");

    TESTER.assertInfoMessages("Operation executed successfully");
    TESTER.cleanupFeedbackMessages();

    // ----------------------------------
    // Check for propagation rsults
    // ----------------------------------
    component = findComponentByProp("resource", "body:content:body:outerObjectsRepeater:0:outer:form:"
            + "content:customResultBody:firstLevelContainer:first:container", "resource-ldap-orgunit");

    TESTER.clickLink(component.getPageRelativePath() + ":actions:panelView:viewLink");

    TESTER.assertLabel(
            "body:content:body:outerObjectsRepeater:0:outer:form:content:customResultBody:"
                    + "secondLevelContainer:second:remoteObject:propView:2:value:oldAttribute:field-label",
            "ou");

    TESTER.assertModelValue(
            "body:content:body:outerObjectsRepeater:0:outer:form:content:customResultBody:"
                    + "secondLevelContainer:second:remoteObject:propView:2:value:oldAttribute:textField",
            "two");

    TESTER.assertLabel(
            "body:content:body:outerObjectsRepeater:0:outer:form:content:customResultBody:"
                    + "secondLevelContainer:second:remoteObject:propView:2:value:newAttribute:field-label",
            "ou");

    TESTER.assertModelValue("body:content:body:outerObjectsRepeater:0:outer:form:content:customResultBody:"
            + "secondLevelContainer:second:remoteObject:propView:0:value:newAttribute:textField", null);

    TESTER.assertModelValue("body:content:body:outerObjectsRepeater:0:outer:form:content:customResultBody:"
            + "secondLevelContainer:second:remoteObject:propView:1:value:newAttribute:textField", null);

    TESTER.assertModelValue("body:content:body:outerObjectsRepeater:0:outer:form:content:customResultBody:"
            + "secondLevelContainer:second:remoteObject:propView:2:value:newAttribute:textField", null);

    TESTER.clickLink("body:content:body:outerObjectsRepeater:0:outer:form:content:customResultBody:"
            + "secondLevelContainer:back");

    assertNotNull(
            findComponentByProp("resource",
                    "body:content:body:outerObjectsRepeater:0:outer:form:"
                            + "content:customResultBody:firstLevelContainer:first:container",
                    "resource-ldap-orgunit"));
    // ----------------------------------

    TESTER.executeAjaxEvent(
            "body:content:body:outerObjectsRepeater:0:outer:form:content:action:panelClose:closeLink",
            Constants.ON_CLICK);
}

From source file:org.apache.syncope.fit.console.RelationshipTypeITCase.java

License:Apache License

@Test
public void read() {
    browsingToRelationshipType();/*from   www.  j a va 2 s.c  o  m*/

    Component result = findComponentByProp(KEY, DATATABLE_PATH, "inclusion");

    TESTER.assertComponent(result.getPageRelativePath() + ":cells:1:cell", Label.class);

    TESTER.assertComponent(result.getPageRelativePath() + ":cells:3:cell:panelEdit:editLink",
            IndicatingAjaxLink.class);

    TESTER.clickLink(result.getPageRelativePath() + ":cells:3:cell:panelEdit:editLink");

    TESTER.assertComponent("body:content:tabbedPanel:panel:outerObjectsRepeater:0:outer", BaseModal.class);
}

From source file:org.apache.syncope.fit.console.RelationshipTypeITCase.java

License:Apache License

@Test
public void create() {
    final String name = "relationshipTypeTest";
    createRelationshipType(name);//from  w w  w  . ja  va 2 s  .com
    browsingToRelationshipType();

    TESTER.assertComponent(DATATABLE_PATH, AjaxDataTablePanel.class);

    Component result = findComponentByProp(KEY, DATATABLE_PATH, name);

    TESTER.assertLabel(result.getPageRelativePath() + ":cells:1:cell", name);
    TESTER.assertLabel(result.getPageRelativePath() + ":cells:2:cell", "test relationshipType");
}

From source file:org.apache.syncope.fit.console.RelationshipTypeITCase.java

License:Apache License

@Test
public void delete() {
    final String name = "relationshipTypeDelete";
    createRelationshipType(name);// www.  j a  va 2s  .com
    browsingToRelationshipType();

    TESTER.assertComponent(DATATABLE_PATH, AjaxDataTablePanel.class);

    Component result = findComponentByProp(KEY, DATATABLE_PATH, name);

    assertNotNull(result);
    TESTER.assertComponent(result.getPageRelativePath() + ":cells:3:cell:panelDelete:deleteLink",
            IndicatingOnConfirmAjaxLink.class);

    TESTER.getRequest().addParameter("confirm", "true");
    TESTER.clickLink(TESTER.getComponentFromLastRenderedPage(
            result.getPageRelativePath() + ":cells:3:cell:panelDelete:deleteLink"));

    TESTER.executeAjaxEvent(TESTER.getComponentFromLastRenderedPage(
            result.getPageRelativePath() + ":cells:3:cell:panelDelete:deleteLink"), "onclick");
    TESTER.assertInfoMessages("Operation executed successfully");

    TESTER.cleanupFeedbackMessages();
    result = findComponentByProp(KEY, DATATABLE_PATH, name);

    assertNull(result);
}

From source file:org.apache.syncope.fit.console.ReportsITCase.java

License:Apache License

private void delete(final String name) {
    TESTER.clickLink("body:reportsLI:reports");

    Component result = findComponentByProp("name",
            "body:content:tabbedPanel:panel:firstLevelContainer:first:container:"
                    + "content:searchContainer:resultTable:tablePanel:groupForm:checkgroup:dataTable",
            name);//from  w ww .  java 2 s  .  c  o m

    assertNotNull(result);

    TESTER.getRequest().addParameter("confirm", "true");
    TESTER.clickLink(TESTER.getComponentFromLastRenderedPage(
            result.getPageRelativePath() + ":cells:10:cell:panelDelete:deleteLink"));

    TESTER.executeAjaxEvent(
            TESTER.getComponentFromLastRenderedPage(
                    result.getPageRelativePath() + ":cells:10:cell:panelDelete:deleteLink"),
            Constants.ON_CLICK);

    TESTER.assertInfoMessages("Operation executed successfully");
    TESTER.cleanupFeedbackMessages();

    assertNull(findComponentByProp("name",
            "body:content:tabbedPanel:panel:firstLevelContainer:first:container:"
                    + "content:searchContainer:resultTable:tablePanel:groupForm:checkgroup:dataTable",
            "deleteReport"));
}