Package org.megatome.frame2.jaxbgen

Examples of org.megatome.frame2.jaxbgen.Items$Item


    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

  }

  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

  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

  @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

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

     * @return Error object
     * @see org.megatome.frame2.errors.Error
     */
    public final static org.megatome.frame2.errors.Error createError(final String key, final Object value1,
            final Object value2, final Object value3) {
        return new ErrorImpl(key, value1, value2, value3);
    }
View Full Code Here

   * @throws ConfigException
   *             DOCUMENT ME!
   */
  public EventProxy getEventProxy(String eventName) throws ConfigException {
    EventDef eventDef = this.events.get(eventName);
    Event event = null;

    if (eventDef == null) {
      throw new ConfigException("Invalid Event Name: " + eventName); //$NON-NLS-1$
    }

    try {
      String type = eventDef.getType();

      if (type != null) {
        // event = (Event) getClass().forName(type).newInstance();
        event = (Event) Class.forName(type).newInstance();
        event.setEventName(eventName);
      }
    } catch (Exception e) {
      throw new ConfigException("Invalid Event ", e); //$NON-NLS-1$
    }

View Full Code Here

TOP

Related Classes of org.megatome.frame2.jaxbgen.Items$Item

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.