5eb7539054b18d281673aa2596bcfd4785bbceab
[portal/sdk.git] /
1 /*
2  * ============LICENSE_START==========================================
3  * ONAP Portal SDK
4  * ===================================================================
5  * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
6  * ===================================================================
7  *
8  * Unless otherwise specified, all software contained herein is licensed
9  * under the Apache License, Version 2.0 (the "License");
10  * you may not use this software except in compliance with the License.
11  * You may obtain a copy of the License at
12  *
13  *             http://www.apache.org/licenses/LICENSE-2.0
14  *
15  * Unless required by applicable law or agreed to in writing, software
16  * distributed under the License is distributed on an "AS IS" BASIS,
17  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18  * See the License for the specific language governing permissions and
19  * limitations under the License.
20  *
21  * Unless otherwise specified, all documentation contained herein is licensed
22  * under the Creative Commons License, Attribution 4.0 Intl. (the "License");
23  * you may not use this documentation except in compliance with the License.
24  * You may obtain a copy of the License at
25  *
26  *             https://creativecommons.org/licenses/by/4.0/
27  *
28  * Unless required by applicable law or agreed to in writing, documentation
29  * distributed under the License is distributed on an "AS IS" BASIS,
30  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
31  * See the License for the specific language governing permissions and
32  * limitations under the License.
33  *
34  * ============LICENSE_END============================================
35  *
36  * ECOMP is a trademark and service mark of AT&T Intellectual Property.
37  */
38 package org.onap.portalsdk.analytics.model.definition.wizard;
39
40 import static org.junit.Assert.assertEquals;
41 import static org.junit.Assert.assertFalse;
42 import static org.junit.Assert.assertNull;
43 import static org.junit.Assert.assertTrue;
44
45 import org.junit.Test;
46
47 public class DefinitionJSONTest {
48    
49         public DefinitionJSON mockDefinitionJSONTest()
50         {
51                 DefinitionJSON definitionJSON= new DefinitionJSON();
52                 definitionJSON.setTabName("tabName");
53                 definitionJSON.setTabId("tabId");
54                 definitionJSON.setReportId("reportId");
55                 definitionJSON.setReportName("reportName");
56                 definitionJSON.setReportDescr("reportDescr");
57                 definitionJSON.setReportType("reportType");
58                 definitionJSON.setDbInfo("dbInfo");
59                 definitionJSON.setFormHelpText("formHelpText");
60                 definitionJSON.setPageSize(null);
61                 definitionJSON.setDisplayArea(null);
62                 definitionJSON.setHideFormFieldsAfterRun(false);
63                 definitionJSON.setMaxRowsInExcelCSVDownload(1);
64                 definitionJSON.setFrozenColumns(1);
65                 definitionJSON.setDataGridAlign("dataGridAlign");
66                 definitionJSON.setEmptyMessage("emptyMessage");
67                 definitionJSON.setDataContainerHeight("dataContainerHeight");
68                 definitionJSON.setDataContainerWidth("dataContainerWidth");
69                 definitionJSON.setDisplayOptions(null);
70                 definitionJSON.setRuntimeColSortDisabled(false);
71                 definitionJSON.setNumFormCols(1);
72                 definitionJSON.setReportTitle("title");
73                 definitionJSON.setReportSubTitle("reportSubTitle");
74                 return definitionJSON;
75         }
76     @Test
77         public void definitionJSONTest()
78         {
79                 DefinitionJSON definitionJSON = mockDefinitionJSONTest();
80                 assertEquals(definitionJSON.getTabName(),"tabName");
81                 assertEquals(definitionJSON.getTabId(),"tabId");
82                 assertEquals(definitionJSON.getReportId(),"reportId");
83                 assertEquals(definitionJSON.getReportName(),"reportName");
84                 assertEquals(definitionJSON.getReportDescr(),"reportDescr");
85                 assertEquals(definitionJSON.getReportType(),"reportType");
86                 assertEquals(definitionJSON.getDbInfo(),"dbInfo");
87                 assertEquals(definitionJSON.getFormHelpText(),"formHelpText");
88                 assertNull(definitionJSON.getPageSize());
89                 assertNull(definitionJSON.getDisplayArea());
90                 assertFalse(definitionJSON.getHideFormFieldsAfterRun());
91                 assertTrue(definitionJSON.getMaxRowsInExcelCSVDownload() == 1);
92                 assertTrue(definitionJSON.getFrozenColumns()== 1);
93                 assertEquals(definitionJSON.getDataGridAlign(),"dataGridAlign");
94                 assertEquals(definitionJSON.getEmptyMessage(),"emptyMessage");
95                 assertEquals(definitionJSON.getDataContainerHeight(),"dataContainerHeight");
96                 assertEquals(definitionJSON.getDataContainerWidth(),"dataContainerWidth");
97                 assertNull(definitionJSON.getDisplayOptions());
98                 assertFalse(definitionJSON.getRuntimeColSortDisabled());
99                 assertTrue(definitionJSON.getNumFormCols()== 1);
100                 assertEquals(definitionJSON.getReportTitle(),"title");
101                 assertEquals(definitionJSON.getReportSubTitle(),"reportSubTitle");
102                 
103         }
104 }