Search in sources :

Example 1 with FormValidation

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

the class ContrastPluginConfigTest method testDoCheckUsernameValid.

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

Example 2 with FormValidation

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

the class ThresholdConditionTest method testDoCheckThresholdCountValid.

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

Example 3 with FormValidation

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

the class NPMRegistryValidatorTest method test_scopes_ok.

@Test
public void test_scopes_ok() throws Exception {
    DescriptorImpl descriptor = new DescriptorImpl();
    FormValidation result = descriptor.doCheckScopes(true, "scope1 scope2 scope3");
    assertThat(result.kind, is(Kind.OK));
}
Also used : FormValidation(hudson.util.FormValidation) DescriptorImpl(jenkins.plugins.nodejs.configfiles.NPMRegistry.DescriptorImpl) Test(org.junit.Test)

Example 4 with FormValidation

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

the class NPMRegistryValidatorTest method test_server_url_invalid_protocol.

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

Example 5 with FormValidation

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

the class NPMRegistryValidatorTest method test_invalid_scopes.

@Test
public void test_invalid_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_invalidScopes()));
}
Also used : FormValidation(hudson.util.FormValidation) DescriptorImpl(jenkins.plugins.nodejs.configfiles.NPMRegistry.DescriptorImpl) 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