From 33b27234a0bfa4e2760937b4d4502128d0bc5fcf Mon Sep 17 00:00:00 2001 From: kamidu Date: Wed, 3 Jan 2018 15:03:08 +0530 Subject: [PATCH] Enable the new configuration for testing --- .../carbon-home/repository/conf/cdm-config.xml | 1 + .../carbon-home/repository/conf/cdm-config.xml | 1 + .../resources/config/operation/cdm-config.xml | 1 + .../carbon-home/repository/conf/cdm-config.xml | 1 + .../mgt/core/mgt/impl/PolicyManagerImpl.java | 15 +++++---------- .../carbon-home/repository/conf/cdm-config.xml | 1 + .../src/main/resources/conf/cdm-config.xml | 1 + 7 files changed, 11 insertions(+), 10 deletions(-) diff --git a/components/certificate-mgt/org.wso2.carbon.certificate.mgt.core/src/test/resources/carbon-home/repository/conf/cdm-config.xml b/components/certificate-mgt/org.wso2.carbon.certificate.mgt.core/src/test/resources/carbon-home/repository/conf/cdm-config.xml index bc996646e1..9a71d330b0 100644 --- a/components/certificate-mgt/org.wso2.carbon.certificate.mgt.core/src/test/resources/carbon-home/repository/conf/cdm-config.xml +++ b/components/certificate-mgt/org.wso2.carbon.certificate.mgt.core/src/test/resources/carbon-home/repository/conf/cdm-config.xml @@ -39,6 +39,7 @@ org.wso2.carbon.policy.mgt true + true 60000 5 8 diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/test/resources/carbon-home/repository/conf/cdm-config.xml b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/test/resources/carbon-home/repository/conf/cdm-config.xml index ff6b302002..a6fac0d5a7 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/test/resources/carbon-home/repository/conf/cdm-config.xml +++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/test/resources/carbon-home/repository/conf/cdm-config.xml @@ -49,6 +49,7 @@ org.wso2.carbon.policy.mgt true + true 60000 5 8 diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/test/resources/config/operation/cdm-config.xml b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/test/resources/config/operation/cdm-config.xml index d4e1acb139..4e72c2a078 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/test/resources/config/operation/cdm-config.xml +++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/test/resources/config/operation/cdm-config.xml @@ -49,6 +49,7 @@ org.wso2.carbon.policy.mgt true + true 60000 5 8 diff --git a/components/identity-extensions/org.wso2.carbon.identity.jwt.client.extension/src/test/resources/carbon-home/repository/conf/cdm-config.xml b/components/identity-extensions/org.wso2.carbon.identity.jwt.client.extension/src/test/resources/carbon-home/repository/conf/cdm-config.xml index bc48130dd5..a6e56949b8 100644 --- a/components/identity-extensions/org.wso2.carbon.identity.jwt.client.extension/src/test/resources/carbon-home/repository/conf/cdm-config.xml +++ b/components/identity-extensions/org.wso2.carbon.identity.jwt.client.extension/src/test/resources/carbon-home/repository/conf/cdm-config.xml @@ -54,6 +54,7 @@ org.wso2.carbon.policy.mgt true + true 60000 5 8 diff --git a/components/policy-mgt/org.wso2.carbon.policy.mgt.core/src/main/java/org/wso2/carbon/policy/mgt/core/mgt/impl/PolicyManagerImpl.java b/components/policy-mgt/org.wso2.carbon.policy.mgt.core/src/main/java/org/wso2/carbon/policy/mgt/core/mgt/impl/PolicyManagerImpl.java index e00e1adcc9..7f4f48415f 100644 --- a/components/policy-mgt/org.wso2.carbon.policy.mgt.core/src/main/java/org/wso2/carbon/policy/mgt/core/mgt/impl/PolicyManagerImpl.java +++ b/components/policy-mgt/org.wso2.carbon.policy.mgt.core/src/main/java/org/wso2/carbon/policy/mgt/core/mgt/impl/PolicyManagerImpl.java @@ -44,9 +44,6 @@ import org.wso2.carbon.device.mgt.core.service.GroupManagementProviderServiceImp import org.wso2.carbon.policy.mgt.common.*; import org.wso2.carbon.policy.mgt.core.cache.impl.PolicyCacheManagerImpl; import org.wso2.carbon.policy.mgt.core.dao.*; -import org.wso2.carbon.policy.mgt.core.enforcement.PolicyDelegationException; -import org.wso2.carbon.policy.mgt.core.enforcement.PolicyEnforcementDelegator; -import org.wso2.carbon.policy.mgt.core.enforcement.PolicyEnforcementDelegatorImpl; import org.wso2.carbon.policy.mgt.core.internal.PolicyManagementDataHolder; import org.wso2.carbon.policy.mgt.core.mgt.PolicyManager; import org.wso2.carbon.policy.mgt.core.mgt.ProfileManager; @@ -60,7 +57,6 @@ import java.util.*; public class PolicyManagerImpl implements PolicyManager { private PolicyDAO policyDAO; - private PolicyManager policyManager; private ProfileDAO profileDAO; private FeatureDAO featureDAO; private ProfileManager profileManager; @@ -73,7 +69,6 @@ public class PolicyManagerImpl implements PolicyManager { this.featureDAO = PolicyManagementDAOFactory.getFeatureDAO(); this.policyConfiguration = DeviceConfigurationManager.getInstance().getDeviceManagementConfig().getPolicyConfiguration(); this.profileManager = new ProfileManagerImpl(); - this.policyManager = new PolicyManagerImpl(); } @Override @@ -282,7 +277,7 @@ public class PolicyManagerImpl implements PolicyManager { if (policyConfiguration.getCacheEnable()) { existingPolicies = PolicyCacheManagerImpl.getInstance().getAllPolicies(); } else { - existingPolicies = policyManager.getPolicies(); + existingPolicies = this.getPolicies(); } PolicyManagementDAOFactory.beginTransaction(); bool = policyDAO.updatePolicyPriorities(policies); @@ -698,7 +693,7 @@ public class PolicyManagerImpl implements PolicyManager { if (policyConfiguration.getCacheEnable()) { tempPolicyList = PolicyCacheManagerImpl.getInstance().getAllPolicies(); } else { - tempPolicyList = policyManager.getPolicies(); + tempPolicyList = this.getPolicies(); } for (Policy policy : tempPolicyList) { @@ -723,7 +718,7 @@ public class PolicyManagerImpl implements PolicyManager { if (policyConfiguration.getCacheEnable()) { allPolicies = PolicyCacheManagerImpl.getInstance().getAllPolicies(); } else { - allPolicies = policyManager.getPolicies(); + allPolicies = this.getPolicies(); } for (Policy policy : allPolicies) { @@ -770,7 +765,7 @@ public class PolicyManagerImpl implements PolicyManager { if (policyConfiguration.getCacheEnable()) { tempPolicyList = PolicyCacheManagerImpl.getInstance().getAllPolicies(); } else { - tempPolicyList = policyManager.getPolicies(); + tempPolicyList = this.getPolicies(); } for (Policy policy : tempPolicyList) { @@ -805,7 +800,7 @@ public class PolicyManagerImpl implements PolicyManager { if (policyConfiguration.getCacheEnable()) { tempPolicyList = PolicyCacheManagerImpl.getInstance().getAllPolicies(); } else { - tempPolicyList = policyManager.getPolicies(); + tempPolicyList = this.getPolicies(); } for (Policy policy : tempPolicyList) { diff --git a/components/policy-mgt/org.wso2.carbon.policy.mgt.core/src/test/resources/carbon-home/repository/conf/cdm-config.xml b/components/policy-mgt/org.wso2.carbon.policy.mgt.core/src/test/resources/carbon-home/repository/conf/cdm-config.xml index df960ed64e..9213b37827 100644 --- a/components/policy-mgt/org.wso2.carbon.policy.mgt.core/src/test/resources/carbon-home/repository/conf/cdm-config.xml +++ b/components/policy-mgt/org.wso2.carbon.policy.mgt.core/src/test/resources/carbon-home/repository/conf/cdm-config.xml @@ -39,6 +39,7 @@ org.wso2.carbon.policy.mgt true + true 60000 5 8 diff --git a/features/device-mgt/org.wso2.carbon.device.mgt.basics.feature/src/main/resources/conf/cdm-config.xml b/features/device-mgt/org.wso2.carbon.device.mgt.basics.feature/src/main/resources/conf/cdm-config.xml index 81dd481219..59ce0c0c9a 100644 --- a/features/device-mgt/org.wso2.carbon.device.mgt.basics.feature/src/main/resources/conf/cdm-config.xml +++ b/features/device-mgt/org.wso2.carbon.device.mgt.basics.feature/src/main/resources/conf/cdm-config.xml @@ -54,6 +54,7 @@ org.wso2.carbon.policy.mgt true + true 60000 5 8