Search in sources :

Example 1 with DbAuditPublisherImpl

use of org.jenkins.plugins.audit2db.internal.DbAuditPublisherImpl in project selenium_java by sergueik.

the class WhenTestingDataSource method testInvalidJdbcDriverShouldFail.

@Test
public void testInvalidJdbcDriverShouldFail() throws Exception {
    final DbAuditPublisher publisher = new DbAuditPublisherImpl();
    final DbAuditPublisherDescriptor descriptor = (DbAuditPublisherDescriptor) publisher.getDescriptor();
    final FormValidation testResult = descriptor.doTestJdbcConnection("WrongDriver", jdbcUrl, jdbcUser, jdbcPassword);
    Assert.assertEquals("Unexpected successful connection.", FormValidation.Kind.ERROR, testResult.kind);
}
Also used : FormValidation(hudson.util.FormValidation) DbAuditPublisherImpl(org.jenkins.plugins.audit2db.internal.DbAuditPublisherImpl) DbAuditPublisher(org.jenkins.plugins.audit2db.DbAuditPublisher) DbAuditPublisherDescriptor(org.jenkins.plugins.audit2db.DbAuditPublisherDescriptor) Test(org.junit.Test)

Example 2 with DbAuditPublisherImpl

use of org.jenkins.plugins.audit2db.internal.DbAuditPublisherImpl in project selenium_java by sergueik.

the class WhenSchedulingJob method getPlugin.

private DbAuditPublisher getPlugin() {
    final DbAuditPublisher publisher = new DbAuditPublisherImpl();
    final DbAuditPublisherDescriptor descriptor = (DbAuditPublisherDescriptor) publisher.getDescriptor();
    descriptor.setJdbcDriver(jdbcDriver);
    descriptor.setJdbcUrl(jdbcUrl);
    descriptor.setJdbcUser(jdbcUser);
    descriptor.setJdbcPassword(jdbcPassword);
    return publisher;
}
Also used : DbAuditPublisherImpl(org.jenkins.plugins.audit2db.internal.DbAuditPublisherImpl) DbAuditPublisher(org.jenkins.plugins.audit2db.DbAuditPublisher) DbAuditPublisherDescriptor(org.jenkins.plugins.audit2db.DbAuditPublisherDescriptor)

Example 3 with DbAuditPublisherImpl

use of org.jenkins.plugins.audit2db.internal.DbAuditPublisherImpl in project selenium_java by sergueik.

the class WhenTestingDataSource method testGeneratingDdlWithValidJdbcDetailsShouldSucceed.

@Test
public void testGeneratingDdlWithValidJdbcDetailsShouldSucceed() throws Exception {
    final DbAuditPublisher publisher = new DbAuditPublisherImpl();
    final DbAuditPublisherDescriptor descriptor = (DbAuditPublisherDescriptor) publisher.getDescriptor();
    final FormValidation testResult = descriptor.doGenerateDdl(jdbcDriver, jdbcUrl, jdbcUser, jdbcPassword);
    Assert.assertEquals("Unexpected connection error.", FormValidation.Kind.OK, testResult.kind);
}
Also used : FormValidation(hudson.util.FormValidation) DbAuditPublisherImpl(org.jenkins.plugins.audit2db.internal.DbAuditPublisherImpl) DbAuditPublisher(org.jenkins.plugins.audit2db.DbAuditPublisher) DbAuditPublisherDescriptor(org.jenkins.plugins.audit2db.DbAuditPublisherDescriptor) Test(org.junit.Test)

Example 4 with DbAuditPublisherImpl

use of org.jenkins.plugins.audit2db.internal.DbAuditPublisherImpl in project selenium_java by sergueik.

the class WhenTestingDataSource method testValidJdbcDatasourceShouldSucceed.

@Test
public void testValidJdbcDatasourceShouldSucceed() throws Exception {
    final DbAuditPublisher publisher = new DbAuditPublisherImpl();
    final DbAuditPublisherDescriptor descriptor = (DbAuditPublisherDescriptor) publisher.getDescriptor();
    final FormValidation testResult = descriptor.doTestJdbcConnection(jdbcDriver, jdbcUrl, jdbcUser, jdbcPassword);
    Assert.assertEquals("Unexpected connection error.", FormValidation.Kind.OK, testResult.kind);
}
Also used : FormValidation(hudson.util.FormValidation) DbAuditPublisherImpl(org.jenkins.plugins.audit2db.internal.DbAuditPublisherImpl) DbAuditPublisher(org.jenkins.plugins.audit2db.DbAuditPublisher) DbAuditPublisherDescriptor(org.jenkins.plugins.audit2db.DbAuditPublisherDescriptor) Test(org.junit.Test)

Aggregations

DbAuditPublisher (org.jenkins.plugins.audit2db.DbAuditPublisher)4 DbAuditPublisherDescriptor (org.jenkins.plugins.audit2db.DbAuditPublisherDescriptor)4 DbAuditPublisherImpl (org.jenkins.plugins.audit2db.internal.DbAuditPublisherImpl)4 FormValidation (hudson.util.FormValidation)3 Test (org.junit.Test)3