Examples of Validation


Examples of org.geotools.validation.Validation

    //get all validation tests from the featureLookup
    Set<Validation> validations = new HashSet<Validation>();
    for (Iterator i = featureLookup.keySet().iterator(); i.hasNext();) {
      ArrayList list = (ArrayList) featureLookup.get(i.next());
      for (int j = 0; j < list.size(); j++) {
        Validation test = (Validation) list.get(j);
        validations.add(test);
      }
    }
   
    //clear the FV Lookup
    featureLookup.clear();
   
    //add each test to the Lookup (again)
    for (Iterator i = validations.iterator(); i.hasNext();) {
      Validation validation = (Validation) i.next();
      if (validation instanceof FeatureValidation) {
        //FeatureValidation FV = (FeatureValidation) validation;
        //addToFVLookup(FV); // <-- this is the proper way to do this
       
        //NOTE: code below is a verbatim copy of addToFVLookup(), which is private
        //TODO: change org.geotools.validation.ValidationProcessor.addToFVLookup() to public or protected?
            String[] featureTypeList = validation.getTypeRefs();
 
            if (featureTypeList == Validation.ALL) // if null (ALL)
        {
          ArrayList<Validation> tests = (ArrayList) featureLookup.get(ANYTYPENAME);
View Full Code Here

Examples of org.geotools.validation.Validation

    // get all validation tests from the integrityLookup
    Set<Validation> validations = new HashSet<Validation>();
    for (Iterator i = integrityLookup.keySet().iterator(); i.hasNext();) {
      ArrayList list = (ArrayList) integrityLookup.get(i.next());
      for (int j = 0; j < list.size(); j++) {
        Validation test = (Validation) list.get(j);
        validations.add(test);
      }
    }

    // clear the IV Lookup
    integrityLookup.clear();

    // add each test to the Lookup (again)
    for (Iterator i = validations.iterator(); i.hasNext();) {
      Validation validation = (Validation) i.next();
      if (validation instanceof IntegrityValidation) {
        // IntegrityValidation IV = (IntegrityValidation) validation;
        // addToIVLookup(IV); // <-- this is the proper way to do this

        // NOTE: code below is a verbatim copy of addToIVLookup(), which is private
        // TODO: change org.geotools.validation.ValidationProcessor.addToIVLookup() to public or protected?
        String[] integrityTypeList = validation.getTypeRefs();

        if (integrityTypeList == Validation.ALL) // if null (ALL)
        {
          ArrayList<Validation> tests = (ArrayList) integrityLookup.get(ANYTYPENAME);
          if (tests == null) { // if an ALL test doesn't exist yet
View Full Code Here

Examples of org.geotools.validation.Validation

    //iterate through each item in the map (should contain a single ArrayList)
    for (Iterator i = FVLookup.keySet().iterator(); i.hasNext();) {
      ArrayList testList = (ArrayList) FVLookup.get(i.next());
      //iterate through each item in the list
      for (Object thisTest : testList) {
        Validation validation = (Validation) thisTest;
        // this is the matching validation for the given test
        if (validation.getName().equals(test.getName())) {
          //create a property descriptor containing the argument name and plugin class
          PropertyDescriptor property = new PropertyDescriptor(arg.getName(), validation.getClass());
              if (property == null) {
                  // error here
                  continue;
              }
              //store the value of the argument in the property descriptor
              try {
                property.getWriteMethod().invoke(validation,
                      new Object[] { arg.getValue() });
              } catch (IllegalArgumentException e) {
                String val = arg.getValue() == null? arg.getValue().toString():"null"; //$NON-NLS-1$
                  throw new ValidationException("test failed to configure " //$NON-NLS-1$
                      + validation.getClass().getSimpleName() + " " + arg.getName()+ " "+val, e); //$NON-NLS-1$ //$NON-NLS-2$
              } catch (IllegalAccessException e) {
            String val = arg.getValue() == null? arg.getValue().toString():"null"; //$NON-NLS-1$
            throw new ValidationException("test failed to configure " //$NON-NLS-1$
              + validation.getClass().getSimpleName() + " " + arg.getName()+ " "+val, e); //$NON-NLS-1$ //$NON-NLS-2$
              } catch (InvocationTargetException e) {
            String val = arg.getValue() == null? arg.getValue().toString():"null"; //$NON-NLS-1$
            throw new ValidationException("test failed to configure " //$NON-NLS-1$
              + validation.getClass().getSimpleName() + " " + arg.getName()+ " "+val, e); //$NON-NLS-1$ //$NON-NLS-2$
              }
        }
      }
    }
  }
View Full Code Here

Examples of org.hdiv.validator.Validation

  }

  public void testSchema() {

    Validation validation = (Validation) this.context.getBean("id1");
    assertNotNull(validation);
    System.out.println(validation.toString());
    System.out.println("-----------------------");

    HDIVConfig hdivConfig = this.context.getBean(HDIVConfig.class);
    assertNotNull(hdivConfig);
    System.out.println(hdivConfig.toString());
View Full Code Here

Examples of org.jboss.jca.common.api.metadata.common.Validation

            setAttribute(model, IDLETIMEOUTMINUTES, timeOut.getIdleTimeoutMinutes());

            setAttribute(model, XA_RESOURCE_TIMEOUT, timeOut.getXaResourceTimeout());
        }
        final Validation validation = connDef.getValidation();
        if (validation != null) {
            setAttribute(model, BACKGROUNDVALIDATIONMILLIS, validation.getBackgroundValidationMillis());

            setAttribute(model, BACKGROUNDVALIDATION, validation.isBackgroundValidation());

            setAttribute(model, USE_FAST_FAIL, validation.isUseFastFail());

            setAttribute(model, VALIDATE_ON_MATCH, validation.isValidateOnMatch());
        }
        final Recovery recovery = connDef.getRecovery();
        if (recovery != null) {
            setAttribute(model, NO_RECOVERY, recovery.getNoRecovery());
            final Extension recoverPlugin = recovery.getRecoverPlugin();
View Full Code Here

Examples of org.jboss.jca.common.api.metadata.ds.Validation

      TransactionIsolation transactionIsolation = null;
      Map<String, String> xaDataSourceProperty = new HashMap<String, String>();
      TimeOut timeOutSettings = null;
      DsSecurity securitySettings = null;
      Statement statementSettings = null;
      Validation validationSettings = null;
      String urlDelimiter = null;
      String urlSelectorStrategyClassName = null;
      String newConnectionSql = null;
      CommonXaPool xaPool = null;
      Recovery recovery = null;
View Full Code Here

Examples of org.jboss.jca.common.api.metadata.ds.Validation

      TransactionIsolation transactionIsolation = null;
      Map<String, String> connectionProperties = new HashMap<String, String>();
      TimeOut timeOutSettings = null;
      DsSecurity securitySettings = null;
      Statement statementSettings = null;
      Validation validationSettings = null;
      String urlDelimiter = null;
      String urlSelectorStrategyClassName = null;
      String newConnectionSql = null;
      CommonPool pool = null;
View Full Code Here

Examples of org.jboss.jca.common.api.metadata.ds.Validation

      TransactionIsolation transactionIsolation = null;
      Map<String, String> xaDataSourceProperty = new HashMap<String, String>();
      TimeOut timeOutSettings = null;
      DsSecurity securitySettings = null;
      Statement statementSettings = null;
      Validation validationSettings = null;
      String urlDelimiter = null;
      String urlProperty = null;
      String urlSelectorStrategyClassName = null;
      String newConnectionSql = null;
      DsXaPool xaPool = null;
View Full Code Here

Examples of org.jboss.jca.common.api.metadata.ds.Validation

      TransactionIsolation transactionIsolation = null;
      Map<String, String> connectionProperties = new HashMap<String, String>();
      TimeOut timeOutSettings = null;
      DsSecurity securitySettings = null;
      Statement statementSettings = null;
      Validation validationSettings = null;
      String urlDelimiter = null;
      String urlSelectorStrategyClassName = null;
      String newConnectionSql = null;
      DsPool pool = null;
View Full Code Here

Examples of org.jboss.jca.common.api.metadata.ds.Validation

      TransactionIsolation transactionIsolation = null;
      Map<String, String> xaDataSourceProperty = new HashMap<String, String>();
      TimeOut timeOutSettings = null;
      DsSecurity securitySettings = null;
      Statement statementSettings = null;
      Validation validationSettings = null;
      String urlDelimiter = null;
      String urlSelectorStrategyClassName = null;
      String newConnectionSql = null;
      DsXaPool xaPool = null;
      Recovery recovery = null;
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.