summaryrefslogtreecommitdiffstats
path: root/common/onap-common-configuration-management/onap-configuration-management-core/src/test
diff options
context:
space:
mode:
authorvempo <vitaliy.emporopulo@amdocs.com>2018-10-31 10:27:59 +0200
committerAvi Gaffa <avi.gaffa@amdocs.com>2018-10-31 12:06:24 +0000
commit461e964344d01e245464980b6ace12e4b28569e6 (patch)
treeae9ddafa9e3437aec8a7cf56b37f79fae924f7d8 /common/onap-common-configuration-management/onap-configuration-management-core/src/test
parenteba6fee58790a1ffece980de44100b21764051ca (diff)
Removed JMX, other unused code from configuration
Removed code duplicates, stabilized test execution via Maven, re-aranged code, fixed spelling. Change-Id: I41fc303ea0a8c7d78d89a12bb20850de51cb8c52 Issue-ID: SDC-1867 Signed-off-by: vempo <vitaliy.emporopulo@amdocs.com>
Diffstat (limited to 'common/onap-common-configuration-management/onap-configuration-management-core/src/test')
-rw-r--r--common/onap-common-configuration-management/onap-configuration-management-core/src/test/java/org/onap/config/test/CliFallbackAndLookupTest.java12
-rw-r--r--common/onap-common-configuration-management/onap-configuration-management-core/src/test/java/org/onap/config/test/CliTest.java10
-rw-r--r--common/onap-common-configuration-management/onap-configuration-management-core/src/test/java/org/onap/config/test/NodeSpecificCliTest.java10
3 files changed, 6 insertions, 26 deletions
diff --git a/common/onap-common-configuration-management/onap-configuration-management-core/src/test/java/org/onap/config/test/CliFallbackAndLookupTest.java b/common/onap-common-configuration-management/onap-configuration-management-core/src/test/java/org/onap/config/test/CliFallbackAndLookupTest.java
index 48aecf4adc..0d9da6455f 100644
--- a/common/onap-common-configuration-management/onap-configuration-management-core/src/test/java/org/onap/config/test/CliFallbackAndLookupTest.java
+++ b/common/onap-common-configuration-management/onap-configuration-management-core/src/test/java/org/onap/config/test/CliFallbackAndLookupTest.java
@@ -17,18 +17,14 @@
package org.onap.config.test;
import java.io.IOException;
-import java.lang.management.ManagementFactory;
import java.util.HashMap;
import java.util.Map;
-import javax.management.JMX;
-import javax.management.MBeanServerConnection;
-import javax.management.ObjectName;
import org.junit.After;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
-import org.onap.config.Constants;
import org.onap.config.api.ConfigurationManager;
+import org.onap.config.impl.CliConfigurationImpl;
import org.onap.config.util.ConfigTestConstant;
import org.onap.config.util.TestUtil;
@@ -60,22 +56,18 @@ public class CliFallbackAndLookupTest {
input.put("namespace", NAMESPACE);
input.put("key", ConfigTestConstant.ARTIFACT_MAXSIZE);
- MBeanServerConnection mbsc = ManagementFactory.getPlatformMBeanServer();
- ObjectName mbeanName = new ObjectName(Constants.MBEAN_NAME);
- ConfigurationManager conf = JMX.newMBeanProxy(mbsc, mbeanName, ConfigurationManager.class, true);
+ ConfigurationManager conf = new CliConfigurationImpl();
String maxSizeWithNoFallback = conf.getConfigurationValue(input);
Assert.assertEquals("", maxSizeWithNoFallback);
//Verify underlying resource without lookup switch
input.put("key", ConfigTestConstant.ARTIFACT_JSON_SCHEMA);
String jsonSchema = conf.getConfigurationValue(input);
- System.out.println("jsonSchema==" + jsonSchema);
Assert.assertEquals("@" + System.getProperty("user.home") + "/TestResources/GeneratorsList.json", jsonSchema);
//Verify underlying resource with lookup switch
input.put("externalLookup", true);
jsonSchema = conf.getConfigurationValue(input);
- System.out.println("jsonSchema==" + jsonSchema);
Assert.assertEquals("{name:\"SCM\"}", jsonSchema);
//Verify with fallback
diff --git a/common/onap-common-configuration-management/onap-configuration-management-core/src/test/java/org/onap/config/test/CliTest.java b/common/onap-common-configuration-management/onap-configuration-management-core/src/test/java/org/onap/config/test/CliTest.java
index 18c136013c..4383124208 100644
--- a/common/onap-common-configuration-management/onap-configuration-management-core/src/test/java/org/onap/config/test/CliTest.java
+++ b/common/onap-common-configuration-management/onap-configuration-management-core/src/test/java/org/onap/config/test/CliTest.java
@@ -17,18 +17,14 @@
package org.onap.config.test;
import java.io.IOException;
-import java.lang.management.ManagementFactory;
import java.util.HashMap;
import java.util.Map;
-import javax.management.JMX;
-import javax.management.MBeanServerConnection;
-import javax.management.ObjectName;
import org.junit.After;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
-import org.onap.config.Constants;
import org.onap.config.api.ConfigurationManager;
+import org.onap.config.impl.CliConfigurationImpl;
import org.onap.config.util.ConfigTestConstant;
import org.onap.config.util.TestUtil;
@@ -57,9 +53,7 @@ public class CliTest {
input.put("namespace", NAMESPACE);
input.put("key", ConfigTestConstant.ARTIFACT_NAME_MAXLENGTH);
- MBeanServerConnection mbsc = ManagementFactory.getPlatformMBeanServer();
- ObjectName mbeanName = new ObjectName(Constants.MBEAN_NAME);
- ConfigurationManager conf = JMX.newMBeanProxy(mbsc, mbeanName, ConfigurationManager.class, true);
+ ConfigurationManager conf = new CliConfigurationImpl();
String maxLength = conf.getConfigurationValue(input);
Assert.assertEquals("14", maxLength);
diff --git a/common/onap-common-configuration-management/onap-configuration-management-core/src/test/java/org/onap/config/test/NodeSpecificCliTest.java b/common/onap-common-configuration-management/onap-configuration-management-core/src/test/java/org/onap/config/test/NodeSpecificCliTest.java
index 40807155b6..f61830c169 100644
--- a/common/onap-common-configuration-management/onap-configuration-management-core/src/test/java/org/onap/config/test/NodeSpecificCliTest.java
+++ b/common/onap-common-configuration-management/onap-configuration-management-core/src/test/java/org/onap/config/test/NodeSpecificCliTest.java
@@ -21,18 +21,14 @@ import static org.junit.Assert.assertTrue;
import java.io.File;
import java.io.FileOutputStream;
import java.io.OutputStream;
-import java.lang.management.ManagementFactory;
import java.util.HashMap;
import java.util.Map;
import java.util.Properties;
-import javax.management.JMX;
-import javax.management.MBeanServerConnection;
-import javax.management.ObjectName;
import org.junit.AfterClass;
import org.junit.Assert;
import org.junit.Test;
-import org.onap.config.Constants;
import org.onap.config.api.ConfigurationManager;
+import org.onap.config.impl.CliConfigurationImpl;
import org.onap.config.util.ConfigTestConstant;
import org.onap.config.util.TestUtil;
@@ -63,9 +59,7 @@ public class NodeSpecificCliTest {
input.put("namespace", NAMESPACE);
input.put("key", ConfigTestConstant.ARTIFACT_NAME_MAXLENGTH);
- MBeanServerConnection mbsc = ManagementFactory.getPlatformMBeanServer();
- ObjectName mbeanName = new ObjectName(Constants.MBEAN_NAME);
- ConfigurationManager conf = JMX.newMBeanProxy(mbsc, mbeanName, ConfigurationManager.class, true);
+ ConfigurationManager conf = new CliConfigurationImpl();
String maxLength = conf.getConfigurationValue(input);
//Verify Property from Namespace configurations