From b1eff0514fe117cb1fef666c10f516f5b9ac95e2 Mon Sep 17 00:00:00 2001 From: Sandeep J Date: Wed, 26 Sep 2018 17:07:23 +0530 Subject: added test cases to RowHeaderColTest to increase code coverage Issue-ID: PORTAL-273 Change-Id: I9d556757af86ac039caa3ccf9874d176d8808a7f Signed-off-by: Sandeep J --- .../portalsdk/analytics/view/RowHeaderColTest.java | 63 ++++++++++++---------- 1 file changed, 36 insertions(+), 27 deletions(-) (limited to 'ecomp-sdk/epsdk-analytics/src/test/java') diff --git a/ecomp-sdk/epsdk-analytics/src/test/java/org/onap/portalsdk/analytics/view/RowHeaderColTest.java b/ecomp-sdk/epsdk-analytics/src/test/java/org/onap/portalsdk/analytics/view/RowHeaderColTest.java index 180abf02..932a4e75 100644 --- a/ecomp-sdk/epsdk-analytics/src/test/java/org/onap/portalsdk/analytics/view/RowHeaderColTest.java +++ b/ecomp-sdk/epsdk-analytics/src/test/java/org/onap/portalsdk/analytics/view/RowHeaderColTest.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"); @@ -35,6 +37,7 @@ * * */ + package org.onap.portalsdk.analytics.view; import static org.junit.Assert.*; @@ -43,33 +46,39 @@ import org.junit.Test; public class RowHeaderColTest { - @Test - public void mockRowHeaderColTest() { - RowHeaderCol rowHeaderCol = new RowHeaderCol(); - rowHeaderCol.setColumnTitle("columnTitle"); - rowHeaderCol.setColumnWidth("columnWidth"); - rowHeaderCol.setAlignment("alignment"); - rowHeaderCol.setColId("colId"); - rowHeaderCol.setDisplayHeaderAlignment(null); - assertNull(rowHeaderCol.getDisplayHeaderAlignment()); - assertEquals(rowHeaderCol.getColId(), "colId"); - assertEquals(rowHeaderCol.getColumnTitle(), "columnTitle"); - assertEquals(rowHeaderCol.getColumnWidth(), "columnWidth"); - assertEquals(rowHeaderCol.getAlignment(), "alignment"); - assertEquals(rowHeaderCol.getColumnTitleHtml(), "columnTitle"); - assertEquals(rowHeaderCol.getColumnWidthHtml(), " width=columnWidth"); - assertEquals(rowHeaderCol.getAlignmentHtml(), " align=alignment"); - rowHeaderCol.resetNext(); - RowHeader rowHeader = new RowHeader(); - rowHeaderCol.addRowHeader(rowHeader); - rowHeaderCol.addRowHeader(1, rowHeader); - rowHeaderCol.setColumnTitle(""); - rowHeaderCol.setColumnWidth(""); - rowHeaderCol.setAlignment(""); - assertEquals(rowHeaderCol.getColumnTitleHtml(), " "); - assertEquals(rowHeaderCol.getColumnWidthHtml(), ""); - assertEquals(rowHeaderCol.getAlignmentHtml(), " align=center"); + @Test + public void mockRowHeaderColTest() { + RowHeaderCol rowHeaderCol = new RowHeaderCol(); + rowHeaderCol.setColumnTitle("columnTitle"); + rowHeaderCol.setColumnWidth("columnWidth"); + rowHeaderCol.setAlignment("alignment"); + rowHeaderCol.setColId("colId"); + rowHeaderCol.setDisplayHeaderAlignment(null); + rowHeaderCol.setNowrap("noWrap"); + rowHeaderCol.setVisible(true); + assertEquals("noWrap", rowHeaderCol.getNowrap()); + assertEquals(true, rowHeaderCol.isVisible()); + assertNull(rowHeaderCol.getDisplayHeaderAlignment()); + assertEquals(rowHeaderCol.getColId(), "colId"); + assertEquals(rowHeaderCol.getColumnTitle(), "columnTitle"); + assertEquals(rowHeaderCol.getColumnWidth(), "columnWidth"); + assertEquals(rowHeaderCol.getAlignment(), "alignment"); + assertEquals(rowHeaderCol.getColumnTitleHtml(), "columnTitle"); + assertEquals(rowHeaderCol.getColumnWidthHtml(), " width=columnWidth"); + assertEquals(rowHeaderCol.getAlignmentHtml(), " align=alignment"); + rowHeaderCol.resetNext(); + RowHeader rowHeader = new RowHeader(); + rowHeaderCol.addRowHeader(rowHeader); + rowHeaderCol.addRowHeader(1, rowHeader); + rowHeaderCol.setColumnTitle(""); + rowHeaderCol.setColumnWidth(""); + rowHeaderCol.setAlignment(""); + assertTrue(rowHeaderCol.hasNext()); + assertNotNull(rowHeaderCol.getNext()); + assertEquals(rowHeaderCol.getColumnTitleHtml(), " "); + assertEquals(rowHeaderCol.getColumnWidthHtml(), ""); + assertEquals(rowHeaderCol.getAlignmentHtml(), " align=center"); - } + } } -- cgit 1.2.3-korg