use of com.evolveum.midpoint.xml.ns._public.common.common_3.SubSystemLoggerConfigurationType in project midpoint by Evolveum.
the class TestLoggingConfiguration method test002InitialConfiguration.
@Test
public void test002InitialConfiguration() throws Exception {
final String TEST_NAME = "test002InitialConfiguration";
TestUtil.displayTestTile(TEST_NAME);
// GIVEN
LogfileTestTailer tailer = new LogfileTestTailer(LoggingConfigurationManager.AUDIT_LOGGER_NAME);
Task task = taskManager.createTaskInstance(TestLoggingConfiguration.class.getName() + "." + TEST_NAME);
OperationResult result = task.getResult();
PrismObject<SystemConfigurationType> systemConfiguration = PrismTestUtil.parseObject(SYSTEM_CONFIGURATION_FILE);
LoggingConfigurationType logging = systemConfiguration.asObjectable().getLogging();
applyTestLoggingConfig(logging);
SubSystemLoggerConfigurationType modelSubSystemLogger = new SubSystemLoggerConfigurationType();
modelSubSystemLogger.setComponent(LoggingComponentType.PROVISIONING);
modelSubSystemLogger.setLevel(LoggingLevelType.TRACE);
logging.getSubSystemLogger().add(modelSubSystemLogger);
PrismObjectDefinition<SystemConfigurationType> systemConfigurationTypeDefinition = prismContext.getSchemaRegistry().findObjectDefinitionByCompileTimeClass(SystemConfigurationType.class);
Collection<? extends ItemDelta> modifications = PropertyDelta.createModificationReplacePropertyCollection(SystemConfigurationType.F_LOGGING, systemConfigurationTypeDefinition, logging);
// Modify directly in repository, so the logging code in model will not notice the change
repositoryService.modifyObject(SystemConfigurationType.class, AbstractInitializedModelIntegrationTest.SYSTEM_CONFIGURATION_OID, modifications, result);
// precondition
tailer.logAndTail();
assertBasicLogging(tailer);
tailer.assertMarkerNotLogged(LogfileTestTailer.LEVEL_TRACE, ProfilingDataManager.Subsystem.PROVISIONING.name());
// WHEN
repositoryService.postInit(result);
modelService.postInit(result);
// THEN
tailer.logAndTail();
assertBasicLogging(tailer);
tailer.assertMarkerLogged(LogfileTestTailer.LEVEL_TRACE, ProfilingDataManager.Subsystem.PROVISIONING.name());
tailer.close();
}
Aggregations