当前位置: 首页>>代码示例>>Java>>正文


Java FormTester.setValue方法代码示例

本文整理汇总了Java中org.apache.wicket.util.tester.FormTester.setValue方法的典型用法代码示例。如果您正苦于以下问题:Java FormTester.setValue方法的具体用法?Java FormTester.setValue怎么用?Java FormTester.setValue使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.wicket.util.tester.FormTester的用法示例。


在下文中一共展示了FormTester.setValue方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: testSelectAllCheckbox

import org.apache.wicket.util.tester.FormTester; //导入方法依赖的package包/类
public void testSelectAllCheckbox() {
    addDependencyValues();
    Assert.assertFalse(((AjaxCheckBox) tester.getComponentFromLastRenderedPage(listViewPath + ":0:deleteCheckbox")).getModel().getObject());

    // click checkbox
    FormTester formTester = tester.newFormTester(formPath, false);
    formTester.setValue("dependenciesContainer:selectAllCheckbox", true);
    tester.executeAjaxEvent(formPath + ":dependenciesContainer:selectAllCheckbox", "onclick");

    ComponentHierarchyIterator allCheckboxes = tester.getLastRenderedPage().visitChildren(AjaxCheckBox.class);
    int numberOfCheckedBoxes = 0;
    for (Component box : allCheckboxes) {
        numberOfCheckedBoxes++;
        System.out.println("PATH: " + box.getPageRelativePath());
        Assert.assertTrue(((AjaxCheckBox) box).getModel().getObject());
    }
    Assert.assertEquals(3, numberOfCheckedBoxes);
}
 
开发者ID:bptlab,项目名称:Unicorn,代码行数:19,代码来源:DependenciesPanelTest.java

示例2: createQueueReceiveService

import org.apache.wicket.util.tester.FormTester; //导入方法依赖的package包/类
public static void createQueueReceiveService(PaasWicketTester myTester, String name, String serviceName, String serviceVersion, String jndiQueuName
        , long msgMaxSizeKB, long maxNbMsgPerDay, long nbRetentionDay) {

    selectService(myTester, LogicalQueueReceiveService.class);
    FormTester creationForm = NavigationUtils.getParamsFormTester(myTester);
    creationForm.setValue("label", name);
    creationForm.setValue("serviceName", serviceName);
    creationForm.setValue("serviceVersion", serviceVersion);
    creationForm.setValue("jndiQueueName", jndiQueuName);
    myTester.assertComponent(paramsFormPath + ":msgMaxSizeKB", DropDownChoice.class);
    myTester.assertComponent(paramsFormPath + ":maxNbMsgPerDay", DropDownChoice.class);
    myTester.assertComponent(paramsFormPath + ":nbRetentionDay", DropDownChoice.class);

    selectItem(myTester, creationForm, msgMaxSizeKB, "msgMaxSizeKB");
    selectItem(myTester, creationForm, maxNbMsgPerDay, "maxNbMsgPerDay");
    selectItem(myTester, creationForm, nbRetentionDay, "nbRetentionDay");
    NavigationUtils.submitParamsForm(myTester);

}
 
开发者ID:orange-cloudfoundry,项目名称:elpaaso-core,代码行数:20,代码来源:CreateObjectsWithGUI.java

示例3: testPreviewWrongUrl

import org.apache.wicket.util.tester.FormTester; //导入方法依赖的package包/类
@Test
public void testPreviewWrongUrl() {

    goOnGoodPage();
    //Create FormTester
    FormTester formTester = getMyTester().newFormTester(NavigationUtils.designerParamFormPath);
    //Set wrong url
    formTester.setValue("iconUrl","hicons.iconarchive.com/icons/ahdesign91/media-player/32/WinAmp-icon");
    //Update modelObject
    getMyTester().executeAjaxEvent(NavigationUtils.designerParamFormPath + ":iconUrl", "onchange");
    //Click on preview button
    getMyTester().executeAjaxEvent(NavigationUtils.designerParamFormPath+":imageContainer:preview", "onclick");
    //Check error
    getMyTester().assertContains("Invalid icon Url format");
    getMyTester().assertContains("no protocol: hicons.iconarchive.com/icons/ahdesign91/media-player/32/WinAmp-icon");

}
 
开发者ID:orange-cloudfoundry,项目名称:elpaaso-core,代码行数:18,代码来源:JeeProbeIT.java

示例4: testNegativeValueForMaxMessageSize

