diff options
author | mmis <michael.morris@ericsson.com> | 2018-02-27 14:05:23 +0000 |
---|---|---|
committer | mmis <michael.morris@ericsson.com> | 2018-02-27 17:39:15 +0000 |
commit | a969489e138c6fa44d468f05e8b27860c26c7578 (patch) | |
tree | 0f5e9b85d19572bb3761435d950fd0f9b9f4f403 /common-logging/src/main/java/org/onap/policy/common/logging/flexlogger/PropertyUtil.java | |
parent | cfb9b5f1cfe7d5c319312d8d067ae4c2a8d8d93c (diff) |
Added junit tests in ONAP-Logging
Added junit tests to org.onap.policy.common.logging.flexlogger package in ONAP-Logging
Issue-ID: POLICY-582
Change-Id: I024f990960fa71bff7655da9c2cd5dd0db8ee33c
Signed-off-by: mmis <michael.morris@ericsson.com>
Diffstat (limited to 'common-logging/src/main/java/org/onap/policy/common/logging/flexlogger/PropertyUtil.java')
-rw-r--r-- | common-logging/src/main/java/org/onap/policy/common/logging/flexlogger/PropertyUtil.java | 29 |
1 files changed, 6 insertions, 23 deletions
diff --git a/common-logging/src/main/java/org/onap/policy/common/logging/flexlogger/PropertyUtil.java b/common-logging/src/main/java/org/onap/policy/common/logging/flexlogger/PropertyUtil.java index 1bc57f01..86d119ea 100644 --- a/common-logging/src/main/java/org/onap/policy/common/logging/flexlogger/PropertyUtil.java +++ b/common-logging/src/main/java/org/onap/policy/common/logging/flexlogger/PropertyUtil.java @@ -362,12 +362,13 @@ public class PropertyUtil * @param file the properties file * @param notify if not null, this is a callback interface that was used for * notifications of changes + * @throws IOException */ - public static void stopListening(File file, Listener listener) + public static void stopListening(File file, Listener listener) throws IOException { if (listener != null) { - ListenerRegistration reg = registrations.get(file); + ListenerRegistration reg = registrations.get(file.getCanonicalFile()); if (reg != null) { reg.removeListener(listener); @@ -380,29 +381,11 @@ public class PropertyUtil * @param fileName the properties file * @param notify if not null, this is a callback interface that was used for * notifications of changes + * @throws IOException */ - public static void stopListening(String fileName, Listener listener) + public static void stopListening(String fileName, Listener listener) throws IOException { stopListening(new File(fileName), listener); } - - /* ============================================================ */ - - // TEMPORARY - used to test callback interface - public static class Test implements Listener - { - String name; - - public Test(String name) - { - this.name = name; - } - - @Override - public void propertiesChanged(Properties properties, Set<String> changedKeys) - { - System.out.println("Test(" + name + ")\nproperties = " + properties - + "\nchangedKeys = " + changedKeys); - } - } + } |