Examples of ValidationInfo


Examples of org.strecks.validator.internal.ValidationInfo

    Iterator iterator = createStrictMock(Iterator.class);
    OrderedProperty op = createStrictMock(OrderedProperty.class);
    MethodValidators methodValidators = createStrictMock(MethodValidators.class);
    Converter converter = createStrictMock(Converter.class);

    ValidationInfo vi = new ValidationInfo(validators, handler, new DefaultConversionHandler());

    expect(validators.keySet()).andReturn(keys);
    expect(keys.iterator()).andReturn(iterator);
    expect(iterator.hasNext()).andReturn(true);
    expect(iterator.next()).andReturn(op);
View Full Code Here

Examples of org.strecks.validator.internal.ValidationInfo

    Iterator iterator = createStrictMock(Iterator.class);
    OrderedProperty op = createStrictMock(OrderedProperty.class);
    MethodValidators methodValidators = createStrictMock(MethodValidators.class);
    Converter converter = createStrictMock(Converter.class);

    ValidationInfo vi = new ValidationInfo(validators, handler, new DefaultConversionHandler());

    expect(validators.keySet()).andReturn(keys);
    expect(keys.iterator()).andReturn(iterator);
    expect(iterator.hasNext()).andReturn(true);
    expect(iterator.next()).andReturn(op);
View Full Code Here

Examples of org.strecks.validator.internal.ValidationInfo

  public void testValidatableBean()
  {

    ValidatableBean bean = new ValidatableBean();
    ValidationAnnotationReader reader = new ValidationAnnotationReader();
    ValidationInfo info = reader.readValidationHandlers(bean, null);

    Map<OrderedProperty, MethodValidators> map = info.getValidators();

    System.out.println(map);

    /***************************************************************************************************************
     *
 
View Full Code Here

Examples of org.strecks.validator.internal.ValidationInfo

  public void testMultiValidatableBean()
  {

    MultiValidatorBean bean = new MultiValidatorBean();
    ValidationAnnotationReader reader = new ValidationAnnotationReader();
    ValidationInfo info = reader.readValidationHandlers(bean, null);

    Map<OrderedProperty, MethodValidators> map = info.getValidators();

    System.out.println(map);

    // requiredDate
    List<ValidatorWrapper> list = get(map, "requiredDate").getValidators();
View Full Code Here

Examples of org.strecks.validator.internal.ValidationInfo

    Assert.notNull(form);
    Assert.notNull(request);

    Class formClass = getFormClass(form);

    ValidationInfo validationInfo = null;

    synchronized (validationHandlerMap)
    {
      validationInfo = validationHandlerMap.get(formClass);
      if (validationInfo == null)
View Full Code Here

Examples of org.wso2.carbon.throttling.agent.validation.ValidationInfo

        CurrentSession.setAttribute(StratosConstants.REGISTRY_ACTION_VALIDATED_SESSION_ATTR, true);

        int tenantId = CurrentSession.getTenantId();

        ValidationInfoRetriever validationInfoRetriever = Util.getValidationInfoRetriever();
        ValidationInfo validationInfo;
        try {
            validationInfo = validationInfoRetriever.getValidationInfo(action, tenantId);
        } catch (ValidationException e) {
            String msg = "Error in getting the validation information.";
            log.error(msg, e);
            throw new RegistryException(msg, e);
        }
        if (validationInfo.isActionBlocked()) {
            String blockedMsg = validationInfo.getBlockedActionMsg();
            String msg =
                    "The throttling action is blocked. message: " + blockedMsg + ", action: " +
                            action + ".";
            log.error(msg);
            // we are only throwing the blocked exception, as it is a error
View Full Code Here

Examples of org.wso2.carbon.throttling.agent.validation.ValidationInfo

        String[] actions = new String[]{StratosConstants.THROTTLING_SERVICE_IN_BANDWIDTH_ACTION,
                                        StratosConstants.THROTTLING_SERVICE_OUT_BANDWIDTH_ACTION,
                                        StratosConstants.THROTTLING_SERVICE_REQUEST_ACTION,
                                        StratosConstants.THROTTLING_SERVICE_RESPONSE_ACTION
                                        };
        ValidationInfo validationInfo;
        try {
            validationInfo = validationInfoRetriever.getValidationInfo(actions, tenantId);
        } catch (ValidationException e) {
            String msg = "Error in getting the validation information.";
            log.error(msg, e);
            throw new AxisFault(msg, e);
        }
        if (validationInfo.isActionBlocked()) {
            String blockedMsg = validationInfo.getBlockedActionMsg();
            String msg = "The throttling action is blocked. message: " + blockedMsg;
            log.error(msg);
            // we are only throwing the blocked exception, as it is a error message for the user
            throw new AxisFault(blockedMsg);
        }
View Full Code Here

Examples of org.wso2.carbon.throttling.agent.validation.ValidationInfo

            log.error(msg + " tenantId: " + tenantId + ".", e1);
            throw new UserStoreException(msg, e1);
        }

        ValidationInfoRetriever validationInforRetriever = Util.getValidationInfoRetriever();
        ValidationInfo validationInfo;
        try {
            validationInfo = validationInforRetriever.getValidationInfo(
                            StratosConstants.THROTTLING_ADD_USER_ACTION, tenantId);
        } catch (ValidationException e) {
            String msg = "Error in getting the validation information.";
            log.error(msg, e);
            throw new UserStoreException(msg, e);
        }
        if (validationInfo.isActionBlocked()) {
            String blockedMsg = validationInfo.getBlockedActionMsg();
            String msg = "The add user action is blocked. message: " + blockedMsg + ".";
            log.error(msg);
            // we are only throwing the blocked exception, as it is a error message for the user
            throw new UserStoreException(blockedMsg);
        }
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.