0d61728866295bc8c36245a94b8db9b8ecd64508
[portal/sdk.git] /
1
2 /*
3  * ============LICENSE_START==========================================
4  * ONAP Portal SDK
5  * ===================================================================
6  * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
7  * ===================================================================
8  *
9  * Unless otherwise specified, all software contained herein is licensed
10  * under the Apache License, Version 2.0 (the "License");
11  * you may not use this software except in compliance with the License.
12  * You may obtain a copy of the License at
13  *
14  *             http://www.apache.org/licenses/LICENSE-2.0
15  *
16  * Unless required by applicable law or agreed to in writing, software
17  * distributed under the License is distributed on an "AS IS" BASIS,
18  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19  * See the License for the specific language governing permissions and
20  * limitations under the License.
21  *
22  * Unless otherwise specified, all documentation contained herein is licensed
23  * under the Creative Commons License, Attribution 4.0 Intl. (the "License");
24  * you may not use this documentation except in compliance with the License.
25  * You may obtain a copy of the License at
26  *
27  *             https://creativecommons.org/licenses/by/4.0/
28  *
29  * Unless required by applicable law or agreed to in writing, documentation
30  * distributed under the License is distributed on an "AS IS" BASIS,
31  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
32  * See the License for the specific language governing permissions and
33  * limitations under the License.
34  *
35  * ============LICENSE_END============================================
36  *
37  * ECOMP is a trademark and service mark of AT&T Intellectual Property.
38  */
39
40 package org.onap.portalsdk.analytics.xmlobj;
41
42 import static org.junit.Assert.*;
43
44 import javax.xml.bind.annotation.XmlElement;
45
46 import org.junit.Test;
47 import org.onap.portalsdk.analytics.xmlobj.ChartAdditionalOptions;
48
49 public class ChartAdditionalOptionsTest {
50
51         @XmlElement(defaultValue = "false")
52         protected Boolean showXAxisLabel;
53         @XmlElement(defaultValue = "false")
54         protected Boolean addXAxisTickers;
55         protected Integer zoomIn;
56         protected String timeAxisType;
57         @XmlElement(defaultValue = "false")
58         protected Boolean logScale;
59         protected Integer topMargin;
60         protected Integer bottomMargin;
61         protected Integer rightMargin;
62         protected Integer leftMargin;
63
64         public ChartAdditionalOptions mockChartAdditionalOptions() {
65                 ChartAdditionalOptions chartAdditionalOptions = new ChartAdditionalOptions();
66                 chartAdditionalOptions.setChartMultiplePieOrder("test");
67                 chartAdditionalOptions.setChartMultiplePieLabelDisplay("test");
68                 chartAdditionalOptions.setChartOrientation("test");
69                 chartAdditionalOptions.setSecondaryChartRenderer("test");
70                 chartAdditionalOptions.setChartDisplay("test");
71                 chartAdditionalOptions.setHideToolTips("test");
72                 chartAdditionalOptions.setHidechartLegend("test");
73                 chartAdditionalOptions.setLegendPosition("test");
74                 chartAdditionalOptions.setLabelAngle("test");
75                 chartAdditionalOptions.setIntervalFromdate("test");
76                 chartAdditionalOptions.setIntervalTodate("test");
77                 chartAdditionalOptions.setIntervalLabel("test");
78                 chartAdditionalOptions.setLastSeriesALineChart("test");
79                 chartAdditionalOptions.setLastSeriesABarChart("test");
80                 chartAdditionalOptions.setMaxLabelsInDomainAxis("test");
81                 chartAdditionalOptions.setLinearRegression("test");
82                 chartAdditionalOptions.setLinearRegressionColor("test");
83                 chartAdditionalOptions.setExponentialRegressionColor("test");
84                 chartAdditionalOptions.setMaxRegression("test");
85                 chartAdditionalOptions.setRangeAxisUpperLimit(null);
86                 chartAdditionalOptions.setRangeAxisLowerLimit(null);
87                 chartAdditionalOptions.setOverlayItemValueOnStackBar("test");
88                 chartAdditionalOptions.setAnimate(false);
89                 chartAdditionalOptions.setAnimateAnimatedChart(false);
90                 chartAdditionalOptions.setKeepDomainAxisValueAsString("test");
91                 chartAdditionalOptions.setStacked(false);
92                 chartAdditionalOptions.setBarControls(false);
93                 chartAdditionalOptions.setXAxisDateType(false);
94                 chartAdditionalOptions.setLessXaxisTickers(false);
95                 chartAdditionalOptions.setMultiSeries(false);
96                 chartAdditionalOptions.setShowXAxisLabel(false);
97                 chartAdditionalOptions.setAddXAxisTickers(false);
98                 chartAdditionalOptions.setZoomIn(1);
99                 chartAdditionalOptions.setTimeAxisType("test");
100                 chartAdditionalOptions.setLogScale(false);
101                 chartAdditionalOptions.setTopMargin(1);
102                 chartAdditionalOptions.setBottomMargin(1);
103                 chartAdditionalOptions.setRightMargin(1);
104                 chartAdditionalOptions.setLeftMargin(1);
105                 chartAdditionalOptions.setTimeAxis(false);
106                 chartAdditionalOptions.setTimeSeriesRender("test");
107                 return chartAdditionalOptions;
108
109         }
110
111         @Test
112         public void chartAdditionalOptionsTest() {
113                 ChartAdditionalOptions chartAdditionalOptions1 = mockChartAdditionalOptions();
114                 ChartAdditionalOptions chartAdditionalOptions = new ChartAdditionalOptions();
115                 chartAdditionalOptions.setChartMultiplePieOrder("test");
116                 chartAdditionalOptions.setChartMultiplePieLabelDisplay("test");
117                 chartAdditionalOptions.setChartOrientation("test");
118                 chartAdditionalOptions.setSecondaryChartRenderer("test");
119                 chartAdditionalOptions.setChartDisplay("test");
120                 chartAdditionalOptions.setHideToolTips("test");
121                 chartAdditionalOptions.setHidechartLegend("test");
122                 chartAdditionalOptions.setLegendPosition("test");
123                 chartAdditionalOptions.setLabelAngle("test");
124                 chartAdditionalOptions.setIntervalFromdate("test");
125                 chartAdditionalOptions.setIntervalTodate("test");
126                 chartAdditionalOptions.setIntervalLabel("test");
127                 chartAdditionalOptions.setLastSeriesALineChart("test");
128                 chartAdditionalOptions.setLastSeriesABarChart("test");
129                 chartAdditionalOptions.setMaxLabelsInDomainAxis("test");
130                 chartAdditionalOptions.setLinearRegression("test");
131                 chartAdditionalOptions.setLinearRegressionColor("test");
132                 chartAdditionalOptions.setExponentialRegressionColor("test");
133                 chartAdditionalOptions.setMaxRegression("test");
134                 chartAdditionalOptions.setRangeAxisUpperLimit(null);
135                 chartAdditionalOptions.setRangeAxisLowerLimit(null);
136                 chartAdditionalOptions.setOverlayItemValueOnStackBar("test");
137                 chartAdditionalOptions.setAnimate(false);
138                 chartAdditionalOptions.setAnimateAnimatedChart(false);
139                 chartAdditionalOptions.setKeepDomainAxisValueAsString("test");
140                 chartAdditionalOptions.setStacked(false);
141                 chartAdditionalOptions.setBarControls(false);
142                 chartAdditionalOptions.setXAxisDateType(false);
143                 chartAdditionalOptions.setLessXaxisTickers(false);
144                 chartAdditionalOptions.setMultiSeries(false);
145                 chartAdditionalOptions.setShowXAxisLabel(false);
146                 chartAdditionalOptions.setAddXAxisTickers(false);
147                 chartAdditionalOptions.setZoomIn(1);
148                 chartAdditionalOptions.setTimeAxisType("test");
149                 chartAdditionalOptions.setLogScale(false);
150                 chartAdditionalOptions.setTopMargin(1);
151                 chartAdditionalOptions.setBottomMargin(1);
152                 chartAdditionalOptions.setRightMargin(1);
153                 chartAdditionalOptions.setLeftMargin(1);
154                 chartAdditionalOptions.setTimeAxis(false);
155                 chartAdditionalOptions.setTimeSeriesRender("test");
156
157                 assertEquals(chartAdditionalOptions.getChartMultiplePieOrder(),
158                                 chartAdditionalOptions1.getChartMultiplePieOrder());
159                 assertEquals(chartAdditionalOptions.getChartMultiplePieLabelDisplay(),
160                                 chartAdditionalOptions1.getChartMultiplePieLabelDisplay());
161                 assertEquals(chartAdditionalOptions.getChartOrientation(), chartAdditionalOptions1.getChartOrientation());
162                 assertEquals(chartAdditionalOptions.getSecondaryChartRenderer(),
163                                 chartAdditionalOptions1.getSecondaryChartRenderer());
164                 assertEquals(chartAdditionalOptions.getChartDisplay(), chartAdditionalOptions1.getChartDisplay());
165                 assertEquals(chartAdditionalOptions.getHideToolTips(), chartAdditionalOptions1.getHideToolTips());
166                 assertEquals(chartAdditionalOptions.getHidechartLegend(), chartAdditionalOptions1.getHidechartLegend());
167                 assertEquals(chartAdditionalOptions.getLegendPosition(), chartAdditionalOptions1.getLegendPosition());
168                 assertEquals(chartAdditionalOptions.getLabelAngle(), chartAdditionalOptions1.getLabelAngle());
169                 assertEquals(chartAdditionalOptions.getIntervalFromdate(), chartAdditionalOptions1.getIntervalFromdate());
170                 assertEquals(chartAdditionalOptions.getIntervalTodate(), chartAdditionalOptions1.getIntervalTodate());
171                 assertEquals(chartAdditionalOptions.getIntervalLabel(), chartAdditionalOptions1.getIntervalLabel());
172                 assertEquals(chartAdditionalOptions.getLastSeriesALineChart(),
173                                 chartAdditionalOptions1.getLastSeriesALineChart());
174                 assertEquals(chartAdditionalOptions.getLastSeriesABarChart(), chartAdditionalOptions1.getLastSeriesABarChart());
175                 assertEquals(chartAdditionalOptions.getMaxLabelsInDomainAxis(),
176                                 chartAdditionalOptions1.getMaxLabelsInDomainAxis());
177                 assertEquals(chartAdditionalOptions.getLinearRegression(), chartAdditionalOptions1.getLinearRegression());
178                 assertEquals(chartAdditionalOptions.getExponentialRegressionColor(),
179                                 chartAdditionalOptions1.getExponentialRegressionColor());
180                 assertEquals(chartAdditionalOptions.getMaxRegression(), chartAdditionalOptions1.getMaxRegression());
181                 assertEquals(chartAdditionalOptions.getRangeAxisUpperLimit(), chartAdditionalOptions1.getRangeAxisUpperLimit());
182                 assertEquals(chartAdditionalOptions.getRangeAxisLowerLimit(), chartAdditionalOptions1.getRangeAxisLowerLimit());
183                 assertEquals(chartAdditionalOptions.getOverlayItemValueOnStackBar(),
184                                 chartAdditionalOptions1.getOverlayItemValueOnStackBar());
185                 assertEquals(chartAdditionalOptions.isAnimate(), chartAdditionalOptions1.isAnimate());
186                 assertEquals(chartAdditionalOptions.isAnimateAnimatedChart(), chartAdditionalOptions1.isAnimateAnimatedChart());
187                 assertEquals(chartAdditionalOptions.getKeepDomainAxisValueAsString(),
188                                 chartAdditionalOptions1.getKeepDomainAxisValueAsString());
189                 assertEquals(chartAdditionalOptions.isStacked(), chartAdditionalOptions1.isStacked());
190                 assertEquals(chartAdditionalOptions.isBarControls(), chartAdditionalOptions1.isBarControls());
191                 assertEquals(chartAdditionalOptions.isXAxisDateType(), chartAdditionalOptions1.isXAxisDateType());
192                 assertEquals(chartAdditionalOptions.isLessXaxisTickers(), chartAdditionalOptions1.isLessXaxisTickers());
193                 assertEquals(chartAdditionalOptions.isMultiSeries(), chartAdditionalOptions1.isMultiSeries());
194                 assertEquals(chartAdditionalOptions.isShowXAxisLabel(), chartAdditionalOptions1.isShowXAxisLabel());
195                 assertEquals(chartAdditionalOptions.isAddXAxisTickers(), chartAdditionalOptions1.isAddXAxisTickers());
196                 assertEquals(chartAdditionalOptions.getZoomIn(), chartAdditionalOptions1.getZoomIn());
197                 assertEquals(chartAdditionalOptions.getTimeAxisType(), chartAdditionalOptions1.getTimeAxisType());
198                 assertEquals(chartAdditionalOptions.isLogScale(), chartAdditionalOptions1.isLogScale());
199                 assertEquals(chartAdditionalOptions.getTopMargin(), chartAdditionalOptions1.getTopMargin());
200                 assertEquals(chartAdditionalOptions.getBottomMargin(), chartAdditionalOptions1.getBottomMargin());
201                 assertEquals(chartAdditionalOptions.getLeftMargin(), chartAdditionalOptions1.getLeftMargin());
202                 assertEquals(chartAdditionalOptions.getRightMargin(), chartAdditionalOptions1.getRightMargin());
203                 assertEquals(chartAdditionalOptions.getLinearRegressionColor(), chartAdditionalOptions1.getLinearRegressionColor());
204                 assertEquals(chartAdditionalOptions.isTimeAxis(), chartAdditionalOptions1.isTimeAxis());
205                 assertEquals(chartAdditionalOptions.getTimeSeriesRender(), chartAdditionalOptions1.getTimeSeriesRender());
206
207         }
208
209 }