From 10a585ea6a04c155fd9a9cca2785b6f470990d7b Mon Sep 17 00:00:00 2001 From: geethkokila Date: Mon, 18 May 2015 07:38:35 +0530 Subject: [PATCH] Moing interfacs to common bundle and fixing test cases --- .../policy/mgt/common}/PolicyFilter.java | 2 +- .../mgt/core/impl/PolicyFilterImpl.java | 1 + .../core/impl/PolicyInformationPointImpl.java | 6 +- .../mgt/core/util/ProfileFeatureCreator.java | 119 +++++++++--------- 4 files changed, 61 insertions(+), 67 deletions(-) rename components/policy-mgt/{org.wso2.carbon.policy.mgt.core/src/main/java/org/wso2/carbon/policy/mgt/core/impl => org.wso2.carbon.policy.mgt.common/src/main/java/org/wso2/carbon/policy/mgt/common}/PolicyFilter.java (95%) diff --git a/components/policy-mgt/org.wso2.carbon.policy.mgt.core/src/main/java/org/wso2/carbon/policy/mgt/core/impl/PolicyFilter.java b/components/policy-mgt/org.wso2.carbon.policy.mgt.common/src/main/java/org/wso2/carbon/policy/mgt/common/PolicyFilter.java similarity index 95% rename from components/policy-mgt/org.wso2.carbon.policy.mgt.core/src/main/java/org/wso2/carbon/policy/mgt/core/impl/PolicyFilter.java rename to components/policy-mgt/org.wso2.carbon.policy.mgt.common/src/main/java/org/wso2/carbon/policy/mgt/common/PolicyFilter.java index 473476403ec..3e8cf717566 100644 --- a/components/policy-mgt/org.wso2.carbon.policy.mgt.core/src/main/java/org/wso2/carbon/policy/mgt/core/impl/PolicyFilter.java +++ b/components/policy-mgt/org.wso2.carbon.policy.mgt.common/src/main/java/org/wso2/carbon/policy/mgt/common/PolicyFilter.java @@ -17,7 +17,7 @@ */ -package org.wso2.carbon.policy.mgt.core.impl; +package org.wso2.carbon.policy.mgt.common; import org.wso2.carbon.policy.mgt.common.Policy; diff --git a/components/policy-mgt/org.wso2.carbon.policy.mgt.core/src/main/java/org/wso2/carbon/policy/mgt/core/impl/PolicyFilterImpl.java b/components/policy-mgt/org.wso2.carbon.policy.mgt.core/src/main/java/org/wso2/carbon/policy/mgt/core/impl/PolicyFilterImpl.java index cef8cba7862..5c0abca774b 100644 --- a/components/policy-mgt/org.wso2.carbon.policy.mgt.core/src/main/java/org/wso2/carbon/policy/mgt/core/impl/PolicyFilterImpl.java +++ b/components/policy-mgt/org.wso2.carbon.policy.mgt.core/src/main/java/org/wso2/carbon/policy/mgt/core/impl/PolicyFilterImpl.java @@ -22,6 +22,7 @@ package org.wso2.carbon.policy.mgt.core.impl; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.wso2.carbon.policy.mgt.common.Policy; +import org.wso2.carbon.policy.mgt.common.PolicyFilter; import org.wso2.carbon.policy.mgt.core.util.PolicyManagementConstants; import java.util.ArrayList; diff --git a/components/policy-mgt/org.wso2.carbon.policy.mgt.core/src/main/java/org/wso2/carbon/policy/mgt/core/impl/PolicyInformationPointImpl.java b/components/policy-mgt/org.wso2.carbon.policy.mgt.core/src/main/java/org/wso2/carbon/policy/mgt/core/impl/PolicyInformationPointImpl.java index 50e12eb8b7e..2addda1a812 100644 --- a/components/policy-mgt/org.wso2.carbon.policy.mgt.core/src/main/java/org/wso2/carbon/policy/mgt/core/impl/PolicyInformationPointImpl.java +++ b/components/policy-mgt/org.wso2.carbon.policy.mgt.core/src/main/java/org/wso2/carbon/policy/mgt/core/impl/PolicyInformationPointImpl.java @@ -27,11 +27,7 @@ import org.wso2.carbon.device.mgt.common.DeviceManagementException; import org.wso2.carbon.device.mgt.core.dto.DeviceType; import org.wso2.carbon.device.mgt.core.service.DeviceManagementService; import org.wso2.carbon.device.mgt.common.Feature; -import org.wso2.carbon.policy.mgt.common.FeatureManagementException; -import org.wso2.carbon.policy.mgt.common.PIPDevice; -import org.wso2.carbon.policy.mgt.common.Policy; -import org.wso2.carbon.policy.mgt.common.PolicyInformationPoint; -import org.wso2.carbon.policy.mgt.common.PolicyManagementException; +import org.wso2.carbon.policy.mgt.common.*; import org.wso2.carbon.policy.mgt.core.internal.PolicyManagementDataHolder; import org.wso2.carbon.policy.mgt.core.mgt.FeatureManager; import org.wso2.carbon.policy.mgt.core.mgt.PolicyManager; diff --git a/components/policy-mgt/org.wso2.carbon.policy.mgt.core/src/test/java/org/wso2/carbon/policy/mgt/core/util/ProfileFeatureCreator.java b/components/policy-mgt/org.wso2.carbon.policy.mgt.core/src/test/java/org/wso2/carbon/policy/mgt/core/util/ProfileFeatureCreator.java index 9174f48f1c8..c3f99a32588 100644 --- a/components/policy-mgt/org.wso2.carbon.policy.mgt.core/src/test/java/org/wso2/carbon/policy/mgt/core/util/ProfileFeatureCreator.java +++ b/components/policy-mgt/org.wso2.carbon.policy.mgt.core/src/test/java/org/wso2/carbon/policy/mgt/core/util/ProfileFeatureCreator.java @@ -55,71 +55,68 @@ public class ProfileFeatureCreator { private static String getJSON() { - return "[\n" + - "\t{\n" + - "\t\tcolor: \"red\",\n" + - "\t\tvalue: \"#f00\"\n" + - "\t},\n" + - "\t{\n" + - "\t\tcolor: \"green\",\n" + - "\t\tvalue: \"#0f0\"\n" + - "\t},\n" + - "\t{\n" + - "\t\tcolor: \"blue\",\n" + - "\t\tvalue: \"#00f\"\n" + - "\t},\n" + - "\t{\n" + - "\t\tcolor: \"cyan\",\n" + - "\t\tvalue: \"#0ff\"\n" + - "\t},\n" + - "\t{\n" + - "\t\tcolor: \"magenta\",\n" + - "\t\tvalue: \"#f0f\"\n" + - "\t},\n" + - "\t{\n" + - "\t\tcolor: \"yellow\",\n" + - "\t\tvalue: \"#ff0\"\n" + - "\t},\n" + - "\t{\n" + - "\t\tcolor: \"black\",\n" + - "\t\tvalue: \"#000\"\n" + - "\t}\n" + - "]"; + return "{\n" + + " \"userNameList\": [\n" + + " \"admin\"\n" + + " ],\n" + + " \"roleNameList\": [\n" + + " \"admin\"\n" + + " ],\n" + + " \"deviceIdentifiers\": [\n" + + " {\n" + + " \"id\": \"08:00:27:fe:27:7b\",\n" + + " \"type\": \"ios\"\n" + + " }\n" + + " ],\n" + + " \"application\": {\n" + + " \"id\": \"id\",\n" + + " \"name\": \"test\",\n" + + " \"type\": \"ENTERPRISE\",\n" + + " \"platform\": \"android\",\n" + + " \"version\": \"1.0\",\n" + + " \"identifier\": \"sdfsdfldfs\",\n" + + " \"iconImage\": \"http://gogle.com\",\n" + + " \"packageName\": \"com.google.mail\",\n" + + " \"appIdentifier\": \"asdf\",\n" + + " \"location\": \"location\",\n" + + " \"properties\": {\n" + + " \"isRemoveApp\": true,\n" + + " \"isPreventBackup\": true\n" + + " }\n" + + " }\n" + + "}"; } private static String getJSON2() { return "{\n" + - " \"odata.metadata\":\"http://services.odata.org/V3/OData/OData.svc/$metadata#Products\",\n" + - " \"value\":[\n" + - " {\n" + - " \"ID\":0,\n" + - " \"Name\":\"Bread\",\n" + - " \"Description\":\"Whole grain bread\",\n" + - " \"ReleaseDate\":\"1992-01-01T00:00:00\",\n" + - " \"DiscontinuedDate\":null,\n" + - " \"Rating\":4,\n" + - " \"Price\":\"2.5\"\n" + - " },\n" + - " {\n" + - " \"ID\":1,\n" + - " \"Name\":\"Milk\",\n" + - " \"Description\":\"Low fat milk\",\n" + - " \"ReleaseDate\":\"1995-10-01T00:00:00\",\n" + - " \"DiscontinuedDate\":null,\n" + - " \"Rating\":3,\n" + - " \"Price\":\"3.5\"\n" + - " },\n" + - " {\n" + - " \"ID\":2,\n" + - " \"Name\":\"Vint soda\",\n" + - " \"Description\":\"Americana Variety - Mix of 6 flavors\",\n" + - " \"ReleaseDate\":\"2000-10-01T00:00:00\",\n" + - " \"DiscontinuedDate\":null,\n" + - " \"Rating\":3,\n" + - " \"Price\":\"20.9\"\n" + - " },\n" + - " …\n" + - " ]\n" + + " \"userNameList\": [\n" + + " \"admin\"\n" + + " ],\n" + + " \"roleNameList\": [\n" + + " \"admin\"\n" + + " ],\n" + + " \"deviceIdentifiers\": [\n" + + " {\n" + + " \"id\": \"11:11:11:12\",\n" + + " \"type\": \"ios\"\n" + + " }\n" + + " ],\n" + + " \"application\": {\n" + + " \"id\": \"1d548206-14ee-4672-91f6-9c230626a056\",\n" + + " \"platform\": \"ios\",\n" + + " \"packageName\": \"com.imangi.templerun2\",\n" + + " \"name\": \"Temle Run\",\n" + + " \"appIdentifier\": \"572395608\",\n" + + " \"iconImage\": \"http://10.100.5.6:9763/publisher/api/mobileapp/getfile/FHmJReGEV3cExtf.png\",\n" + + " \"type\": \"PUBLIC\",\n" + + " \"identifier\": \"572395608\",\n" + + " \"version\": \"1\",\n" + + " \"properties\": {\n" + + " \"isRemoveApp\": true,\n" + + " \"isPreventBackup\": true,\n" + + " \"iTunesId\": 572395608\n" + + " }\n" + + " }\n" + "}"; } }