Package org.megatome.frame2.event

Examples of org.megatome.frame2.event.Event


     * @param value3 Third value to insert into message
     * @see org.megatome.frame2.errors.Errors#add(String,Object,Object,Object)
     */
    public Error addIfUnique(final String key, final Object value1,
            final Object value2, final Object value3) {
        Error error = new ErrorImpl(key, value1, value2, value3);

        if (!contains(error)) {
            add(error);
        }

View Full Code Here


  }

  private boolean setupEmailTest(final String emailAddr) {
    this.testBean.setEmail(emailAddr);
    this.testBean.setEmpty("dude"); //$NON-NLS-1$
    final Errors errors = setupAndRunValidate(this.testBean,
        EMAIL_BEAN_NAME);
    return validateErrors(errors);
  }
View Full Code Here

  }

  private Errors setupAndRunValidate(final CommonsValidatorBean testBean,
      final String fieldBeanName) {
    // Add an error to verify the error is passed in..
    final Errors errors = ErrorsFactory.newInstance();
    errors.add("seed", "dude"); //$NON-NLS-1$ //$NON-NLS-2$

    final Validator validator = new Validator(this.validatorResources,
        fieldBeanName);
    // add the name bean to the validator as a resource
    // for the validations to be performed on.
View Full Code Here

  public void testNullEmailNotRequired() {
    this.validatorResources = buildValidatorResources();

    this.testBean.setEmpty("dude"); //$NON-NLS-1$

    final Errors errors = setupAndRunValidate(this.testBean,
        EMAIL_BEAN_NAME);
    assertEquals(DEF_ERRORS_SIZE, errors.size());

  }
View Full Code Here

    this.validatorResources = buildValidatorResources();

    this.testBean.setRequired("required"); //$NON-NLS-1$

    final Errors errors = setupAndRunValidate(this.testBean,
        REQUIRED_BEAN_NAME);
    assertEquals(DEF_ERRORS_SIZE, errors.size());
  }
View Full Code Here

  @Test
  public void testNegativeRequired() {

    this.validatorResources = buildValidatorResources();

    final Errors errors = setupAndRunValidate(this.testBean,
        REQUIRED_BEAN_NAME);

    assertTrue(validateErrors(errors));
  }
View Full Code Here

    this.validatorResources = buildValidatorResources();

    this.testBean.setPhone("303-123-1234"); //$NON-NLS-1$

    final Errors errors = setupAndRunValidate(this.testBean, MASK_BEAN_NAME);
    assertEquals(DEF_ERRORS_SIZE, errors.size());
  }
View Full Code Here

    this.validatorResources = buildValidatorResources();

    this.testBean.setPhone("303-123"); //$NON-NLS-1$

    final Errors errors = setupAndRunValidate(this.testBean, MASK_BEAN_NAME);

    assertTrue(validateErrors(errors));
  }
View Full Code Here

  @Test
  public void testNullPhone() {

    this.validatorResources = buildValidatorResources();

    final Errors errors = setupAndRunValidate(this.testBean, MASK_BEAN_NAME);

    assertEquals(DEF_ERRORS_SIZE, errors.size());
  }
View Full Code Here

  @SuppressWarnings("boxing")
  private void runTest(final CommonsValidatorBean bean, final String beanName) {
    this.validatorResources = buildValidatorResources();

    final Errors errors = setupAndRunValidate(bean, beanName);
    assertEquals(DEF_ERRORS_SIZE, errors.size());
  }
View Full Code Here

TOP

Related Classes of org.megatome.frame2.event.Event

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.