Policy TestSuite Enabled
[policy/engine.git] / PolicyEngineAPI / src / test / java / org / openecomp / policy / std / test / Handler.java
index e1e398e..9879174 100644 (file)
@@ -32,9 +32,13 @@ import org.openecomp.policy.api.PolicyConfigStatus;
 import org.openecomp.policy.api.PolicyEngine;
 import org.openecomp.policy.api.PolicyEngineException;
 import org.openecomp.policy.api.RemovedPolicy;
+import org.openecomp.policy.common.logging.flexlogger.FlexLogger;
+import org.openecomp.policy.common.logging.flexlogger.Logger;
 
 public class Handler implements NotificationHandler{
        
+       private static final Logger LOGGER      = FlexLogger.getLogger(Handler.class);
+       
        @Override
        public void notificationReceived(PDPNotification notification) {
                System.out.println("Notification Received...");
@@ -56,6 +60,7 @@ public class Handler implements NotificationHandler{
                                        // Checking the Name is correct or not. 
                                        try {
                                                PolicyEngine policyEngine = new PolicyEngine("config.properties");
+                                               @SuppressWarnings("deprecation")
                                                Collection<PolicyConfig> policyConfigs = policyEngine.getConfigByPolicyName(updatedPolicy.getPolicyName());
                                                for(PolicyConfig policyConfig: policyConfigs){
                                                        if(policyConfig.getPolicyConfigStatus().equals(PolicyConfigStatus.CONFIG_RETRIEVED)){
@@ -71,9 +76,9 @@ public class Handler implements NotificationHandler{
                                                        }
                                                }
                                        } catch (PolicyEngineException e) {
-                                               e.printStackTrace();
+                                               LOGGER.error("Exception Occured"+e);
                                        } catch (PolicyConfigException e) {
-                                               e.printStackTrace();
+                                               LOGGER.error("Exception Occured"+e);
                                        }
                                }
                        }
@@ -93,6 +98,7 @@ public class Handler implements NotificationHandler{
                                // Checking the Name is correct or not. 
                                try {
                                        PolicyEngine policyEngine = new PolicyEngine("config.properties");
+                                       @SuppressWarnings("deprecation")
                                        Collection<PolicyConfig> policyConfigs = policyEngine.getConfigByPolicyName(updatedPolicy.getPolicyName());
                                        for(PolicyConfig policyConfig: policyConfigs){
                                                if(policyConfig.getPolicyConfigStatus().equals(PolicyConfigStatus.CONFIG_RETRIEVED)){
@@ -108,9 +114,9 @@ public class Handler implements NotificationHandler{
                                                }
                                        }
                                } catch (PolicyEngineException e) {
-                                       e.printStackTrace();
+                                       LOGGER.error("Exception Occured"+e);
                                } catch (PolicyConfigException e) {
-                                       e.printStackTrace();
+                                       LOGGER.error("Exception Occured"+e);
                                }
                        }
                }