import org.apache.wicket.util.tester.FormTester; //导入方法依赖的package包/类
@Test
    public void testNegativeValueForMaxMessageSize() {

        //Create FormTester
        FormTester formTester = myTester.newFormTester(NavigationUtils.designerParamFormPath);
        //Fill form with default required values
        fillForm(formTester);
        // Set negative Value on msg size field
        formTester.setValue("msgMaxSizeKB", "-1");
        //Submit form
        myTester.executeAjaxEvent(NavigationUtils.designerParamFormPath + ":addUpdateButton", "onclick");
        //Check error
        //TODO : Wait for zenika i18n improvments
//        myTester.assertErrorMessages(new String[]{"msgMaxSizeKB doit �tre plus grand que 1"});

    }
 
开发者ID:orange-cloudfoundry,项目名称:elpaaso-core,代码行数:17,代码来源:InternalMomTest.java

示例5: formSubmitWithCSRFToken

import org.apache.wicket.util.tester.FormTester; //导入方法依赖的package包/类
public void formSubmitWithCSRFToken() throws Exception {
    getTester().startPage(LoginPage.class);
    getTester().assertRenderedPage(LoginPage.class);

    // We expect the CSRF token to be rendered in the HTML
    getTester().assertContains("SECURE_FORM_TOKEN");

    // If the user doesn't send the token, the form should fail!
    getTester().getRequest().getPostParameters().addParameterValue("SECURE_FORM_TOKEN",
            (String) getTester().getSession().getAttribute("SECURE_FORM_TOKEN"));

    // NOTE! formTester.submit() is by-passing the onSubmit() on DefaultLoginLink so it's not a real submit!!
    FormTester formTester = getTester().newFormTester("loginBorder:loginBorder_body:loginForm");
    formTester.setValue("loginPanel:username", "admin");
    formTester.setValue("loginPanel:password", "password");
    formTester.submit();

    // This doesn't work since FormTester doesn't actually call onSubmit() so we are not transferred anywhere after successful login
    //getTester().assertRenderedPage(HomePage.class);
}
 
开发者ID:alancnet,项目名称:artifactory,代码行数:21,代码来源:LoginPageTest.java

示例6: createWebServiceConsumerService

import org.apache.wicket.util.tester.FormTester; //导入方法依赖的package包/类
public static void createWebServiceConsumerService(PaasWicketTester myTester, String name, String jndiPrefix, LogicalSoapConsumer.SoapServiceDomainEnum domain
, String serviceProviderName, String serviceName, int serviceMajorVersion, int serviceMinorVersion) {

    selectService(myTester, LogicalSoapConsumer.class);
    FormTester creationForm = NavigationUtils.getParamsFormTester(myTester);
    creationForm.setValue("label", name);
    creationForm.setValue("jndiPrefix", jndiPrefix);
    //creationForm.select("wsDomain", domain.ordinal());
    //tester.executeAjaxEvent(paramsFormPath + ":wsDomain", "onchange");
    creationForm.setValue("serviceProviderName", serviceProviderName);
    creationForm.setValue("serviceName", serviceName);
    creationForm.setValue("serviceMajorVersion", String.valueOf(serviceMajorVersion));
    creationForm.setValue("serviceMinorVersion", String.valueOf(serviceMinorVersion));
    NavigationUtils.submitParamsForm(myTester);

}
 
开发者ID:orange-cloudfoundry,项目名称:elpaaso-core,代码行数:17,代码来源:CreateObjectsWithGUI.java

示例7: createRelationalDatabaseService

import org.apache.wicket.util.tester.FormTester; //导入方法依赖的package包/类
public static void createRelationalDatabaseService(PaasWicketTester myTester, String name, String serviceName
        , LogicalRelationalServiceSqlDialectEnum sqlVersion,
                                                   int capacityMo) {

    selectService(myTester, LogicalRelationalService.class);

    FormTester creationForm = NavigationUtils.getParamsFormTester(myTester);
    creationForm.setValue("label", name);
    creationForm.setValue("serviceName", serviceName);
    int sqlIndex = sqlVersion.ordinal();

    myTester.assertVisible(paramsFormPath + ":sqlVersion");
    myTester.assertComponent(paramsFormPath + ":sqlVersion", DropDownChoice.class);
    creationForm.select("sqlVersion", sqlIndex);
    creationForm.setValue("capacityMo", String.valueOf(capacityMo));

    NavigationUtils.submitParamsForm(myTester);

}
 
开发者ID:orange-cloudfoundry,项目名称:elpaaso-core,代码行数:20,代码来源:CreateObjectsWithGUI.java

示例8: testSaveValid

