Search in sources :

Example 1 with Lsof

use of com.evolveum.midpoint.test.util.Lsof in project midpoint by Evolveum.

the class AbstractLdapTest method initSystem.

@Override
public void initSystem(Task initTask, OperationResult initResult) throws Exception {
    super.initSystem(initTask, initResult);
    // System Configuration
    PrismObject<SystemConfigurationType> config;
    try {
        config = repoAddObjectFromFile(SYSTEM_CONFIGURATION_FILE, initResult);
    } catch (ObjectAlreadyExistsException e) {
        throw new ObjectAlreadyExistsException("System configuration already exists in repository;" + "looks like the previous test haven't cleaned it up", e);
    }
    modelService.postInit(initResult);
    // to get profiling facilities (until better API is available)
    //        LoggingConfigurationManager.configure(
    //                ProfilingConfigurationManager.checkSystemProfilingConfiguration(config),
    //                config.asObjectable().getVersion(), initResult);
    // administrator
    PrismObject<UserType> userAdministrator = repoAddObjectFromFile(USER_ADMINISTRATOR_FILE, initResult);
    repoAddObjectFromFile(ROLE_SUPERUSER_FILE, initResult);
    login(userAdministrator);
    // Resources
    if (isImportResourceAtInit()) {
        resource = importAndGetObjectFromFile(ResourceType.class, getResourceFile(), getResourceOid(), initTask, initResult);
        resourceType = resource.asObjectable();
    }
    assumeAssignmentPolicy(AssignmentPolicyEnforcementType.RELATIVE);
    //initProfiling - start
    ProfilingDataManager profilingManager = ProfilingDataManager.getInstance();
    Map<ProfilingDataManager.Subsystem, Boolean> subsystems = new HashMap<>();
    subsystems.put(ProfilingDataManager.Subsystem.MODEL, true);
    subsystems.put(ProfilingDataManager.Subsystem.REPOSITORY, true);
    profilingManager.configureProfilingDataManagerForTest(subsystems, true);
    profilingManager.appendProfilingToTest();
    //initProfiling - end
    ciMatchingRule = matchingRuleRegistry.getMatchingRule(StringIgnoreCaseMatchingRule.NAME, DOMUtil.XSD_STRING);
    dnMatchingRule = matchingRuleRegistry.getMatchingRule(DistinguishedNameMatchingRule.NAME, DOMUtil.XSD_STRING);
    logTrustManagers();
    if (isAssertOpenFiles()) {
        lsof = new Lsof(TestUtil.getPid());
    }
}
Also used : ProfilingDataManager(com.evolveum.midpoint.util.aspect.ProfilingDataManager) HashMap(java.util.HashMap) SystemConfigurationType(com.evolveum.midpoint.xml.ns._public.common.common_3.SystemConfigurationType) ResourceType(com.evolveum.midpoint.xml.ns._public.common.common_3.ResourceType) Lsof(com.evolveum.midpoint.test.util.Lsof) ObjectAlreadyExistsException(com.evolveum.midpoint.util.exception.ObjectAlreadyExistsException) UserType(com.evolveum.midpoint.xml.ns._public.common.common_3.UserType)

Aggregations

Lsof (com.evolveum.midpoint.test.util.Lsof)1 ProfilingDataManager (com.evolveum.midpoint.util.aspect.ProfilingDataManager)1 ObjectAlreadyExistsException (com.evolveum.midpoint.util.exception.ObjectAlreadyExistsException)1 ResourceType (com.evolveum.midpoint.xml.ns._public.common.common_3.ResourceType)1 SystemConfigurationType (com.evolveum.midpoint.xml.ns._public.common.common_3.SystemConfigurationType)1 UserType (com.evolveum.midpoint.xml.ns._public.common.common_3.UserType)1 HashMap (java.util.HashMap)1