Examples of Errors


Examples of org.megatome.frame2.errors.Errors

    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

Examples of org.megatome.frame2.errors.Errors

  @Test
  public void testNegativeRequired() {

    this.validatorResources = buildValidatorResources();

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

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

Examples of org.megatome.frame2.errors.Errors

    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

Examples of org.megatome.frame2.errors.Errors

    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

Examples of org.megatome.frame2.errors.Errors

  @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

Examples of org.megatome.frame2.errors.Errors

  @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

Examples of org.megatome.frame2.errors.Errors

  }

  private void runTestNegative(final CommonsValidatorBean bean,
      final String beanName) {
    this.validatorResources = buildValidatorResources();
    final Errors errors = setupAndRunValidate(bean, beanName);
    assertTrue(validateErrors(errors));
  }
View Full Code Here

Examples of org.megatome.frame2.errors.Errors

  private void runTestNegative(final CommonsValidatorBean bean,
      final String beanName, final String overRideDefErrorMessage,
      final String errorKey) {
    this.validatorResources = buildValidatorResources();
    final Errors errors = setupAndRunValidate(bean, beanName);
    assertTrue(validateErrors(errors, overRideDefErrorMessage, errorKey));
  }
View Full Code Here

Examples of org.megatome.frame2.errors.Errors

  @Test
  public void testValidate() throws Exception {
    PurchaseOrderType po = unmarshall();
    Schema s = loadSchema();
   
    Errors errors = ErrorsFactory.newInstance();

    Items.Item item1 = po.getItems().getItem().get(0);
   
    //assertTrue(po.validate(errors));
    roundTripValidate(po, s, errors);
    assertEquals(0, errors.size());

    item1.setPartNum("AAAAAA"); //$NON-NLS-1$

    roundTripValidate(po, s, errors);
    //assertFalse(po.validate(errors));
    assertEquals(2, errors.size());

    item1.setQuantity(101);

    errors.release();
    errors = ErrorsFactory.newInstance();

    roundTripValidate(po, s, errors);
    //assertFalse(po.validate(errors));
    assertEquals(4, errors.size());
  }
View Full Code Here

Examples of org.megatome.frame2.errors.Errors

    *
    * @throws JspException
    */
   @Override
   public int doStartTag() throws JspException {
      Errors errors = getErrors(this.pageContext);

      if ((errors == null) || errors.isEmpty()) {
         return EVAL_BODY_INCLUDE;
      }

      StringBuffer buffer = new StringBuffer();

      Locale locale = HTMLHelpers.getLocale(this.pageContext,this.localeKey);
      ResourceBundle bundle = ResourceLocator.getBundle(locale);

      addElement(bundle, locale, buffer, Globals.ERRORS_HEADER, true);

      for (Error errs : errors.get(this.errorKey)) {
         addElement(bundle, locale, buffer, Globals.ERRORS_PREFIX, false);                 
         buffer.append(errs.getMessage(locale));
         addElement(bundle, locale, buffer, Globals.ERRORS_SUFFIX, false);
         buffer.append("\n"); //$NON-NLS-1$
      }
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.