use of org.jenkinsci.test.acceptance.po.FormValidation in project acceptance-test-harness by jenkinsci.
the class FormValidationTest method validate.
@Test
public void validate() throws Exception {
JenkinsConfig c = jenkins.getConfigPage();
c.configure();
c.numExecutors.set(16);
FormValidation formValidation = c.numExecutors.getFormValidation();
assertThat(formValidation, silent());
c.numExecutors.set(-16);
formValidation = c.numExecutors.getFormValidation();
// support older jenkins versions
String errorMessage = jenkins.getVersion().isNewerThan(new VersionNumber("2.104")) ? "Not a non-negative number" : "Not an integer";
assertThat(formValidation, reports(Kind.ERROR, errorMessage));
}
use of org.jenkinsci.test.acceptance.po.FormValidation in project acceptance-test-harness by jenkinsci.
the class FormValidationTest method jsValidation.
private void jsValidation() {
JenkinsConfig c = jenkins.getConfigPage();
c.configure();
c.numExecutors.set(16);
FormValidation formValidation = c.numExecutors.getFormValidation();
assertThat(formValidation, silent());
c.numExecutors.set(-16);
formValidation = c.numExecutors.getFormValidation();
// support older jenkins versions
String errorMessage = jenkins.getVersion().isNewerThan(new VersionNumber("2.295")) ? "Not a non-negative integer" : "Not a non-negative number";
assertThat(formValidation, reports(Kind.ERROR, errorMessage));
}
use of org.jenkinsci.test.acceptance.po.FormValidation in project acceptance-test-harness by jenkinsci.
the class ForemanNodeSharingPluginTest method testConnection.
/**
* Test the connection and check version.
* @throws IOException if occurs.
*/
@Test
public void testConnection() throws IOException {
FormValidation validation = cloud.testConnection();
assertThat(validation, FormValidation.reports(OK, startsWith("Foreman version is")));
}
use of org.jenkinsci.test.acceptance.po.FormValidation in project acceptance-test-harness by jenkinsci.
the class OpenstackCloudPluginTest method testConnection.
@Test
public void testConnection() {
JenkinsConfig config = jenkins.getConfigPage();
config.configure();
OpenstackCloud cloud = addCloud(config);
FormValidation val = cloud.testConnection();
assertThat(val, FormValidation.reports(OK, "Connection succeeded!"));
}
Aggregations