diff options
author | Ravindra Bakkamanthala <rb7147@att.com> | 2017-05-15 12:53:18 -0400 |
---|---|---|
committer | Ravindra Bakkamanthala <rb7147@att.com> | 2017-05-15 13:55:23 -0400 |
commit | 7e547eaa55920dfbc9691eab33bb728395b50cf2 (patch) | |
tree | 5d0d64928b4754f65b427cb79b43718f16019582 /PolicyEngineClient | |
parent | dda032f8bb161d54eb1f59de2b4a3efb774fc4d1 (diff) |
Policy TestSuite Enabled
Change-Id: I9f98c7dcdcf98713d73544956d873a84fc82adf7
Signed-off-by: Ravindra Bakkamanthala <rb7147@att.com>
Diffstat (limited to 'PolicyEngineClient')
5 files changed, 35 insertions, 20 deletions
diff --git a/PolicyEngineClient/src/main/java/org/openecomp/policyEngine/GeneralTestClient.java b/PolicyEngineClient/src/main/java/org/openecomp/policyEngine/GeneralTestClient.java index c78fc6f11..6ca340efe 100644 --- a/PolicyEngineClient/src/main/java/org/openecomp/policyEngine/GeneralTestClient.java +++ b/PolicyEngineClient/src/main/java/org/openecomp/policyEngine/GeneralTestClient.java @@ -47,6 +47,8 @@ import org.json.simple.JSONObject; import org.json.simple.parser.JSONParser; import org.openecomp.policy.api.PolicyEngine; import org.openecomp.policy.api.PolicyEngineException; +import org.openecomp.policy.common.logging.flexlogger.FlexLogger; +import org.openecomp.policy.common.logging.flexlogger.Logger; /** * Class reads from .testCases file and run the test cases available in the file @@ -58,6 +60,9 @@ import org.openecomp.policy.api.PolicyEngineException; * */ public class GeneralTestClient { + + private static final Logger LOGGER = FlexLogger.getLogger(GeneralTestClient.class); + static int totalTC = 0, passTC = 0, failTC = 0; public static void main(String[] args) { @@ -275,29 +280,26 @@ public class GeneralTestClient { } } catch (PolicyEngineException e) { - // TODO Auto-generated catch block printResult(id, testFor, testCaseDescription, "FAILED"); failTCforFile++; failTC++; - e.printStackTrace(); + LOGGER.error("Exception Occured"+e); } catch (Exception e) { - // TODO Auto-generated catch block printResult(id, testFor, testCaseDescription, "FAILED"); failTCforFile++; failTC++; - e.printStackTrace(); + LOGGER.error("Exception Occured"+e); } } } catch (FileNotFoundException ex) { - ex.printStackTrace(); + LOGGER.error("Exception Occured due to File not found"+ex); } catch (IOException ex) { - ex.printStackTrace(); + LOGGER.error("Exception Occured"+ex); } catch (NullPointerException ex) { - ex.printStackTrace(); + LOGGER.error("Exception Occured due to Null Pointer"+ex); } catch (org.json.simple.parser.ParseException e) { - // TODO Auto-generated catch block - e.printStackTrace(); + LOGGER.error("Exception Occured while Parsing"+e); } } System.out.println("\n\n\t Summary for the file: TOTAL: " diff --git a/PolicyEngineClient/src/main/java/org/openecomp/policyEngine/Handler.java b/PolicyEngineClient/src/main/java/org/openecomp/policyEngine/Handler.java index cc54e7758..ea11f9d8d 100644 --- a/PolicyEngineClient/src/main/java/org/openecomp/policyEngine/Handler.java +++ b/PolicyEngineClient/src/main/java/org/openecomp/policyEngine/Handler.java @@ -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..."); @@ -72,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); } } } @@ -110,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); } } } diff --git a/PolicyEngineClient/src/main/java/org/openecomp/policyEngine/ListConfigPoliciesClient.java b/PolicyEngineClient/src/main/java/org/openecomp/policyEngine/ListConfigPoliciesClient.java index 11f4b0331..b9fd15282 100644 --- a/PolicyEngineClient/src/main/java/org/openecomp/policyEngine/ListConfigPoliciesClient.java +++ b/PolicyEngineClient/src/main/java/org/openecomp/policyEngine/ListConfigPoliciesClient.java @@ -29,8 +29,13 @@ import org.openecomp.policy.api.ConfigRequestParameters; import org.openecomp.policy.api.PolicyConfigException; import org.openecomp.policy.api.PolicyEngine; import org.openecomp.policy.api.PolicyEngineException; +import org.openecomp.policy.common.logging.flexlogger.FlexLogger; +import org.openecomp.policy.common.logging.flexlogger.Logger; public class ListConfigPoliciesClient { + + private static final Logger LOGGER = FlexLogger.getLogger(ListConfigPoliciesClient.class); + public static void main(String[] args) { PolicyEngine policyEngine; @@ -62,10 +67,9 @@ public class ListConfigPoliciesClient { } } catch (PolicyConfigException e) { - e.printStackTrace(); + LOGGER.error("Exception Occured"+e); } catch (PolicyEngineException e) { - // TODO Auto-generated catch block - e.printStackTrace(); + LOGGER.error("Exception Occured"+e); } } diff --git a/PolicyEngineClient/src/main/java/org/openecomp/policyEngine/MainClient.java b/PolicyEngineClient/src/main/java/org/openecomp/policyEngine/MainClient.java index eb3c3b9de..eb6197041 100644 --- a/PolicyEngineClient/src/main/java/org/openecomp/policyEngine/MainClient.java +++ b/PolicyEngineClient/src/main/java/org/openecomp/policyEngine/MainClient.java @@ -41,9 +41,14 @@ import org.openecomp.policy.api.PolicyConfigException; 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; import org.w3c.dom.Document; public class MainClient { + + private static final Logger LOGGER = FlexLogger.getLogger(MainClient.class); + public static void main(String[] args) { PolicyEngine policyEngine; try { @@ -72,7 +77,7 @@ public class MainClient { } } } catch (PolicyConfigException e) { - e.printStackTrace(); + LOGGER.error("Exception Occured"+e); } // Manual Notifications.. diff --git a/PolicyEngineClient/src/main/java/org/openecomp/policyEngine/PolicyEngineTestClient.java b/PolicyEngineClient/src/main/java/org/openecomp/policyEngine/PolicyEngineTestClient.java index 16468e0ec..ecdb1666f 100644 --- a/PolicyEngineClient/src/main/java/org/openecomp/policyEngine/PolicyEngineTestClient.java +++ b/PolicyEngineClient/src/main/java/org/openecomp/policyEngine/PolicyEngineTestClient.java @@ -97,7 +97,7 @@ public class PolicyEngineTestClient { } } } catch (PolicyConfigException e) { -// e.printStackTrace(); +// logger.error("Exception Occured"+e); resultReceived.add(""+e); } return resultReceived; @@ -123,7 +123,7 @@ public class PolicyEngineTestClient { eCOMPComponentName, decisionAttributes, requestID); resultReceived.add(policyDecision.getDecision().toString()); } catch (PolicyDecisionException e) { -// e.printStackTrace(); +// logger.error("Exception Occured"+e); resultReceived.add(""+e); } return resultReceived; @@ -154,7 +154,7 @@ public class PolicyEngineTestClient { } } } catch (PolicyEventException e) { -// e.printStackTrace(); +// logger.error("Exception Occured"+e); resultReceived.add(""+e); } return resultReceived; |