Examples of FormInput


Examples of com.crawljax.forms.FormInput

   * .
   */
  @Test
  public final void testGetInputWithRandomValue() {
    assertNull("Wrong Xpath so null as result of InputWithRandomValue",
            browser.getInputWithRandomValue(new FormInput("text", new Identification(
                    How.xpath, "/RUBISH"), "abc")));
  }
View Full Code Here

Examples of com.crawljax.forms.FormInput

   * {@link com.crawljax.browser.EmbeddedBrowser#getInputWithRandomValue(com.crawljax.forms.FormInput)}
   * .
   */
  @Test(expected = BrowserConnectionException.class)
  public void testGetInputWithRandomValue() {
    browser.getInputWithRandomValue(new FormInput("text", new Identification(How.xpath,
            "/HTML"), "abc"));
  }
View Full Code Here

Examples of com.crawljax.forms.FormInput

   * .
   */
  @Test
  public final void testGetInputWithRandomValue() {
    assertNull("Wrong Xpath so null as result of InputWithRandomValue",
            browser.getInputWithRandomValue(new FormInput("text", new Identification(
                    How.xpath, "/RUBISH"), "abc")));
  }
View Full Code Here

Examples of de.odysseus.calyxo.forms.FormInput

    if (this.inputs != null) {
      VariableResolver resolver = new CalyxoVariableResolver(request);
      Iterator inputs = getFormInputs();
      while (inputs.hasNext()) {
        FormInput input = (FormInput)inputs.next();
        if (input.isIgnored(resolver)) {
          result.add(new IgnoredFormInputResult(input, params));
        } else {
          result.add(input.validate(request, params, resolver));
        }
      }
    }

    if (asserts != null) {
View Full Code Here

Examples of de.odysseus.calyxo.forms.FormInput

  /**
   * Add input result
   */
  void add(FormInputResult value) {
    FormInput input = value.getFormInput();
    values.put(input.getName(), value);
    if (!value.isValid() && !value.isIgnored()) {
      invalid = true;
      if (!value.isRelaxed()) {
        messages.addMessage(input.getName(), value.getFirstMessage());
        if (input.isArray()) {
          Iterator iter = value.getLastMessages();
          while (iter.hasNext()) {
            messages.addMessage(input.getName(), (Message)iter.next());
          }
        }
      }
    }
  }
View Full Code Here

Examples of de.odysseus.calyxo.forms.FormInput

    if (assertFailedNames == null) {
      assertFailedNames = new HashSet();
    }
    Iterator involved = resolver.getInvolvedFormInputs();
    while (involved.hasNext()) {
      FormInput input = (FormInput)involved.next();
      assertFailedNames.add(input.getName());
    }
    messages.addGlobalMessage(message);
  }
View Full Code Here

Examples of de.odysseus.calyxo.forms.FormInput

          FormInputResult result =
            formResult.getFormInputResult(name);
          if (result == null) {
            throw new NoSuchElementException("Bad input name: " + name);
          }
          FormInput input = result.getFormInput();
          involvedInputs.add(input);
          if (input.isArray()) {
            return inputValues._getInputs(name);
          } else {
            return inputValues._getInput(name);
          }
        }
View Full Code Here

Examples of de.odysseus.calyxo.forms.FormInput

          if (field == null) {
            throw new NoSuchElementException("Bad property name: " + key);
          }
          FormInputResult result =
            formResult.getFormInputResult(field.getName());
          FormInput input = result.getFormInput();
          involvedInputs.add(input);
          if (!result.isValid()) {
            invalidPropertyReferenced = true;
            return null;
          }
View Full Code Here

Examples of de.odysseus.calyxo.forms.FormInput

  /**
   * Check if the specified component corresponds to an input in this form.
   */
  public void check(FormComponent component) throws ConfigException {
    FormInput input = form.getFormInput(component.getName());
    if (input == null) {
      throw new ConfigException("Input '" + component.getName() + "' does not exist!");
    }
    if (!input.isArray() && component.getIndex() >= 0) {
      throw new ConfigException("Input '" + component.getName() + "' is not an array, but has an index!");
    }
  }
View Full Code Here

Examples of de.odysseus.calyxo.forms.FormInput

 
  /**
   * Get value for specified component.
   */
  public String getInputValue(FormComponent component) throws Exception {
    FormInput input = form.getFormInput(component.getName());
    if (input.isArray()) {
      int index = component.getIndex();
      if (index < 0) {
        throw new ConfigException("Input '" + component.getName() + "' has no index");
      }
      if (result != null) {
        FormInputResult inputResult = result.getFormInputResult(component.getName());
        if (index >= inputResult.getSize()) {
          return NOT_AVAILABLE;
        }
        return inputResult.format(request, index);
      } else if (data != null) {
        return input.format(request, data, index, NOT_AVAILABLE);
      }
    } else {
      if (result != null) {
        return (String)result.getFormInputResult(component.getName()).format(request);
      } else if (data != null) {
        return (String)input.format(request, data);
      }
    }
    return NOT_AVAILABLE;
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.