import org.apache.wicket.util.tester.FormTester; //导入方法依赖的package包/类
@Test
public void testSaveValid() {
    wicketTester.startPage(RegistrationPage.class);
    FormTester formTester = wicketTester.newFormTester("registration");
    formTester.setValue("firstname", "Max");
    formTester.setValue("lastname", "Müller");
    formTester.setValue("username", "Max.M");
    formTester.setValue("email", "[email protected]");
    formTester.setValue("password", "password123");
    formTester.setValue("repeatPassword", "password123");
    formTester.setValue("city", "München");
    formTester.setValue("street", "Lindwurmstr. 33");
    formTester.setValue("zip", "81369");

    wicketTester.hasNoInfoMessage();
}
 
开发者ID:zutherb,项目名称:AppStash,代码行数:17,代码来源:RegistrationPageTest.java

示例9: testSaveInvalid

import org.apache.wicket.util.tester.FormTester; //导入方法依赖的package包/类
@Test
public void testSaveInvalid() {
    wicketTester.startPage(RegistrationPage.class);
    FormTester formTester = wicketTester.newFormTester("registration");
    formTester.setValue("firstname", "Max");
    formTester.setValue("lastname", "Müller");
    formTester.setValue("username", "Max.M");
    formTester.setValue("email", "[email protected]");
    formTester.setValue("password", "passsword123");
    formTester.setValue("repeatPassword", "password123");
    formTester.setValue("city", "München");
    formTester.setValue("street", "Lindwurmstr. 33");
    formTester.setValue("zip", "81369");

    formTester.submit();

    //verify(userService, times(0));
    wicketTester.assertErrorMessages("The entered Passwords do not match");
}
 
开发者ID:zutherb,项目名称:AppStash,代码行数:20,代码来源:RegistrationPageTest.java

示例10: resourceBulkAction

import org.apache.wicket.util.tester.FormTester; //导入方法依赖的package包/类
@Test
public void resourceBulkAction() {
    Component component = findComponentByProp("key", "body:resources", "ws-target-resource-1");
    assertNotNull(component);
    TESTER.executeAjaxEvent(component.getPageRelativePath() + ":res", Constants.ON_CLICK);
    TESTER.clickLink("body:toggle:container:content:togglePanelContainer:container:actions:status");

    TESTER.assertComponent("body:toggle:outerObjectsRepeater:1:outer", Modal.class);

    FormTester formTester = TESTER.newFormTester("body:toggle:outerObjectsRepeater:1:outer:form");
    formTester.setValue("content:anyTypes:dropDownChoiceField", "0");
    TESTER.executeAjaxEvent(
            "body:toggle:outerObjectsRepeater:1:outer:form:content:anyTypes:dropDownChoiceField",
            Constants.ON_CHANGE);
    formTester.setValue("content:anyTypes:dropDownChoiceField", "0");

    component = findComponentByProp("key", "body:toggle:outerObjectsRepeater:1:outer:form:content:status:"
            + "firstLevelContainer:first:container:content:searchContainer:resultTable:tablePanel:groupForm:"
            + "checkgroup:dataTable", "b3cbc78d-32e6-4bd4-92e0-bbe07566a2ee");

    assertNotNull(component);

    TESTER.executeAjaxEvent(
            "body:toggle:outerObjectsRepeater:1:outer:dialog:footer:buttons:0:button", Constants.ON_CLICK);
}
 
开发者ID:apache,项目名称:syncope,代码行数:26,代码来源:TopologyITCase.java

示例11: createRole

import org.apache.wicket.util.tester.FormTester; //导入方法依赖的package包/类
private void createRole(final String name) {
    TESTER.clickLink("body:content:tabbedPanel:panel:container:content:add");

    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:form:view:key:textField", name);
    formTester.submit("content:form:buttons:next");

    formTester = TESTER.newFormTester("body:content:tabbedPanel:panel:outerObjectsRepeater:0:outer:form");
    formTester.setValue("content:form:view:entitlements:paletteField:recorder",
            "WORKFLOW_DEF_READ,NOTIFICATION_UPDATE,RELATIONSHIPTYPE_READ,RELATIONSHIPTYPE_LIST");
    formTester.submit("content:form:buttons:next");

    formTester = TESTER.newFormTester("body:content:tabbedPanel:panel:outerObjectsRepeater:0:outer:form");
    formTester.submit("content:form:buttons:next");

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

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

    TESTER.clickLink("body:configurationLI:configurationUL:administrationLI:administration");
}
 
开发者ID:apache,项目名称:syncope,代码行数:27,代码来源:RolesITCase.java

