Package org.apache.wicket.mock

Examples of org.apache.wicket.mock.MockRequestParameters


   * @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

   * @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

   * @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>()
    {
      public void component(final FormComponent<?> formComponent, final IVisit<Void> visit)
      {
        final String inputName = formComponent.getInputName();
        if (!currentParameterNamesSet.contains(inputName))
        {
          final Object modelObject = formComponent.getModelObject();
          if (modelObject instanceof Collection<?>)
          {
            final Collection<?> collectionModelObject = (Collection<?>)modelObject;
            for (Object value : collectionModelObject)
            {
              postParameters.addParameterValue(inputName, value.toString());
            }
          }
          else
          {
            postParameters.addParameterValue(inputName, formComponent.getValue());
          }
        }
      }
    });
  }
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>()
    {
      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

   * @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>()
    {
      public void component(final FormComponent<?> formComponent, final IVisit<Void> visit)
      {
        final String inputName = formComponent.getInputName();
        if (!currentParameterNamesSet.contains(inputName))
        {
          final Object modelObject = formComponent.getModelObject();
          if (modelObject instanceof Collection<?>)
          {
            final Collection<?> collectionModelObject = (Collection<?>)modelObject;
            for (Object value : collectionModelObject)
            {
              postParameters.addParameterValue(inputName, value.toString());
            }
          }
          else
          {
            postParameters.addParameterValue(inputName, formComponent.getValue());
          }
        }
      }
    });
  }
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.