summaryrefslogtreecommitdiffstats
path: root/ecomp-sdk/epsdk-analytics/src/test/java/org/onap/portalsdk
diff options
context:
space:
mode:
Diffstat (limited to 'ecomp-sdk/epsdk-analytics/src/test/java/org/onap/portalsdk')
-rw-r--r--ecomp-sdk/epsdk-analytics/src/test/java/org/onap/portalsdk/analytics/controller/WizardProcessorTest.java12
-rw-r--r--ecomp-sdk/epsdk-analytics/src/test/java/org/onap/portalsdk/analytics/gmap/line/LineInfoTest.java8
-rw-r--r--ecomp-sdk/epsdk-analytics/src/test/java/org/onap/portalsdk/analytics/gmap/map/ColorPropertiesTest.java6
-rw-r--r--ecomp-sdk/epsdk-analytics/src/test/java/org/onap/portalsdk/analytics/system/fusion/adapter/FusionAdapterTest.java10
-rw-r--r--ecomp-sdk/epsdk-analytics/src/test/java/org/onap/portalsdk/analytics/util/ExcelColorDefTest.java64
5 files changed, 93 insertions, 7 deletions
diff --git a/ecomp-sdk/epsdk-analytics/src/test/java/org/onap/portalsdk/analytics/controller/WizardProcessorTest.java b/ecomp-sdk/epsdk-analytics/src/test/java/org/onap/portalsdk/analytics/controller/WizardProcessorTest.java
index 52e0b1a1..7cfacadd 100644
--- a/ecomp-sdk/epsdk-analytics/src/test/java/org/onap/portalsdk/analytics/controller/WizardProcessorTest.java
+++ b/ecomp-sdk/epsdk-analytics/src/test/java/org/onap/portalsdk/analytics/controller/WizardProcessorTest.java
@@ -1,9 +1,9 @@
/*
- * ============LICENSE_START==========================================
+ * ============LICENSE_START==============================================
* ONAP Portal SDK
- * ===================================================================
- * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
- * ===================================================================
+ * =======================================================================
+ * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved.
+ * =======================================================================
*
* Unless otherwise specified, all software contained herein is licensed
* under the Apache License, Version 2.0 (the "License");
@@ -31,7 +31,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*
- * ============LICENSE_END============================================
+ * ============LICENSE_END================================================
*
*
*/
@@ -412,7 +412,7 @@ public class WizardProcessorTest {
mockHttpAttribute("hideExcelIcons","N");
mockHttpAttribute("hidePDFIcons","N");
- mockHttpAttribute("dataSource","org.att.onap.DataSource");
+ mockHttpAttribute("dataSource","org.onap.DataSource");
mockHttpAttribute("numFormCols","10");
mockHttpAttribute("reportTitle","ONAP Portal User Report");
diff --git a/ecomp-sdk/epsdk-analytics/src/test/java/org/onap/portalsdk/analytics/gmap/line/LineInfoTest.java b/ecomp-sdk/epsdk-analytics/src/test/java/org/onap/portalsdk/analytics/gmap/line/LineInfoTest.java
index 5ff6e78b..f9a5ee2d 100644
--- a/ecomp-sdk/epsdk-analytics/src/test/java/org/onap/portalsdk/analytics/gmap/line/LineInfoTest.java
+++ b/ecomp-sdk/epsdk-analytics/src/test/java/org/onap/portalsdk/analytics/gmap/line/LineInfoTest.java
@@ -114,4 +114,12 @@ public class LineInfoTest {
assertEquals("length", list.get(0));
}
+ @Test
+ public void getAttributeKeysTest() throws Exception {
+ Map<String, String> lineAttributes1 = new HashMap<>();
+ lineAttributes1.put("length", "200cm");
+ lineInfo.initializeAttributes(lineAttributes1);
+ List<String> list = lineInfo.getAttributeKeys();
+ assertEquals("length", list.get(0));
+ }
}
diff --git a/ecomp-sdk/epsdk-analytics/src/test/java/org/onap/portalsdk/analytics/gmap/map/ColorPropertiesTest.java b/ecomp-sdk/epsdk-analytics/src/test/java/org/onap/portalsdk/analytics/gmap/map/ColorPropertiesTest.java
index 07d9a926..b6dc00e4 100644
--- a/ecomp-sdk/epsdk-analytics/src/test/java/org/onap/portalsdk/analytics/gmap/map/ColorPropertiesTest.java
+++ b/ecomp-sdk/epsdk-analytics/src/test/java/org/onap/portalsdk/analytics/gmap/map/ColorPropertiesTest.java
@@ -61,6 +61,7 @@ public class ColorPropertiesTest {
colorProperties.setColor(TYPE, COLOR);
colorProperties.setShape(TYPE, SHAPE);
colorProperties.setSize(TYPE, SIZE);
+ colorProperties.setSize(TYPE, NUMBER, SIZE);
colorProperties.setShape(TYPE, NUMBER, SHAPE);
}
@@ -90,4 +91,9 @@ public class ColorPropertiesTest {
public void testGetSize() {
assertEquals(100, colorProperties.getSize(TYPE));
}
+
+ @Test
+ public void testGetSizeWithNumber() {
+ assertEquals(100, colorProperties.getSize(TYPE, NUMBER));
+ }
}
diff --git a/ecomp-sdk/epsdk-analytics/src/test/java/org/onap/portalsdk/analytics/system/fusion/adapter/FusionAdapterTest.java b/ecomp-sdk/epsdk-analytics/src/test/java/org/onap/portalsdk/analytics/system/fusion/adapter/FusionAdapterTest.java
index 27bd839b..4600ac89 100644
--- a/ecomp-sdk/epsdk-analytics/src/test/java/org/onap/portalsdk/analytics/system/fusion/adapter/FusionAdapterTest.java
+++ b/ecomp-sdk/epsdk-analytics/src/test/java/org/onap/portalsdk/analytics/system/fusion/adapter/FusionAdapterTest.java
@@ -45,8 +45,10 @@ public class FusionAdapterTest {
FusionAdapter fa=new FusionAdapter();
ComboPooledDataSource dataSource;
- Map<String,ComboPooledDataSource> dataSourceMap;
+ Map<String,ComboPooledDataSource> dataSourceMap;
ServletContext servletContext;
+
+
@Test
public void test() {
fa.setDataSource(dataSource);
@@ -55,4 +57,10 @@ public class FusionAdapterTest {
assertEquals(fa.getDataSource(), dataSource);
assertEquals(fa.getServletContext(), servletContext);
}
+
+ @Test
+ public void releaseConnectionTest() throws Exception{
+ fa.releaseConnection(null);
+ }
+
}
diff --git a/ecomp-sdk/epsdk-analytics/src/test/java/org/onap/portalsdk/analytics/util/ExcelColorDefTest.java b/ecomp-sdk/epsdk-analytics/src/test/java/org/onap/portalsdk/analytics/util/ExcelColorDefTest.java
new file mode 100644
index 00000000..dcc05976
--- /dev/null
+++ b/ecomp-sdk/epsdk-analytics/src/test/java/org/onap/portalsdk/analytics/util/ExcelColorDefTest.java
@@ -0,0 +1,64 @@
+/*
+ * ============LICENSE_START==========================================
+ * ONAP Portal SDK
+ * ===================================================================
+ * Copyright © 2018 IBM Intellectual Property. All rights reserved.
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the "License");
+ * you may not use this software 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.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the "License");
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * 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============================================
+ *
+ *
+ */
+
+package org.onap.portalsdk.analytics.util;
+
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.mockito.Mockito;
+import org.powermock.core.classloader.annotations.PrepareForTest;
+import org.powermock.modules.junit4.PowerMockRunner;
+
+import static org.junit.Assert.assertNotNull;
+
+@RunWith(PowerMockRunner.class)
+@PrepareForTest({ExcelColorDef.class})
+public class ExcelColorDefTest{
+
+ @Before
+ public void setUp(){
+ ExcelColorDef.initializeExcelColorDef();
+ }
+
+ @Test
+ public void getExcelColorTest(){
+ assertNotNull(ExcelColorDef.getExcelColor("#FFFF00"));
+ assertNotNull(ExcelColorDef.getExcelColor(Mockito.anyString()));
+ }
+}