Search in sources :

Example 1 with DbAppenderConfiguration

use of com.axway.ats.log.autodb.DbAppenderConfiguration in project ats-framework by Axway.

the class Test_DbAppenderConfiguration method gettersAndSettersPositive.

@Test
public void gettersAndSettersPositive() {
    DbAppenderConfiguration appenderConfig = new DbAppenderConfiguration();
    appenderConfig.setHost("host1");
    assertEquals("host1", appenderConfig.getHost());
    appenderConfig.setDatabase("db1");
    assertEquals("db1", appenderConfig.getDatabase());
    appenderConfig.setUser("user1");
    assertEquals("user1", appenderConfig.getUser());
    appenderConfig.setPassword("pass1");
    assertEquals("pass1", appenderConfig.getPassword());
    appenderConfig.setEnableCheckpoints(true);
    assertEquals(true, appenderConfig.getEnableCheckpoints());
}
Also used : DbAppenderConfiguration(com.axway.ats.log.autodb.DbAppenderConfiguration) Test(org.junit.Test)

Example 2 with DbAppenderConfiguration

use of com.axway.ats.log.autodb.DbAppenderConfiguration in project ats-framework by Axway.

the class Test_DbAppenderConfiguration method validatePositive.

@Test
public void validatePositive() throws InvalidAppenderConfigurationException {
    DbAppenderConfiguration appenderConfig = new DbAppenderConfiguration();
    appenderConfig.setHost("host1");
    appenderConfig.setDatabase("db1");
    appenderConfig.setUser("user1");
    appenderConfig.setPassword("pass1");
    appenderConfig.setEnableCheckpoints(true);
    appenderConfig.validate();
}
Also used : DbAppenderConfiguration(com.axway.ats.log.autodb.DbAppenderConfiguration) Test(org.junit.Test)

Example 3 with DbAppenderConfiguration

use of com.axway.ats.log.autodb.DbAppenderConfiguration in project ats-framework by Axway.

the class Test_DbAppenderConfiguration method validateNegativeNoDatabase.

@Test(expected = InvalidAppenderConfigurationException.class)
public void validateNegativeNoDatabase() throws InvalidAppenderConfigurationException {
    DbAppenderConfiguration appenderConfig = new DbAppenderConfiguration();
    appenderConfig.setHost("host1");
    appenderConfig.validate();
}
Also used : DbAppenderConfiguration(com.axway.ats.log.autodb.DbAppenderConfiguration) Test(org.junit.Test)

Example 4 with DbAppenderConfiguration

use of com.axway.ats.log.autodb.DbAppenderConfiguration in project ats-framework by Axway.

the class Test_DbAppenderConfiguration method validateNegativeNoUser.

@Test(expected = InvalidAppenderConfigurationException.class)
public void validateNegativeNoUser() throws InvalidAppenderConfigurationException {
    DbAppenderConfiguration appenderConfig = new DbAppenderConfiguration();
    appenderConfig.setHost("host1");
    appenderConfig.setDatabase("db1");
    appenderConfig.validate();
}
Also used : DbAppenderConfiguration(com.axway.ats.log.autodb.DbAppenderConfiguration) Test(org.junit.Test)

Example 5 with DbAppenderConfiguration

use of com.axway.ats.log.autodb.DbAppenderConfiguration in project ats-framework by Axway.

the class Test_DbAppenderConfiguration method validateNegativeNoPassword.

@Test(expected = InvalidAppenderConfigurationException.class)
public void validateNegativeNoPassword() throws InvalidAppenderConfigurationException {
    DbAppenderConfiguration appenderConfig = new DbAppenderConfiguration();
    appenderConfig.setHost("host1");
    appenderConfig.setDatabase("db1");
    appenderConfig.setUser("user1");
    appenderConfig.validate();
}
Also used : DbAppenderConfiguration(com.axway.ats.log.autodb.DbAppenderConfiguration) Test(org.junit.Test)

Aggregations

DbAppenderConfiguration (com.axway.ats.log.autodb.DbAppenderConfiguration)9 Test (org.junit.Test)6 ErrorPojo (com.axway.ats.agent.webapp.restservice.model.pojo.ErrorPojo)1 AtsConsoleLogger (com.axway.ats.core.log.AtsConsoleLogger)1 PassiveDbAppender (com.axway.ats.log.appenders.PassiveDbAppender)1 HashMap (java.util.HashMap)1 Map (java.util.Map)1 Consumes (javax.ws.rs.Consumes)1 POST (javax.ws.rs.POST)1 Path (javax.ws.rs.Path)1 Produces (javax.ws.rs.Produces)1 Appender (org.apache.logging.log4j.core.Appender)1 LoggerContext (org.apache.logging.log4j.core.LoggerContext)1 Configuration (org.apache.logging.log4j.core.config.Configuration)1