Package hudson.util

Examples of hudson.util.FormValidation$FileValidator


        assertTrue(internetAddresses.contains(new InternetAddress("ashlux@gmail.com")));
    }

    @Test
    public void testValidateFormRecipientList_validationShouldPassAListOfGoodEmailAddresses() {
        FormValidation formValidation =
                emailRecipientUtils.validateFormRecipientList("ashlux@gmail.com internal somewhere@domain");

        assertEquals(FormValidation.Kind.OK, formValidation.kind);
    }
View Full Code Here


        assertEquals(FormValidation.Kind.OK, formValidation.kind);
    }

    @Test
    public void testValidateFormRecipientList_validationShouldFailWithBadEmailAddress() {
        FormValidation formValidation =
                emailRecipientUtils.validateFormRecipientList("@@@");

        assertEquals(FormValidation.Kind.ERROR, formValidation.kind);
    }
View Full Code Here

            cause.getClass();
            this.cause = cause;
        }

        public boolean matches(Object o) {
            FormValidation v = (FormValidation) o;
            return v.getMessage().contains(cause.getName());
        }
View Full Code Here

            kind.getClass();
            this.kind = kind;
        }

        public boolean matches(Object o) {
            FormValidation v = (FormValidation) o;
            return v.kind == kind;
        }
View Full Code Here

        public String getDisplayName() {
            return "JSON configuration";
        }

        public FormValidation doCheckConfig(@QueryParameter( "config" ) String config) {
            FormValidation notEmpty = FormValidation.validateRequired(config);
            if (!notEmpty.equals(FormValidation.ok())) {
                return notEmpty;
            }
            try {
                new JSONObject(config);
                // We don't want to validate the fields, even RegistrationRequest doesn't ... It just ignores the unknown fields.
View Full Code Here

     * Verifies that Axis names are valid and unique.
     */
    private void checkAxisNames(Iterable<Axis> newAxes) throws FormException {
        HashSet<String> axisNames = new HashSet<String>();
        for (Axis a : newAxes) {
            FormValidation fv = a.getDescriptor().doCheckName(a.getName());
            if (fv.kind!=Kind.OK)
                throw new FormException(Messages.MatrixProject_DuplicateAxisName(),fv,"axis.name");

            if (axisNames.contains(a.getName()))
                throw new FormException(Messages.MatrixProject_DuplicateAxisName(),"axis.name");
View Full Code Here

       
        FreeStyleProject p = createFreeStyleProject(jobName);
        p.setDisplayName("displayName");
       
        Jenkins jenkins = Jenkins.getInstance();
        FormValidation v = jenkins.doCheckDisplayName("1displayName", curJobName);
        Assert.assertEquals(FormValidation.ok(), v);
    }
View Full Code Here

       
        FreeStyleProject p = createFreeStyleProject(jobName);
        p.setDisplayName(displayName);
       
        Jenkins jenkins = Jenkins.getInstance();
        FormValidation v = jenkins.doCheckDisplayName(displayName, curJobName);
        Assert.assertEquals(FormValidation.Kind.WARNING, v.kind);       
    }
View Full Code Here

       
        FreeStyleProject p = createFreeStyleProject(jobName);
        p.setDisplayName(displayName);
       
        Jenkins jenkins = Jenkins.getInstance();
        FormValidation v = jenkins.doCheckDisplayName(jobName, curJobName);
        Assert.assertEquals(FormValidation.Kind.WARNING, v.kind);               
    }
View Full Code Here

        int v = o.getInt("updateCenterVersion");
        if(v !=1)
            throw new IllegalArgumentException("Unrecognized update center version: "+v);

        if (signatureCheck) {
            FormValidation e = verifySignature(o);
            if (e.kind!=Kind.OK) {
                LOGGER.severe(e.renderHtml());
                return e;
            }
        }

        LOGGER.info("Obtained the latest update center data file for UpdateSource " + id);
View Full Code Here

TOP

Related Classes of hudson.util.FormValidation$FileValidator

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.