summaryrefslogtreecommitdiffstats
path: root/ecomp-sdk
diff options
context:
space:
mode:
authorManoop Talasila <talasila@research.att.com>2018-09-25 19:10:02 +0000
committerGerrit Code Review <gerrit@onap.org>2018-09-25 19:10:02 +0000
commitafb7e4d6b9895146d5d7e27a7568a6360ca50ce3 (patch)
treeebbc30172b6b10a1e189154b07da2b27befd8837 /ecomp-sdk
parent7f6b5cceb6985382d4c8e28156d2a80da71f0110 (diff)
parent87eecba5274527b3cf0e09034bc12851e4eeacaf (diff)
Merge "added test cases to DataRowTest.java"
Diffstat (limited to 'ecomp-sdk')
-rw-r--r--ecomp-sdk/epsdk-analytics/src/test/java/org/onap/portalsdk/analytics/view/DataRowTest.java56
1 files changed, 40 insertions, 16 deletions
diff --git a/ecomp-sdk/epsdk-analytics/src/test/java/org/onap/portalsdk/analytics/view/DataRowTest.java b/ecomp-sdk/epsdk-analytics/src/test/java/org/onap/portalsdk/analytics/view/DataRowTest.java
index 3d20683e..69bf9528 100644
--- a/ecomp-sdk/epsdk-analytics/src/test/java/org/onap/portalsdk/analytics/view/DataRowTest.java
+++ b/ecomp-sdk/epsdk-analytics/src/test/java/org/onap/portalsdk/analytics/view/DataRowTest.java
@@ -4,6 +4,8 @@
* ===================================================================
* Copyright © 2017 AT&T Intellectual Property. All rights reserved.
* ===================================================================
+ * Modifications Copyright © 2018 IBM.
+ * ===================================================================
*
* Unless otherwise specified, all software contained herein is licensed
* under the Apache License, Version 2.0 (the "License");
@@ -41,25 +43,47 @@ import static org.junit.Assert.*;
import java.util.Vector;
+import org.junit.Before;
import org.junit.Test;
public class DataRowTest {
+ private DataRow dataRow;
+ private Vector vc;
+ @Before
+ public void setUp()
+ {
+ dataRow = new DataRow();
- @Test
- public void mockDataRowTest() {
- DataRow dataRow = new DataRow();
+ DataValue dataValue = new DataValue();
+ dataRow.setRowFormat(false);
+ HtmlFormatter formatter = new HtmlFormatter();
+ dataRow.setRowFormatter(formatter);
+ dataRow.setRowNum(1);
+ vc = new Vector<>();
+ vc.add(dataRow);
+ dataRow.setRowValues(vc);
+ dataRow.setFormatId("test");
+ }
- DataValue dataValue = new DataValue();
- dataRow.setRowFormat(false);
- HtmlFormatter formatter = new HtmlFormatter();
- dataRow.setRowFormatter(formatter);
- dataRow.setRowNum(1);
- Vector vc = new Vector<>();
- vc.add(dataRow);
- dataRow.setRowValues(vc);
- dataRow.setFormatId("test");
- assertEquals(dataRow.getFormatId(), "test");
- assertEquals(dataRow.getRowNum(), 1);
- assertEquals(dataRow.getRowValues(), vc);
- }
+ @Test
+ public void mockDataRowTest() {
+
+ assertEquals(dataRow.getFormatId(), "test");
+ assertEquals(dataRow.getRowNum(), 1);
+ assertEquals(dataRow.getRowValues(), vc);
+ }
+
+ @Test
+ public void testGetBgColorHtml() {
+
+ String s=dataRow.getBgColorHtml();
+ assertNotNull(s);
+ }
+
+ @Test
+ public void testGetDataValue()
+ {
+ String s=dataRow.getDataValue("testColId");
+ assertNull(s);
+ }
}