Examples of validate()


Examples of com.opensymphony.xwork2.validator.validators.ExpressionValidator.validate()

        ExpressionValidator ev = new ExpressionValidator();
        ev.setValidatorContext(new DelegatingValidatorContext(mock.proxy()));
        ev.setExpression("{top}");
        ev.setValueStack(ActionContext.getContext().getValueStack());
        ev.validate("Hello"); // {top} will evalute to Hello that is not a Boolean
        mock.verify();
    }

    @Override
    protected void setUp() throws Exception {
View Full Code Here

Examples of com.opensymphony.xwork2.validator.validators.RegexFieldValidator.validate()

        RegexFieldValidator validator = new RegexFieldValidator();
        validator.setExpression("^Sec.*");
        validator.setValidatorContext(new GenericValidatorContext(new Object()));
        validator.setFieldName("username");
        validator.setValueStack(ActionContext.getContext().getValueStack());
        validator.validate(testPerson);

        assertFalse(validator.getValidatorContext().hasErrors());
        assertFalse(validator.getValidatorContext().hasActionErrors());
        assertFalse(validator.getValidatorContext().hasActionMessages());
        assertFalse(validator.getValidatorContext().hasFieldErrors());
View Full Code Here

Examples of com.opensymphony.xwork2.validator.validators.URLValidator.validate()

   
    URLValidator validator = new URLValidator();
    validator.setValidatorContext(new GenericValidatorContext(new Object()));
    validator.setFieldName("testingUrl1");
        validator.setValueStack(ActionContext.getContext().getValueStack());
        validator.validate(new MyObject());
   
    assertFalse(validator.getValidatorContext().hasErrors());
    assertFalse(validator.getValidatorContext().hasActionErrors());
    assertFalse(validator.getValidatorContext().hasActionMessages());
    assertFalse(validator.getValidatorContext().hasFieldErrors());
View Full Code Here

Examples of com.opensymphony.xwork2.validator.validators.ValidatorSupport.validate()

        String messageKey = "does.not.exist";
        validator.setMessageKey(messageKey);

        ValidatorContext validatorContext = new DelegatingValidatorContext(new SimpleAction());
        validator.setValidatorContext(validatorContext);
        validator.validate(this);
        assertTrue(validatorContext.hasActionErrors());

        Collection<String> errors = validatorContext.getActionErrors();
        assertEquals(1, errors.size());
        assertEquals(messageKey, errors.toArray()[0]);
View Full Code Here

Examples of com.orientechnologies.orient.core.record.impl.ODocument.validate()

  public ODatabaseDocumentTx save(final ORecordInternal<?> iRecord) {
    if (!(iRecord instanceof ODocument))
      return (ODatabaseDocumentTx) super.save(iRecord);

    final ODocument doc = (ODocument) iRecord;
    doc.validate();

    try {
      if (doc.getIdentity().isNew()) {
        // NEW RECORD
        if (doc.getClassName() != null)
View Full Code Here

Examples of com.proofpoint.configuration.ConfigurationValidator.validate()

            }
        }

        // Validate configuration
        ConfigurationValidator configurationValidator = new ConfigurationValidator(configurationFactory, warningsMonitor);
        List<Message> messages = configurationValidator.validate(modules);

        // Log effective configuration
        if (!quiet) {
            logConfiguration(configurationFactory);
        }
View Full Code Here

Examples of com.psddev.dari.db.State.validate()

                        and("objectId = ?", object).
                        first();
            }

            if (schedule != null || publishDate != null) {
                if (!state.validate()) {
                    throw new ValidationException(Arrays.asList(state));
                }

                if (draft == null || param(boolean.class, "newSchedule")) {
                    draft = new Draft();
View Full Code Here

Examples of com.pugh.sockso.web.Submission.validate()

        replay( req );
        u.setRequest( req );
        u.setLocale( testLocale );
        final Submission s = u.getUpdateSubmission();
        boolean gotException = false;
        try { s.validate(); }
        catch ( Exception e ) { gotException = true; }
        assertTrue( gotException );
    }
   
    public void testGetNonScrobbledTracks() throws SQLException {
View Full Code Here

Examples of com.puppetlabs.geppetto.validation.ValidationService.validate()

      ValidationOptions options = getValidationOptions();
      options.setCheckLayout(true);
      options.setCheckModuleSemantics(true);
      options.setCheckReferences(true);
      options.setFileType(FileType.PUPPET_ROOT);
      BuildResult br = vs.validate(chain, root, options, null, SubMonitor.convert(null));

      // System.err.println(errorsToString(chain));
      StringBuilder builder = new StringBuilder();
      builder.append("Diagnostic: A version should be specified.\n");
      builder.append("Diagnostic: A version should be specified.\n");
View Full Code Here

Examples of com.sardak.antform.types.BaseType.validate()

   */
  protected void build() {
    displayedWidgets = new ArrayList();
    for (int i = 0; i < widgets.size(); i++) {
      BaseType o = (BaseType) widgets.get(i);
      if (o.validate(this)) {
        if (o.shouldBeDisplayed(getProject())) {
          if (o instanceof DummyComponent) {
            o = ((DummyComponent) o).getRealType();
            widgets.set(i, o);
          }
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.