示例12: updateParameter

import org.apache.wicket.util.tester.FormTester; //导入方法依赖的package包/类
@Test
public void updateParameter() {
    TESTER.assertComponent("body:content:parametersPanel", WebMarkupContainer.class);

    Component result = findComponentByProp(SCHEMA, "body:content:parametersPanel", "notification.maxRetries");
    assertNotNull(result);

    TESTER.executeAjaxEvent(result.getPageRelativePath(), Constants.ON_CLICK);
    TESTER.clickLink("body:content:parametersPanel:outerObjectsRepeater:1:outer:container:content:"
            + "togglePanelContainer:container:actions:actions:actionRepeater:0:action:action");

    FormTester formTester = TESTER.newFormTester(
            "body:content:parametersPanel:container:content:modalDetails:form");

    formTester.setValue("content:parametersDetailsPanel:container:parametersForm:panel:spinner", "70");
    TESTER.clickLink("body:content:parametersPanel:"
            + "container:content:modalDetails:dialog:footer:inputs:0:submit");

    TESTER.assertInfoMessages("Operation executed successfully");
    TESTER.cleanupFeedbackMessages();
    TESTER.assertRenderedPage(Parameters.class);
}
 
开发者ID:apache,项目名称:syncope,代码行数:23,代码来源:ParametersITCase.java

示例13: login

import org.apache.wicket.util.tester.FormTester; //导入方法依赖的package包/类
/**
 * Logs the user in, if not already logged-in. If an user is already logged in then nothing is done. Therefore you must log-out an user
 * before any new login.
 * @param username
 * @param password not encrypted.
 */
public void login(final String username, final String password, final boolean checkDefaultPage)
{
  // start and render the test page
  tester.startPage(LoginPage.class);
  if (ClassUtils.isAssignable(tester.getLastRenderedPage().getClass(), WicketUtils.getDefaultPage()) == true) {
    // Already logged-in.
    return;
  }
  // assert rendered page class
  tester.assertRenderedPage(LoginPage.class);
  final FormTester form = tester.newFormTester("body:form");
  form.setValue(findComponentByLabel(form, "username"), username);
  form.setValue(findComponentByLabel(form, "password"), password);
  form.submit(KEY_LOGINPAGE_BUTTON_LOGIN);
  if (checkDefaultPage == true) {
    tester.assertRenderedPage(WicketUtils.getDefaultPage());
  }
}
 
开发者ID:micromata,项目名称:projectforge-webapp,代码行数:25,代码来源:WicketPageTestBase.java

示例14: testDependencyValueDeletion

import org.apache.wicket.util.tester.FormTester; //导入方法依赖的package包/类
public void testDependencyValueDeletion() {
    addDependencyValues();
    final Label oldLabel = (Label) tester.getComponentFromLastRenderedPage(listViewPath + ":0:baseAttributeValue");

    FormTester formTester = tester.newFormTester(formPath, false);
    formTester.setValue("dependenciesContainer:dependenciesListview:0:deleteCheckbox", true);
    tester.executeAjaxEvent(listViewPath + ":0:deleteCheckbox", "onclick");
    tester.executeAjaxEvent(formPath + ":deleteValuesButton", "onclick");

    final Label newLabel = (Label) tester.getComponentFromLastRenderedPage(listViewPath + ":0:baseAttributeValue");

    Assert.assertFalse(oldLabel.getDefaultModelObjectAsString().equals(newLabel.getDefaultModelObjectAsString()));
}
 
开发者ID:bptlab,项目名称:Unicorn,代码行数:14,代码来源:DependenciesPanelTest.java

示例15: addDependencyValues

import org.apache.wicket.util.tester.FormTester; //导入方法依赖的package包/类
private void addDependencyValues() {
    tester.executeAjaxEvent(formPath + ":addDependencyButton", "click");
    FormTester formTester = tester.newFormTester(formPath, false);
    formTester.setValue("baseAttributeInput", "String1");
    formTester.setValue("dependentAttributeInput", "1");
    tester.executeAjaxEvent(formPath + ":addDependencyValueButton", "click");
    formTester.setValue("baseAttributeInput", "String2");
    formTester.setValue("dependentAttributeInput", "2");
    tester.executeAjaxEvent(formPath + ":addDependencyValueButton", "click");
    tester.executeAjaxEvent(formPath + ":submitButton", "click");
}
 
开发者ID:bptlab,项目名称:Unicorn,代码行数:12,代码来源:DependenciesPanelTest.java


注:本文中的org.apache.wicket.util.tester.FormTester.setValue方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。