aboutsummaryrefslogtreecommitdiffstats
path: root/policy-utils/src/test
diff options
context:
space:
mode:
authorJorge Hernandez <jh1730@att.com>2017-06-22 17:17:28 -0500
committerJorge Hernandez <jh1730@att.com>2017-06-22 17:17:28 -0500
commit8f61e18ef0457745719f05bd5c186992a7155416 (patch)
tree884f4653f957a88a65ea981727dfe26494fb7c55 /policy-utils/src/test
parent3cc1a85a832771cb70ed9cbaab9031bc4a114308 (diff)
[POLICY-30] remove problematic layers
add configurability through telemetry API Change-Id: I77ebde12a417d421b98646c32dc74824f4494c2e Signed-off-by: Jorge Hernandez <jh1730@att.com>
Diffstat (limited to 'policy-utils/src/test')
-rw-r--r--policy-utils/src/test/java/org/openecomp/policy/drools/utils/PropertyUtilTest.java26
-rw-r--r--policy-utils/src/test/resources/log4j.properties26
2 files changed, 13 insertions, 39 deletions
diff --git a/policy-utils/src/test/java/org/openecomp/policy/drools/utils/PropertyUtilTest.java b/policy-utils/src/test/java/org/openecomp/policy/drools/utils/PropertyUtilTest.java
index 32386725..b45f1b45 100644
--- a/policy-utils/src/test/java/org/openecomp/policy/drools/utils/PropertyUtilTest.java
+++ b/policy-utils/src/test/java/org/openecomp/policy/drools/utils/PropertyUtilTest.java
@@ -34,12 +34,12 @@ import java.util.UUID;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test;
-import org.openecomp.policy.common.logging.eelf.PolicyLogger;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
public class PropertyUtilTest
{
- // private static final Logger PolicyLogger =
-// Logger.getLogger(PropertyUtilTest.class.getName());
+ private final static Logger logger = LoggerFactory.getLogger(PropertyUtilTest.class);
private static File directory = null;
@@ -49,7 +49,7 @@ public class PropertyUtilTest
@BeforeClass
static public void setup()
{
- PolicyLogger.info("setup: creating a temporary directory");
+ logger.info("setup: creating a temporary directory");
// create a directory for temporary files
directory = new File(UUID.randomUUID().toString());
@@ -62,7 +62,7 @@ public class PropertyUtilTest
@AfterClass
static public void teardown()
{
- PolicyLogger.info("teardown: remove the temporary directory");
+ logger.info("teardown: remove the temporary directory");
// the assumption is that we only have one level of temporary files
for (File file : directory.listFiles())
@@ -114,7 +114,7 @@ public class PropertyUtilTest
{
// When a notification is received, store the values in the
// 'returns' array, and signal using the same array.
- PolicyLogger.info("Listener invoked: properties=" + properties
+ logger.info("Listener invoked: properties=" + properties
+ ", changedKeys=" + changedKeys);
returns[0] = properties;
returns[1] = changedKeys;
@@ -132,15 +132,15 @@ public class PropertyUtilTest
@Test
public void testGetProperties() throws Exception
{
- PolicyLogger.info("testGetProperties: test the basic properties file interface");
+ logger.info("testGetProperties: test the basic properties file interface");
// copy system properties
- PolicyLogger.info("Copy system properties to a file");
+ logger.info("Copy system properties to a file");
Properties prop1 = System.getProperties();
File file1 = createFile("createAndReadPropertyFile-1", prop1);
// read in properties, and compare
- PolicyLogger.info("Read in properties from new file");
+ logger.info("Read in properties from new file");
Properties prop2 = PropertyUtil.getProperties(file1);
// they should match
@@ -153,14 +153,14 @@ public class PropertyUtilTest
@Test
public void testListenerInterface() throws Exception
{
- PolicyLogger.info("testListenerInterface: test receipt of dynamic updates");
+ logger.info("testListenerInterface: test receipt of dynamic updates");
// create initial property file
Properties prop1 = new Properties();
prop1.setProperty("p1", "p1 value");
prop1.setProperty("p2", "p2 value");
prop1.setProperty("p3", "p3 value");
- PolicyLogger.info("Create initial properties file: " + prop1);
+ logger.info("Create initial properties file: " + prop1);
File file1 = createFile("createAndReadPropertyFile-2", prop1);
// create a listener for the notification interface
@@ -169,7 +169,7 @@ public class PropertyUtilTest
// read it in, and do a comparison
Properties prop2 = PropertyUtil.getProperties(file1, listener);
- PolicyLogger.info("Read in properties: " + prop2);
+ logger.info("Read in properties: " + prop2);
assertEquals(prop1, prop2);
assertEquals(prop2.getProperty("p1"), "p1 value");
assertEquals(prop2.getProperty("p2"), "p2 value");
@@ -179,7 +179,7 @@ public class PropertyUtilTest
prop2.remove("p1"); // remove one property
prop2.setProperty("p2", "new p2 value"); // change one property
prop2.setProperty("p4", "p4 value"); // add a new property
- PolicyLogger.info("Modified properties: " + prop2);
+ logger.info("Modified properties: " + prop2);
// now, update the file, and wait for notification
synchronized(returns)
diff --git a/policy-utils/src/test/resources/log4j.properties b/policy-utils/src/test/resources/log4j.properties
deleted file mode 100644
index 0063f104..00000000
--- a/policy-utils/src/test/resources/log4j.properties
+++ /dev/null
@@ -1,26 +0,0 @@
-###
-# ============LICENSE_START=======================================================
-# policy-utils
-# ================================================================================
-# Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
-# ================================================================================
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-# ============LICENSE_END=========================================================
-###
-
-log4j.rootLogger=INFO, out
-
-# CONSOLE appender not used by default
-log4j.appender.out=org.apache.log4j.ConsoleAppender
-log4j.appender.out.layout=org.apache.log4j.PatternLayout
-log4j.appender.out.layout.ConversionPattern=%d %-5p %-30.30c{1} %4L - %m%n