Search in sources :

Example 16 with FormValidation

use of hudson.util.FormValidation in project nodejs-plugin by jenkinsci.

the class NPMRegistryValidatorTest method test_empty_server_url.

@Test
public void test_empty_server_url() throws Exception {
    DescriptorImpl descriptor = new DescriptorImpl();
    FormValidation result = descriptor.doCheckUrl("");
    assertThat(result.kind, is(Kind.ERROR));
    assertThat(result.getMessage(), is(Messages.NPMRegistry_DescriptorImpl_emptyRegistryURL()));
}
Also used : FormValidation(hudson.util.FormValidation) DescriptorImpl(jenkins.plugins.nodejs.configfiles.NPMRegistry.DescriptorImpl) Test(org.junit.Test)

Example 17 with FormValidation

use of hudson.util.FormValidation in project nodejs-plugin by jenkinsci.

the class NPMRegistryValidatorTest method test_empty_scopes.

@Test
public void test_empty_scopes() throws Exception {
    DescriptorImpl descriptor = new DescriptorImpl();
    FormValidation result = descriptor.doCheckScopes(true, "");
    assertThat(result.kind, is(Kind.ERROR));
    assertThat(result.getMessage(), is(Messages.NPMRegistry_DescriptorImpl_emptyScopes()));
}
Also used : FormValidation(hudson.util.FormValidation) DescriptorImpl(jenkins.plugins.nodejs.configfiles.NPMRegistry.DescriptorImpl) Test(org.junit.Test)

Example 18 with FormValidation

use of hudson.util.FormValidation in project contrast-continuous-application-security-plugin by jenkinsci.

the class ContrastPluginConfigTest method testDoCheckApiKeyInvalid.

@Test
public void testDoCheckApiKeyInvalid() {
    FormValidation result = descriptor.doCheckApiKey("");
    assertEquals(result.kind, FormValidation.Kind.ERROR);
}
Also used : FormValidation(hudson.util.FormValidation) Test(org.junit.Test)

Example 19 with FormValidation

use of hudson.util.FormValidation in project contrast-continuous-application-security-plugin by jenkinsci.

the class ContrastPluginConfigTest method testDoCheckApiKeyValid.

@Test
public void testDoCheckApiKeyValid() {
    FormValidation result = descriptor.doCheckApiKey("ABCDEFG");
    assertEquals(result.kind, FormValidation.Kind.OK);
}
Also used : FormValidation(hudson.util.FormValidation) Test(org.junit.Test)

Example 20 with FormValidation

use of hudson.util.FormValidation in project contrast-continuous-application-security-plugin by jenkinsci.

the class ContrastPluginConfigTest method testDoCheckUsernameInvalid.

@Test
public void testDoCheckUsernameInvalid() {
    FormValidation result = descriptor.doCheckUsername("");
    assertEquals(result.kind, FormValidation.Kind.ERROR);
}
Also used : FormValidation(hudson.util.FormValidation) Test(org.junit.Test)

Aggregations

FormValidation (hudson.util.FormValidation)24 Test (org.junit.Test)21 DescriptorImpl (jenkins.plugins.nodejs.configfiles.NPMRegistry.DescriptorImpl)11 FreeStyleProject (hudson.model.FreeStyleProject)4 Item (hudson.model.Item)3 Permission (hudson.security.Permission)3 DbAuditPublisher (org.jenkins.plugins.audit2db.DbAuditPublisher)3 DbAuditPublisherDescriptor (org.jenkins.plugins.audit2db.DbAuditPublisherDescriptor)3 DbAuditPublisherImpl (org.jenkins.plugins.audit2db.internal.DbAuditPublisherImpl)3 IOException (java.io.IOException)2 ServletException (javax.servlet.ServletException)2 Credentials (com.cloudbees.plugins.credentials.Credentials)1 Domain (com.cloudbees.plugins.credentials.domains.Domain)1 UsernamePasswordCredentialsImpl (com.cloudbees.plugins.credentials.impl.UsernamePasswordCredentialsImpl)1 Cause (hudson.model.Cause)1 FormException (hudson.model.Descriptor.FormException)1 FreeStyleBuild (hudson.model.FreeStyleBuild)1 BuildTrigger (hudson.tasks.BuildTrigger)1 HashMap (java.util.HashMap)1 HashSet (java.util.HashSet)1