Code Review
/
policy
/
engine.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
Merge "Fixed the SDK Junits and cleaned unused code"
[policy/engine.git]
/
POLICY-SDK-APP
/
src
/
main
/
java
/
org
/
onap
/
policy
/
admin
/
PolicyManagerServlet.java
diff --git
a/POLICY-SDK-APP/src/main/java/org/onap/policy/admin/PolicyManagerServlet.java
b/POLICY-SDK-APP/src/main/java/org/onap/policy/admin/PolicyManagerServlet.java
index
9498529
..
b28850d
100644
(file)
--- a/
POLICY-SDK-APP/src/main/java/org/onap/policy/admin/PolicyManagerServlet.java
+++ b/
POLICY-SDK-APP/src/main/java/org/onap/policy/admin/PolicyManagerServlet.java
@@
-530,16
+530,15
@@
public class PolicyManagerServlet extends HttpServlet {
}
try (BufferedWriter bw = new BufferedWriter(new FileWriter(temp))) {
bw.write(entity.getPolicyData());
}
try (BufferedWriter bw = new BufferedWriter(new FileWriter(temp))) {
bw.write(entity.getPolicyData());
- object = HumanPolicyComponent.DescribePolicy(temp);
} catch (IOException e) {
LOGGER.error("Exception Occured while Describing the Policy"+e);
} catch (IOException e) {
LOGGER.error("Exception Occured while Describing the Policy"+e);
- }
finally{
- if(temp != null){
-
try
{
- Files.delete(temp.toPath());
- } catch (IOException e) {
- LOGGER.warn("Failed to delete " + temp.getName() + e);
- }
+ }
+ object = HumanPolicyComponent.DescribePolicy(temp);
+
if(temp != null)
{
+ try {
+ Files.delete(temp.toPath());
+ } catch (IOException e) {
+ LOGGER.warn("Failed to delete " + temp.getName() + e);
}
}
return object;
}
}
return object;
@@
-1123,7
+1122,11
@@
public class PolicyManagerServlet extends HttpServlet {
SimpleBindings peParams = new SimpleBindings();
peParams.put("oldPolicySplit_1", oldPolicySplit[1]);
peParams.put("oldPolicySplit_0", oldPolicySplit[0]);
SimpleBindings peParams = new SimpleBindings();
peParams.put("oldPolicySplit_1", oldPolicySplit[1]);
peParams.put("oldPolicySplit_0", oldPolicySplit[0]);
- queryData = controller.getDataByQuery(policyEntityquery, peParams);
+ if(PolicyController.isjUnit()){
+ queryData = controller.getDataByQuery(policyEntityquery, null);
+ }else{
+ queryData = controller.getDataByQuery(policyEntityquery, peParams);
+ }
if(!queryData.isEmpty()){
entity = (PolicyEntity) queryData.get(0);
}
if(!queryData.isEmpty()){
entity = (PolicyEntity) queryData.get(0);
}