use of com.axway.ats.log.appenders.ActiveDbAppender in project ats-framework by Axway.
the class Test_RemoteLoggingConfigurator method testApplyPositive.
@Test
public void testApplyPositive() {
ActiveDbAppender appender = new ActiveDbAppender();
appender.setHost("test");
appender.setDatabase("test");
appender.setUser("test");
appender.setPassword("test");
Logger log = Logger.getLogger(loggerName);
log.addAppender(appender);
//construct the configurator - an appender is present
RemoteLoggingConfigurator remoteLoggingConfig = new RemoteLoggingConfigurator("127.0.0.1");
//remove the appender, so the configurator will need to apply it
log.removeAppender(appender);
// check if needs to be applied - this sets the internal flags
// so the next "apply" method will work as expected
assertTrue(remoteLoggingConfig.needsApplying());
//apply the appender
remoteLoggingConfig.apply();
assertTrue(log.getAllAppenders().hasMoreElements());
}
use of com.axway.ats.log.appenders.ActiveDbAppender in project ats-framework by Axway.
the class Test_RemoteLoggingConfigurator method testRevertPositive.
@Test
public void testRevertPositive() {
ActiveDbAppender appender = new ActiveDbAppender();
appender.setHost("test");
appender.setDatabase("test");
appender.setUser("test");
appender.setPassword("test");
Logger log = Logger.getLogger(loggerName);
log.addAppender(appender);
//construct the configurator - an appender is present
RemoteLoggingConfigurator remoteLoggingConfig = new RemoteLoggingConfigurator("127.0.0.1");
//remove the appender, so the configurator will need to apply it
log.removeAppender(appender);
//apply the appender
remoteLoggingConfig.apply();
remoteLoggingConfig.revert();
assertFalse(log.getAllAppenders().hasMoreElements());
}
use of com.axway.ats.log.appenders.ActiveDbAppender in project ats-framework by Axway.
the class Test_RemoteLoggingConfigurator method testNeedsApplyWithAppenderExpectTrue.
@Test
public void testNeedsApplyWithAppenderExpectTrue() {
ActiveDbAppender appender = new ActiveDbAppender();
appender.setHost("test");
appender.setDatabase("test");
appender.setUser("test");
appender.setPassword("test");
Logger log = Logger.getRootLogger();
log.addAppender(appender);
//construct the configurator - an appender is present
RemoteLoggingConfigurator remoteLoggingConfig = new RemoteLoggingConfigurator("127.0.0.1");
//remove the appender, so the configurator will need to apply it
log.removeAppender(appender);
assertTrue(remoteLoggingConfig.needsApplying());
}
use of com.axway.ats.log.appenders.ActiveDbAppender in project ats-framework by Axway.
the class Test_RemoteLoggingConfigurator method testRevertPositiveRootLogger.
@Test
public void testRevertPositiveRootLogger() {
ActiveDbAppender appender = new ActiveDbAppender();
appender.setHost("test");
appender.setDatabase("test");
appender.setUser("test");
appender.setPassword("test");
Logger log = Logger.getRootLogger();
log.addAppender(appender);
//construct the configurator - an appender is present
RemoteLoggingConfigurator remoteLoggingConfig = new RemoteLoggingConfigurator("127.0.0.1");
//remove the appender, so the configurator will need to apply it
log.removeAppender(appender);
//apply the appender
remoteLoggingConfig.apply();
remoteLoggingConfig.revert();
assertFalse(log.getAllAppenders().hasMoreElements());
}
use of com.axway.ats.log.appenders.ActiveDbAppender in project ats-framework by Axway.
the class Test_RemoteLoggingConfigurator method testApplyPositiveRootLogger.
@Test
public void testApplyPositiveRootLogger() {
ActiveDbAppender appender = new ActiveDbAppender();
appender.setHost("test");
appender.setDatabase("test");
appender.setUser("test");
appender.setPassword("test");
Logger log = Logger.getRootLogger();
log.addAppender(appender);
//construct the configurator - an appender is present
RemoteLoggingConfigurator remoteLoggingConfig = new RemoteLoggingConfigurator("127.0.0.1");
//remove the appender, so the configurator will need to apply it
log.removeAppender(appender);
// check if needs to be applied - this sets the internal flags
// so the next "apply" method will work as expected
assertTrue(remoteLoggingConfig.needsApplying());
//apply the appender
remoteLoggingConfig.apply();
assertTrue(log.getAllAppenders().hasMoreElements());
}
Aggregations