diff options
author | Ravindra Bakkamanthala <rb7147@att.com> | 2017-05-23 14:56:12 -0400 |
---|---|---|
committer | Ravindra Bakkamanthala <rb7147@att.com> | 2017-05-23 16:49:56 -0400 |
commit | 87c95be02a8a4d77e165dede90777e811b59dcae (patch) | |
tree | 4712199fc3520b530dda0c4d3b074c327df547f2 /ECOMP-PDP/src | |
parent | 7e547eaa55920dfbc9691eab33bb728395b50cf2 (diff) |
Commit includes ControlLoopPolicy API and bugfixes
Change-Id: I3e18bb8b4c31a0d908bb0cff4c85e2a3fb450a63
Signed-off-by: Ravindra Bakkamanthala <rb7147@att.com>
Diffstat (limited to 'ECOMP-PDP/src')
34 files changed, 56 insertions, 73 deletions
diff --git a/ECOMP-PDP/src/main/java/org/openecomp/policy/xacml/action/FindAction.java b/ECOMP-PDP/src/main/java/org/openecomp/policy/xacml/action/FindAction.java index ed1664f55..2bcb903e8 100644 --- a/ECOMP-PDP/src/main/java/org/openecomp/policy/xacml/action/FindAction.java +++ b/ECOMP-PDP/src/main/java/org/openecomp/policy/xacml/action/FindAction.java @@ -110,9 +110,9 @@ public class FindAction { return newResponse; } - private Collection<Obligation> obligations = new ArrayList<Obligation>(); - private Map<String, String> matchValues = new HashMap<String, String>(); - private Map<String, String> headers = new HashMap<String, String>(); + private Collection<Obligation> obligations = new ArrayList<>(); + private Map<String, String> matchValues = new HashMap<>(); + private Map<String, String> headers = new HashMap<>(); private boolean header = false; private void search(StdMutableResponse stdResponse) { @@ -124,7 +124,7 @@ public class FindAction { int count = 0, uri = 0, PEP = 0; header = false; changeIt = false; - Collection<AttributeAssignment> afterRemoveAssignments = new ArrayList<AttributeAssignment>(); + Collection<AttributeAssignment> afterRemoveAssignments = new ArrayList<>(); Identifier oblId = new IdentifierImpl(obligation.getId().stringValue()); StdAttributeAssignment attributeURI = null; for (AttributeAssignment attribute : obligation.getAttributeAssignments()) { @@ -151,22 +151,7 @@ public class FindAction { String papPath = XACMLProperties.getProperty(XACMLRestProperties.PROP_PAP_URL); papPath= papPath.replace("/pap", ""); matchValues.put("body",attribute.getAttributeValue().getValue().toString().replace("$URL", papPath)); - } /* - * else if (attribute.getAttributeId().stringValue(). - * equalsIgnoreCase("type")){ requestAction.put("Type", - * attribute.getAttributeValue().getValue().toString()); - * afterRemoveAssignments.add(attribute); } else - * if(attribute - * .getAttributeId().stringValue().equalsIgnoreCase - * ("method")) { requestAction.put("Method", - * attribute.getAttributeValue().getValue().toString()); - * afterRemoveAssignments.add(attribute); } else - * if(attribute - * .getAttributeId().stringValue().equalsIgnoreCase - * ("body")) { requestAction.put("Body", - * attribute.getAttributeValue().getValue().toString()); - * afterRemoveAssignments.add(attribute); } - */else { + }else { StdAttributeAssignment attributeObligation = new StdAttributeAssignment(attribute); afterRemoveAssignments.add(attributeObligation); } @@ -174,7 +159,7 @@ public class FindAction { if (count == 1 && uri == 1 && PEP == 0) { // Remove Obligation and add Advice changeIt = true; - TakeAction(stdResponse, oblId, afterRemoveAssignments); + takeAction(stdResponse, oblId, afterRemoveAssignments); } else if (PEP == 1 && count == 0) { // Strip the PEPACTION if available if (uri == 1) { @@ -191,7 +176,7 @@ public class FindAction { } } - private void TakeAction(StdMutableResponse stdResponse, Identifier advId, + private void takeAction(StdMutableResponse stdResponse, Identifier advId, Collection<AttributeAssignment> afterRemoveAssignments) { if (changeIt) { LOGGER.info("the URL is :" + configURL); @@ -199,24 +184,22 @@ public class FindAction { callRest(); // Including the Results in an Advice Identifier id = new IdentifierImpl( - "com:att:labs:ecomp:policy:pdp:reply"); + "org:openecomp:policy:pdp:reply"); Identifier statId = new IdentifierImpl( - "com:att:labs:ecomp:policy:pdp:reply:status"); + "org:openecomp:ecomp:policy:pdp:reply:status"); Identifier statCategory = new IdentifierImpl( "urn:oasis:names:tc:xacml:1.0:subject-category:recipient-subject"); Identifier strId = new IdentifierImpl( "http://www.w3.org/2001/XMLSchema#string"); Identifier resId = new IdentifierImpl( - "com:att:labs:ecomp:policy:pdp:reply:resource"); + "org:openecomp:ecomp:policy:pdp:reply:resource"); Identifier resCategory = new IdentifierImpl( "urn:oasis:names:tc:xacml:3.0:attribute-category:resource"); Identifier urlId = new IdentifierImpl( "http://www.w3.org/2001/XMLSchema#anyURI"); - // Collection<AttributeAssignment> attributes = new - // ArrayList<AttributeAssignment>(); - AttributeValue<String> attributeStatusValue = new StdAttributeValue<String>( + AttributeValue<String> attributeStatusValue = new StdAttributeValue<>( strId, status + response); - AttributeValue<String> attributeResourceValue = new StdAttributeValue<String>( + AttributeValue<String> attributeResourceValue = new StdAttributeValue<>( urlId, configURL); StdAttributeAssignment attributeStatus = new StdAttributeAssignment( statCategory, statId, "PDP", attributeStatusValue); diff --git a/ECOMP-PDP/src/main/java/org/openecomp/policy/xacml/custom/EcompFunctionDefinitionFactory.java b/ECOMP-PDP/src/main/java/org/openecomp/policy/xacml/custom/EcompFunctionDefinitionFactory.java index d6d664ab6..202468feb 100644 --- a/ECOMP-PDP/src/main/java/org/openecomp/policy/xacml/custom/EcompFunctionDefinitionFactory.java +++ b/ECOMP-PDP/src/main/java/org/openecomp/policy/xacml/custom/EcompFunctionDefinitionFactory.java @@ -34,12 +34,12 @@ import com.att.research.xacmlatt.pdp.policy.FunctionDefinitionFactory; import com.att.research.xacmlatt.pdp.std.StdFunctions; public class EcompFunctionDefinitionFactory extends FunctionDefinitionFactory { - private static Map<Identifier,FunctionDefinition> mapFunctionDefinitions = new HashMap<Identifier,FunctionDefinition>(); + private static Map<Identifier,FunctionDefinition> mapFunctionDefinitions = new HashMap<>(); private static boolean needMapInit = true; public static final Identifier ID_FUNCTION_CUSTOM_REGEXP_MATCH = new IdentifierImpl("org.openecomp.function.regex-match"); - private static final FunctionDefinition FD_CUSTOM_REGEXP_MATCH = new FunctionDefinitionCustomRegexpMatch<String>(ID_FUNCTION_CUSTOM_REGEXP_MATCH, DataTypes.DT_STRING); + private static final FunctionDefinition FD_CUSTOM_REGEXP_MATCH = new FunctionDefinitionCustomRegexpMatch<>(ID_FUNCTION_CUSTOM_REGEXP_MATCH, DataTypes.DT_STRING); private static void register(FunctionDefinition functionDefinition) { mapFunctionDefinitions.put(functionDefinition.getId(), functionDefinition); diff --git a/ECOMP-PDP/src/main/java/org/openecomp/policy/xacml/pdp/std/functions/PolicyList.java b/ECOMP-PDP/src/main/java/org/openecomp/policy/xacml/pdp/std/functions/PolicyList.java index d1a14d502..da9e69ebc 100644 --- a/ECOMP-PDP/src/main/java/org/openecomp/policy/xacml/pdp/std/functions/PolicyList.java +++ b/ECOMP-PDP/src/main/java/org/openecomp/policy/xacml/pdp/std/functions/PolicyList.java @@ -28,7 +28,7 @@ import java.util.List; */ public class PolicyList { - private static List<String> policyList = new ArrayList<String>(); + private static List<String> policyList = new ArrayList<>(); public static List<String> getpolicyList(){ diff --git a/ECOMP-PDP/src/test/java/org/openecomp/policy/pdp/test/FunctionDefinitionAccessPermittedTest.java b/ECOMP-PDP/src/test/java/org/openecomp/policy/pdp/test/FunctionDefinitionAccessPermittedTest.java index bd86e50b1..a94c110d8 100644 --- a/ECOMP-PDP/src/test/java/org/openecomp/policy/pdp/test/FunctionDefinitionAccessPermittedTest.java +++ b/ECOMP-PDP/src/test/java/org/openecomp/policy/pdp/test/FunctionDefinitionAccessPermittedTest.java @@ -173,7 +173,7 @@ public class FunctionDefinitionAccessPermittedTest { /* * variables useful in the following tests */ - List<FunctionArgument> arguments = new ArrayList<FunctionArgument>(); + List<FunctionArgument> arguments = new ArrayList<>(); diff --git a/ECOMP-PDP/src/test/java/org/openecomp/policy/pdp/test/FunctionDefinitionArithmeticTest.java b/ECOMP-PDP/src/test/java/org/openecomp/policy/pdp/test/FunctionDefinitionArithmeticTest.java index 79e4ea9ee..69e8744f7 100644 --- a/ECOMP-PDP/src/test/java/org/openecomp/policy/pdp/test/FunctionDefinitionArithmeticTest.java +++ b/ECOMP-PDP/src/test/java/org/openecomp/policy/pdp/test/FunctionDefinitionArithmeticTest.java @@ -52,7 +52,7 @@ public class FunctionDefinitionArithmeticTest { /* * variables useful in the following tests */ - List<FunctionArgument> arguments = new ArrayList<FunctionArgument>(); + List<FunctionArgument> arguments = new ArrayList<>(); @Test public void testInteger_add() { diff --git a/ECOMP-PDP/src/test/java/org/openecomp/policy/pdp/test/FunctionDefinitionBagIsInTest.java b/ECOMP-PDP/src/test/java/org/openecomp/policy/pdp/test/FunctionDefinitionBagIsInTest.java index 8024b9e36..ecb870164 100644 --- a/ECOMP-PDP/src/test/java/org/openecomp/policy/pdp/test/FunctionDefinitionBagIsInTest.java +++ b/ECOMP-PDP/src/test/java/org/openecomp/policy/pdp/test/FunctionDefinitionBagIsInTest.java @@ -55,7 +55,7 @@ public class FunctionDefinitionBagIsInTest { /* * variables useful in the following tests */ - List<FunctionArgument> arguments = new ArrayList<FunctionArgument>(); + List<FunctionArgument> arguments = new ArrayList<>(); @Test diff --git a/ECOMP-PDP/src/test/java/org/openecomp/policy/pdp/test/FunctionDefinitionBagOneAndOnlyTest.java b/ECOMP-PDP/src/test/java/org/openecomp/policy/pdp/test/FunctionDefinitionBagOneAndOnlyTest.java index 8c129f843..e45dfb99c 100644 --- a/ECOMP-PDP/src/test/java/org/openecomp/policy/pdp/test/FunctionDefinitionBagOneAndOnlyTest.java +++ b/ECOMP-PDP/src/test/java/org/openecomp/policy/pdp/test/FunctionDefinitionBagOneAndOnlyTest.java @@ -54,7 +54,7 @@ public class FunctionDefinitionBagOneAndOnlyTest { /* * variables useful in the following tests */ - List<FunctionArgument> arguments = new ArrayList<FunctionArgument>(); + List<FunctionArgument> arguments = new ArrayList<>(); @Test diff --git a/ECOMP-PDP/src/test/java/org/openecomp/policy/pdp/test/FunctionDefinitionBagSizeTest.java b/ECOMP-PDP/src/test/java/org/openecomp/policy/pdp/test/FunctionDefinitionBagSizeTest.java index 4a536bced..7cb3e0488 100644 --- a/ECOMP-PDP/src/test/java/org/openecomp/policy/pdp/test/FunctionDefinitionBagSizeTest.java +++ b/ECOMP-PDP/src/test/java/org/openecomp/policy/pdp/test/FunctionDefinitionBagSizeTest.java @@ -54,7 +54,7 @@ public class FunctionDefinitionBagSizeTest { /* * variables useful in the following tests */ - List<FunctionArgument> arguments = new ArrayList<FunctionArgument>(); + List<FunctionArgument> arguments = new ArrayList<>(); @Test diff --git a/ECOMP-PDP/src/test/java/org/openecomp/policy/pdp/test/FunctionDefinitionBagTest.java b/ECOMP-PDP/src/test/java/org/openecomp/policy/pdp/test/FunctionDefinitionBagTest.java index 5b99395a5..0f1a6009c 100644 --- a/ECOMP-PDP/src/test/java/org/openecomp/policy/pdp/test/FunctionDefinitionBagTest.java +++ b/ECOMP-PDP/src/test/java/org/openecomp/policy/pdp/test/FunctionDefinitionBagTest.java @@ -57,7 +57,7 @@ public class FunctionDefinitionBagTest { /* * variables useful in the following tests */ - List<FunctionArgument> arguments = new ArrayList<FunctionArgument>(); + List<FunctionArgument> arguments = new ArrayList<>(); FunctionArgumentAttributeValue attrInteger = null; diff --git a/ECOMP-PDP/src/test/java/org/openecomp/policy/pdp/test/FunctionDefinitionComparisonTest.java b/ECOMP-PDP/src/test/java/org/openecomp/policy/pdp/test/FunctionDefinitionComparisonTest.java index 0ea1a2c9d..9c3cc7faf 100644 --- a/ECOMP-PDP/src/test/java/org/openecomp/policy/pdp/test/FunctionDefinitionComparisonTest.java +++ b/ECOMP-PDP/src/test/java/org/openecomp/policy/pdp/test/FunctionDefinitionComparisonTest.java @@ -56,7 +56,7 @@ public class FunctionDefinitionComparisonTest { /* * variables useful in the following tests */ - List<FunctionArgument> arguments = new ArrayList<FunctionArgument>(); + List<FunctionArgument> arguments = new ArrayList<>(); FunctionArgumentAttributeValue stringAttr1 = null; FunctionArgumentAttributeValue stringAttr1a = null; diff --git a/ECOMP-PDP/src/test/java/org/openecomp/policy/pdp/test/FunctionDefinitionDateTimeArithmeticTest.java b/ECOMP-PDP/src/test/java/org/openecomp/policy/pdp/test/FunctionDefinitionDateTimeArithmeticTest.java index af3d7afa8..a4a6a425b 100644 --- a/ECOMP-PDP/src/test/java/org/openecomp/policy/pdp/test/FunctionDefinitionDateTimeArithmeticTest.java +++ b/ECOMP-PDP/src/test/java/org/openecomp/policy/pdp/test/FunctionDefinitionDateTimeArithmeticTest.java @@ -58,7 +58,7 @@ public class FunctionDefinitionDateTimeArithmeticTest { /* * variables useful in the following tests */ - List<FunctionArgument> arguments = new ArrayList<FunctionArgument>(); + List<FunctionArgument> arguments = new ArrayList<>(); ExpressionResult res; diff --git a/ECOMP-PDP/src/test/java/org/openecomp/policy/pdp/test/FunctionDefinitionEqualityTest.java b/ECOMP-PDP/src/test/java/org/openecomp/policy/pdp/test/FunctionDefinitionEqualityTest.java index 86bfcd5c4..53762264c 100644 --- a/ECOMP-PDP/src/test/java/org/openecomp/policy/pdp/test/FunctionDefinitionEqualityTest.java +++ b/ECOMP-PDP/src/test/java/org/openecomp/policy/pdp/test/FunctionDefinitionEqualityTest.java @@ -79,7 +79,7 @@ public class FunctionDefinitionEqualityTest { /* * variables useful in the following tests */ - List<FunctionArgument> arguments = new ArrayList<FunctionArgument>(); + List<FunctionArgument> arguments = new ArrayList<>(); FunctionArgumentAttributeValue stringAttr1 = null; FunctionArgumentAttributeValue stringAttr2 = null; diff --git a/ECOMP-PDP/src/test/java/org/openecomp/policy/pdp/test/FunctionDefinitionHigherOrderBagTest.java b/ECOMP-PDP/src/test/java/org/openecomp/policy/pdp/test/FunctionDefinitionHigherOrderBagTest.java index 607259ab9..9e0c72ce0 100644 --- a/ECOMP-PDP/src/test/java/org/openecomp/policy/pdp/test/FunctionDefinitionHigherOrderBagTest.java +++ b/ECOMP-PDP/src/test/java/org/openecomp/policy/pdp/test/FunctionDefinitionHigherOrderBagTest.java @@ -56,7 +56,7 @@ public class FunctionDefinitionHigherOrderBagTest { /* * variables useful in the following tests */ - List<FunctionArgument> arguments = new ArrayList<FunctionArgument>(); + List<FunctionArgument> arguments = new ArrayList<>(); diff --git a/ECOMP-PDP/src/test/java/org/openecomp/policy/pdp/test/FunctionDefinitionHomogeneousSimpleTest.java b/ECOMP-PDP/src/test/java/org/openecomp/policy/pdp/test/FunctionDefinitionHomogeneousSimpleTest.java index 6aee3383b..1e104a594 100644 --- a/ECOMP-PDP/src/test/java/org/openecomp/policy/pdp/test/FunctionDefinitionHomogeneousSimpleTest.java +++ b/ECOMP-PDP/src/test/java/org/openecomp/policy/pdp/test/FunctionDefinitionHomogeneousSimpleTest.java @@ -88,8 +88,8 @@ public class FunctionDefinitionHomogeneousSimpleTest { } FunctionDefinitionEquality<String> fd = new FunctionDefinitionEquality<String>(XACML3.ID_FUNCTION_STRING_EQUAL, DataTypes.DT_STRING); - List<String> convertedValues = new ArrayList<String>(); - List<FunctionArgument> listFunctionArguments = new ArrayList<FunctionArgument>(); + List<String> convertedValues = new ArrayList<>(); + List<FunctionArgument> listFunctionArguments = new ArrayList<>(); // test correct # of args, both of them strings listFunctionArguments.add(stringAttr1); diff --git a/ECOMP-PDP/src/test/java/org/openecomp/policy/pdp/test/FunctionDefinitionLogicalTest.java b/ECOMP-PDP/src/test/java/org/openecomp/policy/pdp/test/FunctionDefinitionLogicalTest.java index 615a8ecf1..7530e417b 100644 --- a/ECOMP-PDP/src/test/java/org/openecomp/policy/pdp/test/FunctionDefinitionLogicalTest.java +++ b/ECOMP-PDP/src/test/java/org/openecomp/policy/pdp/test/FunctionDefinitionLogicalTest.java @@ -51,7 +51,7 @@ public class FunctionDefinitionLogicalTest { /* * variables useful in the following tests */ - List<FunctionArgument> arguments = new ArrayList<FunctionArgument>(); + List<FunctionArgument> arguments = new ArrayList<>(); // use the same args for each test FunctionArgumentAttributeValue attrT = null; diff --git a/ECOMP-PDP/src/test/java/org/openecomp/policy/pdp/test/FunctionDefinitionNumberTypeConversionTest.java b/ECOMP-PDP/src/test/java/org/openecomp/policy/pdp/test/FunctionDefinitionNumberTypeConversionTest.java index 2b7dbf4e2..9b2a39424 100644 --- a/ECOMP-PDP/src/test/java/org/openecomp/policy/pdp/test/FunctionDefinitionNumberTypeConversionTest.java +++ b/ECOMP-PDP/src/test/java/org/openecomp/policy/pdp/test/FunctionDefinitionNumberTypeConversionTest.java @@ -52,7 +52,7 @@ public class FunctionDefinitionNumberTypeConversionTest { /* * variables useful in the following tests */ - List<FunctionArgument> arguments = new ArrayList<FunctionArgument>(); + List<FunctionArgument> arguments = new ArrayList<>(); @Test public void testDouble_to_integer() { diff --git a/ECOMP-PDP/src/test/java/org/openecomp/policy/pdp/test/FunctionDefinitionRegexpMatchTest.java b/ECOMP-PDP/src/test/java/org/openecomp/policy/pdp/test/FunctionDefinitionRegexpMatchTest.java index 26cc46620..423c4db48 100644 --- a/ECOMP-PDP/src/test/java/org/openecomp/policy/pdp/test/FunctionDefinitionRegexpMatchTest.java +++ b/ECOMP-PDP/src/test/java/org/openecomp/policy/pdp/test/FunctionDefinitionRegexpMatchTest.java @@ -58,7 +58,7 @@ public class FunctionDefinitionRegexpMatchTest { /* * variables useful in the following tests */ - List<FunctionArgument> arguments = new ArrayList<FunctionArgument>(); + List<FunctionArgument> arguments = new ArrayList<>(); @Test diff --git a/ECOMP-PDP/src/test/java/org/openecomp/policy/pdp/test/FunctionDefinitionSetTest.java b/ECOMP-PDP/src/test/java/org/openecomp/policy/pdp/test/FunctionDefinitionSetTest.java index cbc71e78d..8e8497b0b 100644 --- a/ECOMP-PDP/src/test/java/org/openecomp/policy/pdp/test/FunctionDefinitionSetTest.java +++ b/ECOMP-PDP/src/test/java/org/openecomp/policy/pdp/test/FunctionDefinitionSetTest.java @@ -58,7 +58,7 @@ public class FunctionDefinitionSetTest { /* * variables useful in the following tests */ - List<FunctionArgument> arguments = new ArrayList<FunctionArgument>(); + List<FunctionArgument> arguments = new ArrayList<>(); diff --git a/ECOMP-PDP/src/test/java/org/openecomp/policy/pdp/test/FunctionDefinitionSpecialMatchTest.java b/ECOMP-PDP/src/test/java/org/openecomp/policy/pdp/test/FunctionDefinitionSpecialMatchTest.java index 19d673624..f2e6bdb35 100644 --- a/ECOMP-PDP/src/test/java/org/openecomp/policy/pdp/test/FunctionDefinitionSpecialMatchTest.java +++ b/ECOMP-PDP/src/test/java/org/openecomp/policy/pdp/test/FunctionDefinitionSpecialMatchTest.java @@ -55,7 +55,7 @@ public class FunctionDefinitionSpecialMatchTest { /* * variables useful in the following tests */ - List<FunctionArgument> arguments = new ArrayList<FunctionArgument>(); + List<FunctionArgument> arguments = new ArrayList<>(); @Test public void testX500NameMatch() { diff --git a/ECOMP-PDP/src/test/java/org/openecomp/policy/pdp/test/FunctionDefinitionStringConversionTest.java b/ECOMP-PDP/src/test/java/org/openecomp/policy/pdp/test/FunctionDefinitionStringConversionTest.java index 1e3fd7e70..deca2b15f 100644 --- a/ECOMP-PDP/src/test/java/org/openecomp/policy/pdp/test/FunctionDefinitionStringConversionTest.java +++ b/ECOMP-PDP/src/test/java/org/openecomp/policy/pdp/test/FunctionDefinitionStringConversionTest.java @@ -70,7 +70,7 @@ public class FunctionDefinitionStringConversionTest { /* * variables useful in the following tests */ - List<FunctionArgument> arguments = new ArrayList<FunctionArgument>(); + List<FunctionArgument> arguments = new ArrayList<>(); /** diff --git a/ECOMP-PDP/src/test/java/org/openecomp/policy/pdp/test/FunctionDefinitionStringEqualIgnoreCaseTest.java b/ECOMP-PDP/src/test/java/org/openecomp/policy/pdp/test/FunctionDefinitionStringEqualIgnoreCaseTest.java index 6475e8d4a..65f92a9f0 100644 --- a/ECOMP-PDP/src/test/java/org/openecomp/policy/pdp/test/FunctionDefinitionStringEqualIgnoreCaseTest.java +++ b/ECOMP-PDP/src/test/java/org/openecomp/policy/pdp/test/FunctionDefinitionStringEqualIgnoreCaseTest.java @@ -56,7 +56,7 @@ public class FunctionDefinitionStringEqualIgnoreCaseTest { /* * variables useful in the following tests */ - List<FunctionArgument> arguments = new ArrayList<FunctionArgument>(); + List<FunctionArgument> arguments = new ArrayList<>(); FunctionArgumentAttributeValue stringAttr1 = null; FunctionArgumentAttributeValue stringAttr2 = null; diff --git a/ECOMP-PDP/src/test/java/org/openecomp/policy/pdp/test/FunctionDefinitionStringFunctionsTest.java b/ECOMP-PDP/src/test/java/org/openecomp/policy/pdp/test/FunctionDefinitionStringFunctionsTest.java index e80fb685d..7b556e3bc 100644 --- a/ECOMP-PDP/src/test/java/org/openecomp/policy/pdp/test/FunctionDefinitionStringFunctionsTest.java +++ b/ECOMP-PDP/src/test/java/org/openecomp/policy/pdp/test/FunctionDefinitionStringFunctionsTest.java @@ -53,7 +53,7 @@ public class FunctionDefinitionStringFunctionsTest { /* * variables useful in the following tests */ - List<FunctionArgument> arguments = new ArrayList<FunctionArgument>(); + List<FunctionArgument> arguments = new ArrayList<>(); ExpressionResult res; diff --git a/ECOMP-PDP/src/test/java/org/openecomp/policy/pdp/test/FunctionDefinitionStringNormalizeTest.java b/ECOMP-PDP/src/test/java/org/openecomp/policy/pdp/test/FunctionDefinitionStringNormalizeTest.java index 61848f7ff..0de8a0f0b 100644 --- a/ECOMP-PDP/src/test/java/org/openecomp/policy/pdp/test/FunctionDefinitionStringNormalizeTest.java +++ b/ECOMP-PDP/src/test/java/org/openecomp/policy/pdp/test/FunctionDefinitionStringNormalizeTest.java @@ -51,7 +51,7 @@ public class FunctionDefinitionStringNormalizeTest { /* * variables useful in the following tests */ - List<FunctionArgument> arguments = new ArrayList<FunctionArgument>(); + List<FunctionArgument> arguments = new ArrayList<>(); @Test public void testString_normalize_space() { diff --git a/ECOMP-PDP/src/test/java/org/openecomp/policy/pdp/test/FunctionDefinitionURIStringConcatenateTest.java b/ECOMP-PDP/src/test/java/org/openecomp/policy/pdp/test/FunctionDefinitionURIStringConcatenateTest.java index 50a0fd315..8a864a1a0 100644 --- a/ECOMP-PDP/src/test/java/org/openecomp/policy/pdp/test/FunctionDefinitionURIStringConcatenateTest.java +++ b/ECOMP-PDP/src/test/java/org/openecomp/policy/pdp/test/FunctionDefinitionURIStringConcatenateTest.java @@ -57,7 +57,7 @@ public class FunctionDefinitionURIStringConcatenateTest { /* * variables useful in the following tests */ - List<FunctionArgument> arguments = new ArrayList<FunctionArgument>(); + List<FunctionArgument> arguments = new ArrayList<>(); @SuppressWarnings("deprecation") diff --git a/ECOMP-PDP/src/test/java/org/openecomp/policy/pdp/test/conformance/ConformancePIPEngine.java b/ECOMP-PDP/src/test/java/org/openecomp/policy/pdp/test/conformance/ConformancePIPEngine.java index 84012c0d3..64085411f 100644 --- a/ECOMP-PDP/src/test/java/org/openecomp/policy/pdp/test/conformance/ConformancePIPEngine.java +++ b/ECOMP-PDP/src/test/java/org/openecomp/policy/pdp/test/conformance/ConformancePIPEngine.java @@ -70,8 +70,8 @@ public class ConformancePIPEngine implements ConfigurableEngine { private String name; private String description; - private Map<String,PIPResponse> cache = new HashMap<String,PIPResponse>(); - private List<Attribute> listAttributes = new ArrayList<Attribute>(); + private Map<String,PIPResponse> cache = new HashMap<>(); + private List<Attribute> listAttributes = new ArrayList<>(); private DataTypeFactory dataTypeFactory; public ConformancePIPEngine() { @@ -182,7 +182,7 @@ public class ConformancePIPEngine implements ConfigurableEngine { /* * Iterate through the values and only return the ones that match the requested data type */ - List<AttributeValue<?>> matchingValues = new ArrayList<AttributeValue<?>>(); + List<AttributeValue<?>> matchingValues = new ArrayList<>(); Iterator<AttributeValue<?>> iterAttributeValues = attributeMatch.getValues().iterator(); while (iterAttributeValues.hasNext()) { AttributeValue<?> attributeValue = iterAttributeValues.next(); diff --git a/ECOMP-PDP/src/test/java/org/openecomp/policy/pdp/test/conformance/ConformanceRepository.java b/ECOMP-PDP/src/test/java/org/openecomp/policy/pdp/test/conformance/ConformanceRepository.java index f58ca4e9a..edbfbbf62 100644 --- a/ECOMP-PDP/src/test/java/org/openecomp/policy/pdp/test/conformance/ConformanceRepository.java +++ b/ECOMP-PDP/src/test/java/org/openecomp/policy/pdp/test/conformance/ConformanceRepository.java @@ -40,8 +40,8 @@ import com.att.research.xacmlatt.pdp.std.StdPolicyFinderFactory; * @version $Revision$ */ public class ConformanceRepository { - private List<File> rootPolicies = new ArrayList<File>(); - private List<File> referencedPolicies = new ArrayList<File>(); + private List<File> rootPolicies = new ArrayList<>(); + private List<File> referencedPolicies = new ArrayList<>(); private void setXACMLProperty(String propertyName, List<File> listFiles) { Iterator<File> iterFiles = listFiles.iterator(); diff --git a/ECOMP-PDP/src/test/java/org/openecomp/policy/pdp/test/conformance/ConformanceScopeResolver.java b/ECOMP-PDP/src/test/java/org/openecomp/policy/pdp/test/conformance/ConformanceScopeResolver.java index fe2bc15f2..76149869a 100644 --- a/ECOMP-PDP/src/test/java/org/openecomp/policy/pdp/test/conformance/ConformanceScopeResolver.java +++ b/ECOMP-PDP/src/test/java/org/openecomp/policy/pdp/test/conformance/ConformanceScopeResolver.java @@ -50,7 +50,7 @@ import com.att.research.xacml.std.datatypes.DataTypes; */ public class ConformanceScopeResolver implements ScopeResolver { private Logger logger = FlexLogger.getLogger(ConformanceScopeResolver.class); - private Map<URI, List<URI>> mapIdentifierToChildren = new HashMap<URI,List<URI>>(); + private Map<URI, List<URI>> mapIdentifierToChildren = new HashMap<>(); public ConformanceScopeResolver() { } @@ -58,7 +58,7 @@ public class ConformanceScopeResolver implements ScopeResolver { public void add(URI identifierRoot, URI identifierChild) { List<URI> listChildrenRoot = this.mapIdentifierToChildren.get(identifierRoot); if (listChildrenRoot == null) { - listChildrenRoot = new ArrayList<URI>(); + listChildrenRoot = new ArrayList<>(); this.mapIdentifierToChildren.put(identifierRoot, listChildrenRoot); } listChildrenRoot.add(identifierChild); @@ -98,7 +98,7 @@ public class ConformanceScopeResolver implements ScopeResolver { @Override public ScopeResolverResult resolveScope(Attribute attributeResourceId, ScopeQualifier scopeQualifier) throws ScopeResolverException { - List<Attribute> listAttributes = new ArrayList<Attribute>(); + List<Attribute> listAttributes = new ArrayList<>(); switch(scopeQualifier) { case CHILDREN: listAttributes.add(attributeResourceId); diff --git a/ECOMP-PDP/src/test/java/org/openecomp/policy/pdp/test/conformance/ConformanceTestSet.java b/ECOMP-PDP/src/test/java/org/openecomp/policy/pdp/test/conformance/ConformanceTestSet.java index 65e10a489..2df4dbc2f 100644 --- a/ECOMP-PDP/src/test/java/org/openecomp/policy/pdp/test/conformance/ConformanceTestSet.java +++ b/ECOMP-PDP/src/test/java/org/openecomp/policy/pdp/test/conformance/ConformanceTestSet.java @@ -45,7 +45,7 @@ import org.openecomp.policy.common.logging.flexlogger.Logger; */ public class ConformanceTestSet { private static final Logger logger = FlexLogger.getLogger(ConformanceTestSet.class); - private List<ConformanceTest> listConformanceTests = new ArrayList<ConformanceTest>(); + private List<ConformanceTest> listConformanceTests = new ArrayList<>(); protected List<ConformanceTest> getListConformanceTests() { return this.listConformanceTests; @@ -127,7 +127,7 @@ public class ConformanceTestSet { /* * Sort the keyset and pull out the tests that have the required components */ - List<String> listTestNames = new ArrayList<String>(); + List<String> listTestNames = new ArrayList<>(); listTestNames.addAll(mapConformanceTests.keySet()); Collections.sort(listTestNames); diff --git a/ECOMP-PDP/src/test/java/org/openecomp/policy/pdp/test/conformance/ResponseMatchResult.java b/ECOMP-PDP/src/test/java/org/openecomp/policy/pdp/test/conformance/ResponseMatchResult.java index 90e4a9b34..f556bcc2e 100644 --- a/ECOMP-PDP/src/test/java/org/openecomp/policy/pdp/test/conformance/ResponseMatchResult.java +++ b/ECOMP-PDP/src/test/java/org/openecomp/policy/pdp/test/conformance/ResponseMatchResult.java @@ -35,7 +35,7 @@ import com.att.research.xacml.api.Result; * @version $Revision: 1.1 $ */ public class ResponseMatchResult { - private List<ResultMatchResult> resultMatchResults = new ArrayList<ResultMatchResult>(); + private List<ResultMatchResult> resultMatchResults = new ArrayList<>(); private boolean bAssociatedAdviceMatches = true; private boolean bAttributesMatch = true; diff --git a/ECOMP-PDP/src/test/java/org/openecomp/policy/pdp/test/custom/CustomDataTypeFactory.java b/ECOMP-PDP/src/test/java/org/openecomp/policy/pdp/test/custom/CustomDataTypeFactory.java index a677fb849..10f77666d 100644 --- a/ECOMP-PDP/src/test/java/org/openecomp/policy/pdp/test/custom/CustomDataTypeFactory.java +++ b/ECOMP-PDP/src/test/java/org/openecomp/policy/pdp/test/custom/CustomDataTypeFactory.java @@ -29,7 +29,7 @@ import com.att.research.xacml.api.Identifier; import com.att.research.xacml.std.datatypes.DataTypes; public class CustomDataTypeFactory extends DataTypeFactory { - private static final Map<Identifier,DataType<?>> mapIdentifiersToDataTypes = new HashMap<Identifier,DataType<?>>(); + private static final Map<Identifier,DataType<?>> mapIdentifiersToDataTypes = new HashMap<>(); private static boolean mapNeedsInit = true; public static final DataTypePrivateKey DT_PRIVATEKEY = DataTypePrivateKey.newInstance(); diff --git a/ECOMP-PDP/src/test/java/org/openecomp/policy/pdp/test/custom/CustomFunctionDefinitionFactory.java b/ECOMP-PDP/src/test/java/org/openecomp/policy/pdp/test/custom/CustomFunctionDefinitionFactory.java index c8f9bb787..80f130906 100644 --- a/ECOMP-PDP/src/test/java/org/openecomp/policy/pdp/test/custom/CustomFunctionDefinitionFactory.java +++ b/ECOMP-PDP/src/test/java/org/openecomp/policy/pdp/test/custom/CustomFunctionDefinitionFactory.java @@ -35,7 +35,7 @@ import com.att.research.xacmlatt.pdp.std.StdFunctions; import com.att.research.xacmlatt.pdp.std.functions.FunctionDefinitionBagOneAndOnly; public class CustomFunctionDefinitionFactory extends FunctionDefinitionFactory { - private static Map<Identifier,FunctionDefinition> mapFunctionDefinitions = new HashMap<Identifier,FunctionDefinition>(); + private static Map<Identifier,FunctionDefinition> mapFunctionDefinitions = new HashMap<>(); private static boolean needMapInit = true; public static final Identifier ID_FUNCTION_PRIVATEKEY_ONE_AND_ONLY = new IdentifierImpl("urn:com:att:research:xacml:custom:function:3.0:rsa:privatekey-one-and-only"); diff --git a/ECOMP-PDP/src/test/java/org/openecomp/policy/pdp/test/custom/TestBase.java b/ECOMP-PDP/src/test/java/org/openecomp/policy/pdp/test/custom/TestBase.java index 7e1928c41..a9b504dfd 100644 --- a/ECOMP-PDP/src/test/java/org/openecomp/policy/pdp/test/custom/TestBase.java +++ b/ECOMP-PDP/src/test/java/org/openecomp/policy/pdp/test/custom/TestBase.java @@ -109,7 +109,7 @@ public class TestBase extends SimpleFileVisitor<Path> { Path file; InputStream is; BufferedReader reader; - List<StdMutableAttribute> attributes = new ArrayList<StdMutableAttribute>(); + List<StdMutableAttribute> attributes = new ArrayList<>(); public Generator(Path path) { this.file = path; @@ -193,7 +193,7 @@ public class TestBase extends SimpleFileVisitor<Path> { protected URL restURL = null; protected int loop = 1; protected PDPEngine engine = null; - protected List<Generator> generators = new ArrayList<Generator>(); + protected List<Generator> generators = new ArrayList<>(); protected static DataTypeFactory dataTypeFactory = null; private long permits = 0; @@ -649,7 +649,7 @@ public class TestBase extends SimpleFileVisitor<Path> { // // Copy the request attributes // - List<StdMutableRequestAttributes> attributes = new ArrayList<StdMutableRequestAttributes>(); + List<StdMutableRequestAttributes> attributes = new ArrayList<>(); for (RequestAttributes a : request.getRequestAttributes()) { attributes.add(new StdMutableRequestAttributes(a)); } diff --git a/ECOMP-PDP/src/test/java/org/openecomp/policy/pdp/test/custom/TestCustom.java b/ECOMP-PDP/src/test/java/org/openecomp/policy/pdp/test/custom/TestCustom.java index 4d6ecb714..84d8226be 100644 --- a/ECOMP-PDP/src/test/java/org/openecomp/policy/pdp/test/custom/TestCustom.java +++ b/ECOMP-PDP/src/test/java/org/openecomp/policy/pdp/test/custom/TestCustom.java @@ -214,7 +214,7 @@ public class TestCustom extends TestBase { // // Copy the request attributes // - List<StdMutableRequestAttributes> attributes = new ArrayList<StdMutableRequestAttributes>(); + List<StdMutableRequestAttributes> attributes = new ArrayList<>(); for (RequestAttributes a : oldRequest.getRequestAttributes()) { attributes.add(new StdMutableRequestAttributes(a)); } diff --git a/ECOMP-PDP/src/test/resources/logback.xml b/ECOMP-PDP/src/test/resources/logback.xml index e51ac17e1..ea027dcbb 100644 --- a/ECOMP-PDP/src/test/resources/logback.xml +++ b/ECOMP-PDP/src/test/resources/logback.xml @@ -29,7 +29,7 @@ <!-- specify the component name <ECOMP-component-name>::= "MSO" | "DCAE" | "ASDC " | "AAI" |"Policy" | "SDNC" | "AC" --> <property name="componentName" value="Policy"></property> - <property name="subComponentName" value="XACML-PDP"></property> + <property name="subComponentName" value="ECOMP-PDP"></property> <!-- log file names --> <property name="errorLogName" value="error" /> @@ -205,7 +205,7 @@ <maxIndex>9</maxIndex> </rollingPolicy> <filter class="ch.qos.logback.classic.filter.ThresholdFilter"> - <level>INFO</level> + <level>DEBUG</level> </filter> <triggeringPolicy class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy"> |