Package org.apache.wicket.mock

Examples of org.apache.wicket.mock.MockRequestParameters


    Assert.assertNotNull(errorMessage);
  }

  protected void addParams()
  {
    MockRequestParameters params = tester.getRequest().getPostParameters();
    params.addParameterValue("num", "2");
    params.addParameterValue("file[0].name", "test.txt");
    params.addParameterValue("file[0].size", "2048");
    params.addParameterValue("file[0].type", "");
    params.addParameterValue("file[1].name", "test2.txt");
    params.addParameterValue("file[1].size", "2048");
    params.addParameterValue("file[1].type", "text/plain");
    params.addParameterValue("file[1].lastModifiedTime", "1302254582");
  }
View Full Code Here


   * @param form
   *            the {@link Form} which components should be submitted
   */
  private void serializeFormToRequest(final Form<?> form)
  {
    final MockRequestParameters postParameters = request.getPostParameters();
    final Set<String> currentParameterNamesSet = postParameters.getParameterNames();

    form.visitFormComponents(new IVisitor<FormComponent<?>, Void>()
    {
      @Override
      public void component(final FormComponent<?> formComponent, final IVisit<Void> visit)
      {
        final String inputName = formComponent.getInputName();
        if (!currentParameterNamesSet.contains(inputName))
        {
          String[] values = FormTester.getInputValue(formComponent);
          for (String value : values)
          {
            postParameters.addParameterValue(inputName, value);
          }
        }
      }
    });
  }
View Full Code Here

   * @param form
   *            the {@link Form} which components should be submitted
   */
  private void serializeFormToRequest(final Form<?> form)
  {
    final MockRequestParameters postParameters = request.getPostParameters();
    final Set<String> currentParameterNamesSet = postParameters.getParameterNames();

    form.visitFormComponents(new IVisitor<FormComponent<?>, Void>()
    {
      @Override
      public void component(final FormComponent<?> formComponent, final IVisit<Void> visit)
      {
        final String inputName = formComponent.getInputName();
        if (!currentParameterNamesSet.contains(inputName))
        {
          String[] values = FormTester.getInputValue(formComponent);
          for (String value : values)
          {
            postParameters.addParameterValue(inputName, value);
          }
        }
      }
    });
  }
View Full Code Here

TOP

Related Classes of org.apache.wicket.mock.MockRequestParameters

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.