aboutsummaryrefslogtreecommitdiffstats
path: root/applications
diff options
context:
space:
mode:
authorjh7358 <jh7358@att.com>2019-04-25 20:15:28 -0400
committerJim Hahn <jrh3@att.com>2019-04-26 17:16:27 -0400
commit05045cd36ad264b5d7b674155699b2cccee71165 (patch)
treef2651c9b19f09f7944339ab07fc706bc5d6cd8f3 /applications
parentc7beb45738209526a4794b3b72f0f0bd025d1a82 (diff)
Refactor xacml-pdp to remove various statics3.0.2-ONAP
Refactored xacml-pdp to eliminate a number of static fields. Modified junit tests to allocate new ports for each test. Also modified XacmlPolicyUtilsTest to convert path names to match the file system so that the junit will work in OSs other than linux. Replaced logback.xml with a copy of the one from PAP to resolve some issues. Don't print entire message when discarding, as each PDP receives messages for ALL PDPs. Remove shutdown class from Main - just invoke this.shutdown() directly. Added additional comments to CommonRest. Also modified port test parameters. Change-Id: Id8bf7216cdcb59a1a2cb4cb957fa44f640315cfe Issue-ID: POLICY-1645 Signed-off-by: Jim Hahn <jrh3@att.com>
Diffstat (limited to 'applications')
-rw-r--r--applications/common/src/test/java/org/onap/policy/pdp/xacml/application/common/XacmlPolicyUtilsTest.java13
1 files changed, 12 insertions, 1 deletions
diff --git a/applications/common/src/test/java/org/onap/policy/pdp/xacml/application/common/XacmlPolicyUtilsTest.java b/applications/common/src/test/java/org/onap/policy/pdp/xacml/application/common/XacmlPolicyUtilsTest.java
index ed63bb9c..318d9f9f 100644
--- a/applications/common/src/test/java/org/onap/policy/pdp/xacml/application/common/XacmlPolicyUtilsTest.java
+++ b/applications/common/src/test/java/org/onap/policy/pdp/xacml/application/common/XacmlPolicyUtilsTest.java
@@ -37,8 +37,9 @@ import java.io.OutputStream;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
+import java.util.List;
import java.util.Properties;
-
+import java.util.stream.Collectors;
import oasis.names.tc.xacml._3_0.core.schema.wd_17.AnyOfType;
import oasis.names.tc.xacml._3_0.core.schema.wd_17.EffectType;
import oasis.names.tc.xacml._3_0.core.schema.wd_17.MatchType;
@@ -109,6 +110,16 @@ public class XacmlPolicyUtilsTest {
properties.load(is);
}
//
+ // Change "/" to file separator in file names
+ //
+ if (!"/".equals(File.separator)) {
+ List<String> fileProps = properties.keySet().stream().map(Object::toString)
+ .filter(key -> key.endsWith(".file")).collect(Collectors.toList());
+ for (String fileProp : fileProps) {
+ properties.setProperty(fileProp, properties.getProperty(fileProp).replace("/", File.separator));
+ }
+ }
+ //
// Save root policy
//
File rootFile = policyFolder.newFile("root.xml");