d287ab553f64a8805d6b9cfa7833822cb6280945
[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
39 package org.onap.portalsdk.analytics.controller;
40
41
42 import static org.junit.Assert.*;
43 import java.io.InputStream;
44 import java.sql.ResultSet;
45 import java.sql.ResultSetMetaData;
46 import java.util.ArrayList;
47 import java.util.List;
48 import javax.servlet.ServletContext;
49 import javax.servlet.http.HttpServletRequest;
50 import javax.servlet.http.HttpSession;
51 import org.onap.portalsdk.analytics.system.fusion.AppUtils;
52
53 import org.junit.Before;
54 import org.junit.Test;
55 import org.junit.runner.RunWith;
56 import org.mockito.Mock;
57 import org.mockito.Mockito;
58 import org.mockito.invocation.InvocationOnMock;
59 import org.mockito.stubbing.Answer;
60 import org.onap.portalsdk.analytics.model.ReportHandler;
61 import org.onap.portalsdk.analytics.model.base.ReportSecurity;
62 import org.onap.portalsdk.analytics.model.definition.ReportDefinition;
63 import org.onap.portalsdk.analytics.model.definition.ReportSchedule;
64 import org.onap.portalsdk.analytics.model.runtime.ReportRuntime;
65 import org.onap.portalsdk.analytics.system.DbUtils;
66 import org.onap.portalsdk.analytics.system.Globals;
67 import org.onap.portalsdk.analytics.system.IAppUtils;
68 import org.onap.portalsdk.analytics.util.AppConstants;
69 import org.onap.portalsdk.analytics.util.DataSet;
70 import org.onap.portalsdk.analytics.xmlobj.ChartAdditionalOptions;
71 import org.onap.portalsdk.analytics.xmlobj.ChartDrillFormfield;
72 import org.onap.portalsdk.analytics.xmlobj.ChartDrillOptions;
73 import org.onap.portalsdk.analytics.xmlobj.ColFilterType;
74 import org.onap.portalsdk.analytics.xmlobj.DataColumnType;
75 import org.onap.portalsdk.analytics.xmlobj.DataSourceType;
76 import org.onap.portalsdk.analytics.xmlobj.FormFieldType;
77 import org.onap.portalsdk.analytics.xmlobj.JavascriptItemType;
78 import org.onap.portalsdk.analytics.xmlobj.ObjectFactory;
79 import org.onap.portalsdk.analytics.xmlobj.SemaphoreList;
80 import org.onap.portalsdk.analytics.xmlobj.SemaphoreType;
81 import org.onap.portalsdk.core.domain.User;
82 import org.powermock.api.mockito.PowerMockito;
83 import org.powermock.core.classloader.annotations.PrepareForTest;
84 import org.powermock.modules.junit4.PowerMockRunner;
85
86 @RunWith(PowerMockRunner.class)
87 @PrepareForTest({DbUtils.class, Globals.class, IAppUtils.class, WizardProcessor.class})//,  RaptorAdapter.class})
88 public class WizardProcessorTest {
89
90         WizardProcessor wizardProcessor;
91         
92         @Mock
93         HttpServletRequest httpServletRequest;
94         
95         @Mock
96         ServletContext servletContext;
97         
98         @Mock
99         HttpSession httpSession;
100
101         @Mock
102         AppUtils appUtils;
103         
104         @Mock
105         ReportRuntime reportRuntime;
106
107         @Mock 
108         ReportHandler reportHandler;
109         
110         @Mock
111         ReportDefinition reportDefinition;
112
113         @Mock
114         WizardSequence wizardSequence;
115
116         @Mock
117         DataSet dataSet;
118
119         @Mock
120         DataSet dataSet1;
121
122         @Mock
123         DataSet dataSet2;
124         
125         @Mock
126         ResultSet resultSet;
127         
128         @Mock
129         ResultSetMetaData resultSetMetaData;
130         
131         @Mock
132         ReportSchedule reportSchedule;
133         
134         @Mock
135         User user;
136         
137         @Mock
138         ReportSecurity reportSecurity;
139         
140         private String REPORT_ID="1000"; 
141         private String DETAIL_ID="3000";
142
143         @Before
144     public void init() throws Exception {
145                 
146                 PowerMockito.mockStatic(DbUtils.class);
147                 PowerMockito.mockStatic(Globals.class);
148                 PowerMockito.mockStatic(IAppUtils.class);                               
149                 
150                 Mockito.when(httpServletRequest.getSession()).thenReturn(httpSession);
151
152                 Mockito.when(httpSession.getAttribute(AppConstants.SI_REPORT_DEFINITION)).thenReturn(reportDefinition);
153                 Mockito.when(httpSession.getAttribute(AppConstants.SI_REPORT_SCHEDULE)).thenReturn(reportSchedule);
154                 Mockito.when(httpSession.getAttribute(AppConstants.SI_REPORT_RUNTIME)).thenReturn(reportRuntime);
155                         
156                 PowerMockito.whenNew(ReportHandler.class).withNoArguments().thenReturn(reportHandler);
157
158                 PowerMockito.when(Globals.getAppUtils()).thenReturn(appUtils);
159                 
160                 Mockito.when(reportHandler.loadReportDefinition(httpServletRequest, REPORT_ID)).thenReturn(reportDefinition);
161
162                 Mockito.when(reportHandler.loadReportRuntime(httpServletRequest, REPORT_ID, false)).thenReturn(reportRuntime);
163                 
164                 Mockito.when(reportDefinition.getWizardSequence()).thenReturn(wizardSequence);
165                 Mockito.when(reportDefinition.getReportSchedule()).thenReturn(reportSchedule);
166                 
167                 Mockito.when(reportRuntime.getReportID()).thenReturn(REPORT_ID);
168                 
169                 Mockito.when(reportDefinition.getReportID()).thenReturn(REPORT_ID);
170
171                 Mockito.when(appUtils.getUserID(httpServletRequest)).thenReturn("USER1");
172
173                 
174                 wizardProcessor = Mockito.spy(WizardProcessor.class);
175         }
176         
177         @Test
178         public void testWizardProcessor() {
179                 WizardProcessor wizardProcessorLocal = new WizardProcessor();
180                 assertNotNull(wizardProcessorLocal);
181         }
182
183
184         
185         @Test(expected=NullPointerException.class)
186         public void testPersistReportDefinition_null_arguments() throws Exception {
187                 wizardProcessor.persistReportDefinition(null, null);
188         }
189
190         @Test(expected=NullPointerException.class)
191         public void testPersistReportDefinition_null_arguments_case1() throws Exception {
192                 wizardProcessor.persistReportDefinition(httpServletRequest, null);
193         }
194
195         @Test(expected=NullPointerException.class)
196         public void testPersistReportDefinition_null_arguments_case2() throws Exception {
197                 wizardProcessor.persistReportDefinition(httpServletRequest, null);
198         }
199
200         @Test(expected=NullPointerException.class)
201         public void testPersistReportDefinition_null_arguments_case3() throws Exception {
202                 wizardProcessor.persistReportDefinition(httpServletRequest, null);
203         }
204
205         @Test
206         public void testPersistReportDefinition_not_null_arguments_case1() throws Exception {
207                 wizardProcessor.persistReportDefinition(httpServletRequest, reportDefinition);
208         }
209         
210         @Test
211         public void testPersistReportDefinition_not_null_arguments_case2() throws Exception {
212                 wizardProcessor.persistReportDefinition(httpServletRequest, reportDefinition);
213         }
214         
215         @Test(expected=NullPointerException.class)
216         public void testProcessWizardStep_null_arguments_case1() throws Exception {
217                 wizardProcessor.processWizardStep(null);
218         }
219         
220         @Test(expected=Exception.class)
221         public void testProcessWizardStep_not_null_arguments_case1() throws Exception {
222                 wizardProcessor.processWizardStep(httpServletRequest);
223         }
224         
225         @Test(expected=Exception.class)
226         public void testProcessWizardStep_not_null_arguments_case2() throws Exception {
227                 mockHttpParameter(AppConstants.RI_WIZARD_ACTION,null);
228                 wizardProcessor.processWizardStep(httpServletRequest);
229         }
230
231         @Test(expected=Exception.class)
232         public void testProcessWizardStep_not_null_arguments_case3() throws Exception {
233                 mockHttpParameter(AppConstants.RI_WIZARD_ACTION,"NA");
234                 wizardProcessor.processWizardStep(httpServletRequest);
235         }
236         
237         @Test
238         public void testProcessWizardStep_not_null_arguments_case4() throws Exception {
239                 mockHttpParameter(AppConstants.RI_WIZARD_ACTION, AppConstants.RI_ACTION);
240                 mockHttpAttribute(AppConstants.RI_REPORT_ID, REPORT_ID);
241                 mockHttpAttribute("showDashboardOptions","");
242
243                 setWizardSteps("NA", "NA");
244
245                 wizardProcessor.processWizardStep(httpServletRequest);
246                 Mockito.verify(wizardProcessor, Mockito.times(1)).processWizardStep(httpServletRequest);
247         }
248         
249         @Test
250         public void testProcessWizardStep_processDefinition_Dashboard_case1() throws Exception {
251                 
252                 mockHttpParameter(AppConstants.RI_WIZARD_ACTION, AppConstants.RI_ACTION);
253                 mockHttpAttribute(AppConstants.RI_REPORT_ID, REPORT_ID);
254                 mockHttpAttribute("showDashboardOptions","");
255                 mockHttpAttribute("folder_id","2000");
256                 mockHttpAttribute("reportType",AppConstants.RT_DASHBOARD);
257                 
258                 setWizardSteps(AppConstants.WS_DEFINITION, "NA");
259
260                 mockHttpAttribute("reportName", "Report One");
261                 mockHttpAttribute("reportDescr","Report One help for testing...");
262                 
263                 mockHttpAttribute("allowSchedule","");
264                 mockHttpAttribute("multiGroupColumn","");
265                 mockHttpAttribute("topDown","");
266                 mockHttpAttribute("sizedByContent","");
267                 
268                 mockHttpAttribute("isOneTimeScheduleAllowed","");
269                 mockHttpAttribute("isHourlyScheduleAllowed","");
270                 mockHttpAttribute("isDailyScheduleAllowed","");
271                 mockHttpAttribute("isDailyMFScheduleAllowed","");
272                 mockHttpAttribute("isWeeklyScheduleAllowed","");
273                 mockHttpAttribute("isMonthlyScheduleAllowed","");               
274
275                 mockHttpAttribute("dashboardLayoutHTML","<html>dashboardLayoutHtml</html>");            
276                 mockHttpAttribute("heightContainer","");                
277                 mockHttpAttribute("widthContainer","");         
278                 
279                 wizardProcessor.processWizardStep(httpServletRequest);
280                                 
281                 Mockito.verify(wizardProcessor, Mockito.times(1)).processWizardStep(httpServletRequest);
282         }
283         
284         
285         @Test
286         public void testProcessWizardStep_processDefinition_Dashboard_case2() throws Exception {
287                 
288                 mockHttpParameter(AppConstants.RI_WIZARD_ACTION, AppConstants.RI_ACTION);
289                 mockHttpAttribute(AppConstants.RI_REPORT_ID, REPORT_ID);
290                 mockHttpAttribute("showDashboardOptions","Y");
291                 mockHttpAttribute("folder_id","2000");
292                 mockHttpAttribute("reportType",AppConstants.RT_DASHBOARD);
293                 
294                 setWizardSteps(AppConstants.WS_DEFINITION, "NA");
295
296                 mockHttpAttribute("reportName", "Report One");
297                 
298                 String reportDescr = "Report One help for testing. ";
299                 
300                 while (reportDescr.length() <1000) {
301                         reportDescr += reportDescr;
302                 }
303                 
304                 mockHttpAttribute("reportDescr", reportDescr);
305                 
306                 mockHttpAttribute("allowSchedule","Y");
307                 mockHttpAttribute("multiGroupColumn","Y");
308                 mockHttpAttribute("topDown","Y");
309                 mockHttpAttribute("sizedByContent","Y");
310                 
311                 mockHttpAttribute("isOneTimeScheduleAllowed","Y");
312                 mockHttpAttribute("isHourlyScheduleAllowed","Y");
313                 mockHttpAttribute("isDailyScheduleAllowed","Y");
314                 mockHttpAttribute("isDailyMFScheduleAllowed","Y");
315                 mockHttpAttribute("isWeeklyScheduleAllowed","Y");
316                 mockHttpAttribute("isMonthlyScheduleAllowed","Y");              
317
318                 mockHttpAttribute("dashboardLayoutHTML","<html>dashboardLayoutHtml</html>");            
319                 mockHttpAttribute("heightContainer","auto");            
320                 mockHttpAttribute("widthContainer","auto");             
321                 
322                 wizardProcessor.processWizardStep(httpServletRequest);
323                 Mockito.verify(wizardProcessor, Mockito.times(1)).processWizardStep(httpServletRequest);
324
325         }
326                 
327         
328         private void setWizardSteps(String currentStep, String currentSubStep) {
329                 Mockito.when(wizardSequence.getCurrentStep()).thenReturn(currentStep);
330                 Mockito.when(wizardSequence.getCurrentSubStep()).thenReturn(currentSubStep);
331         }
332
333         @Test
334         public void testProcessWizardStep_processDefinition_Crosstab_case1() throws Exception {
335                 mockHttpParameter(AppConstants.RI_WIZARD_ACTION, AppConstants.RI_ACTION);
336                 mockHttpAttribute(AppConstants.RI_REPORT_ID, REPORT_ID);
337                 mockHttpAttribute("showDashboardOptions","");
338                 mockHttpAttribute("folder_id","2000");
339                 mockHttpAttribute("reportType",AppConstants.RT_CROSSTAB);
340                 
341                 setWizardSteps(AppConstants.WS_DEFINITION, "NA");
342                 
343                 mockHttpAttribute("reportName","Report One");
344                 mockHttpAttribute("reportDescr","Report One help for testing...");
345                 
346                 mockHttpAttribute("allowSchedule","N");
347                 mockHttpAttribute("multiGroupColumn","N");
348                 mockHttpAttribute("topDown","N");
349                 mockHttpAttribute("sizedByContent","N");
350                 
351                 mockHttpAttribute("isOneTimeScheduleAllowed","N");
352                 mockHttpAttribute("isHourlyScheduleAllowed","N");
353                 mockHttpAttribute("isDailyScheduleAllowed","N");
354                 mockHttpAttribute("isDailyMFScheduleAllowed","N");
355                 mockHttpAttribute("isWeeklyScheduleAllowed","N");
356                 mockHttpAttribute("isMonthlyScheduleAllowed","N");              
357
358                 mockHttpAttribute("widthNo","500px");
359                 mockHttpAttribute("dataGridAlign","right");
360                 mockHttpAttribute("pdfImg","/onap-portal/images");
361                 mockHttpAttribute("emptyMessage","empty");
362                 mockHttpAttribute("formHelp","refer help option in onap portal");
363                 mockHttpAttribute("excelDownloadSize","1024");
364                 mockHttpAttribute("reportInNewWindow","N");
365                 
366                 mockHttpAttribute("hideFormFieldsAfterRun","N");
367                 mockHttpAttribute("reportInNewWindow","N");
368                 mockHttpAttribute("displayFolderTree","N");
369                 mockHttpAttribute("pageSize","100");
370                 mockHttpAttribute("menuApproved","N");
371
372                 String [] menuIds = {"30001", "3002", "3003", "3004"};          
373                 
374                 mockHttpParameterValues("menuID", menuIds);
375
376                 mockHttpAttribute("runtimeColSortDisabled","N");
377                 mockHttpAttribute("reportDefType","N");
378                 mockHttpAttribute("heightContainer","N");
379                 mockHttpAttribute("widthContainer","N");
380                 mockHttpAttribute("hideForm","N");
381                 mockHttpAttribute("hideChart","N");
382                 mockHttpAttribute("hideData","N");
383                 mockHttpAttribute("hideBtns","N");
384                 
385                 mockHttpAttribute("hideMap","N");
386                 mockHttpAttribute("hideExcelIcons","N");
387                 mockHttpAttribute("hidePDFIcons","N");
388                 
389                 mockHttpAttribute("dataSource","org.att.onap.DataSource");
390                 
391                 mockHttpAttribute("numFormCols","10");
392                 mockHttpAttribute("reportTitle","ONAP Portal User Report");
393                 mockHttpAttribute("reportSubTitle","");
394                 
395                 mockHttpAttribute("reportHeader","");
396                 mockHttpAttribute("reportFooter","");
397                 mockHttpAttribute("frozenColumns","10");
398                 
399                 PowerMockito.when(Globals.getDBType()).thenReturn("oracle");
400                 
401                 String sql = "SELECT a.SCHEMA_ID, a.SCHEMA_DESC, DATASOURCE_TYPE  FROM SCHEMA_INFO a where schema_id = '[schema_id]'";
402                 PowerMockito.when(Globals.getDBType()).thenReturn("oracle");
403                 PowerMockito.when(Globals.getRemoteDbSchemaSqlWithWhereClause()).thenReturn(sql);
404
405                 PowerMockito.when(DbUtils.executeQuery(Mockito.anyString())).thenReturn(dataSet);
406
407                 Mockito.when(dataSet.getRowCount()).thenReturn(2);
408                 Mockito.when(dataSet.getItem(Mockito.anyInt(), Mockito.anyInt())).thenReturn("oracle12c");
409                 
410                 wizardProcessor.processWizardStep(httpServletRequest);
411
412                 Mockito.verify(wizardProcessor, Mockito.times(1)).processWizardStep(httpServletRequest);
413         }
414
415         @Test
416         public void testProcessWizardStep_processValidateSQL_case1() throws Exception {
417                 mockHttpParameter(AppConstants.RI_WIZARD_ACTION, AppConstants.WA_VALIDATE);
418                 mockHttpAttribute(AppConstants.RI_REPORT_ID,REPORT_ID);
419                 mockHttpAttribute("showDashboardOptions","Option 1");
420                 mockHttpAttribute("folder_id","2000");
421                 
422                 setWizardSteps(AppConstants.WS_SQL, "NA");
423                 
424                 mockHttpAttribute("reportSQL","SELECT  [colNames.toString()] FROM ( [reportSQL]");
425                 wizardProcessor.processWizardStep(httpServletRequest);
426         }
427
428         @Test
429         public void testProcessWizardStep_processDefinition_processValidateSQL_case2() throws Exception {
430                 mockHttpParameter(AppConstants.RI_WIZARD_ACTION, AppConstants.WA_VALIDATE);
431                 mockHttpAttribute(AppConstants.RI_REPORT_ID,REPORT_ID);
432                 mockHttpAttribute("showDashboardOptions","");
433                 mockHttpAttribute("folder_id","2000");
434                 
435                 setWizardSteps(AppConstants.WS_SQL, "NA");
436                                 
437                 mockHttpAttribute("reportSQL","SELECT  [colNames.toString()] FROM ( [reportSQL]");
438                 wizardProcessor.processWizardStep(httpServletRequest);
439
440                 Mockito.verify(wizardProcessor, Mockito.times(1)).processWizardStep(httpServletRequest);
441         }
442
443                 
444         @Test
445         public void testProcessWizardStep_processTableAdd_case1() throws Exception {
446                 mockHttpParameter(AppConstants.RI_WIZARD_ACTION, AppConstants.WA_VALIDATE);
447                 mockHttpAttribute(AppConstants.RI_REPORT_ID,REPORT_ID);
448                 mockHttpAttribute("showDashboardOptions","");
449                 mockHttpAttribute("folder_id","20001");
450                 
451                 setWizardSteps(AppConstants.WS_TABLES, AppConstants.WSS_ADD);
452                 
453                 Mockito.when(reportHandler.loadReportDefinition(httpServletRequest, "10001")).thenReturn(reportDefinition);
454
455                 mockHttpAttribute("reportSQL","SELECT  [colNames.toString()] FROM ( [reportSQL]");
456
457                 mockHttpAttribute("tableName","cr_report_access crc");
458                 mockHttpAttribute("joinTableName","cr_report cr");
459                 mockHttpAttribute("joinExpr","crc.rep_id = cr.rep_id");
460                 mockHttpAttribute("tablePK","crc.rep_id");
461                 mockHttpAttribute("displayName","Report Access");
462                 mockHttpAttribute("outerJoin"," ");
463                 
464                 wizardProcessor.processWizardStep(httpServletRequest);
465
466                 Mockito.verify(wizardProcessor, Mockito.times(1)).processWizardStep(httpServletRequest);
467         }
468
469         @Test
470         public void testProcessWizardStep_processTableAdd_case2() throws Exception {
471                 mockHttpParameter(AppConstants.RI_WIZARD_ACTION, AppConstants.WA_VALIDATE);
472                 mockHttpAttribute(AppConstants.RI_REPORT_ID,REPORT_ID);
473
474                 mockHttpAttribute("showDashboardOptions","");
475                 mockHttpAttribute("folder_id","2000");
476                 
477                 DataSourceType dataSourceType = new DataSourceType();
478                 dataSourceType.setRefTableId("reportaccess");
479                 dataSourceType.setTableName("cr_report_access crc");
480                 
481                 Mockito.when(reportDefinition.getTableById(Mockito.anyString())).thenReturn(dataSourceType);
482                 
483                 setWizardSteps(AppConstants.WS_TABLES, AppConstants.WSS_ADD);
484
485                 
486                 mockHttpAttribute("reportSQL","SELECT  [colNames.toString()] FROM ( [reportSQL]");
487                 mockHttpAttribute("tableName","cr_report_access crc");
488                 mockHttpAttribute("joinTableName","cr_report cr");
489                 mockHttpAttribute("joinExpr","crc.rep_id = cr.rep_id");
490                 mockHttpAttribute("tablePK","crc.rep_id");
491                 mockHttpAttribute("displayName","Report Access");
492                 mockHttpAttribute("outerJoin"," ");
493                 
494                 wizardProcessor.processWizardStep(httpServletRequest);
495
496                 Mockito.verify(wizardProcessor, Mockito.times(1)).processWizardStep(httpServletRequest);
497         }
498         
499         
500         @Test
501         public void testProcessWizardStep_processTableEdit_case1() throws Exception {
502
503                 mockHttpParameter(AppConstants.RI_WIZARD_ACTION, AppConstants.WA_VALIDATE);
504                 mockHttpAttribute(AppConstants.RI_REPORT_ID,REPORT_ID);
505                 mockHttpAttribute("showDashboardOptions","");
506                 mockHttpAttribute(AppConstants.RI_DETAIL_ID, DETAIL_ID);
507                 
508                 DataSourceType dataSourceType = new DataSourceType();
509                 dataSourceType.setTableId("reportaccess");
510                 dataSourceType.setTableName("cr_report_access crc");
511                 Mockito.when(reportDefinition.getTableById(Mockito.anyString())).thenReturn(dataSourceType);
512
513                 Mockito.when(reportDefinition.getTableByDBName(Mockito.anyString())).thenReturn(dataSourceType);
514
515                 setWizardSteps(AppConstants.WS_TABLES, AppConstants.WSS_EDIT);
516
517                 mockHttpAttribute("reportSQL","SELECT  [colNames.toString()] FROM ( [reportSQL]");
518
519                 mockHttpAttribute("tableName","cr_report_access crc");
520                 mockHttpAttribute("joinTableName","cr_report cr");
521                 mockHttpAttribute("joinExpr","crc.rep_id = cr.rep_id");
522                 mockHttpAttribute("tablePK","crc.rep_id");
523                 mockHttpAttribute("displayName","Report Access");
524                 mockHttpAttribute("outerJoin"," ");
525                                 
526                 wizardProcessor.processWizardStep(httpServletRequest);
527         
528                 Mockito.verify(wizardProcessor, Mockito.times(1)).processWizardStep(httpServletRequest);        
529         }
530         
531
532         @Test
533         public void testProcessWizardStep_processTableDelete_case1() throws Exception {
534
535                 mockHttpParameter(AppConstants.RI_WIZARD_ACTION, AppConstants.WA_VALIDATE);
536                 mockHttpAttribute(AppConstants.RI_REPORT_ID,REPORT_ID);
537                 mockHttpAttribute("showDashboardOptions","");
538                 mockHttpAttribute(AppConstants.RI_DETAIL_ID,DETAIL_ID);
539
540                 setWizardSteps(AppConstants.WS_TABLES, AppConstants.WA_DELETE);
541
542                 DataSourceType dataSourceType = new DataSourceType();
543                 dataSourceType.setTableId("reportaccess");
544                 dataSourceType.setTableName("cr_report_access crc");
545
546                 Mockito.when(reportDefinition.getTableById(Mockito.anyString())).thenReturn(dataSourceType);
547                 Mockito.when(reportDefinition.getTableByDBName(Mockito.anyString())).thenReturn(dataSourceType);
548
549                 wizardProcessor.processWizardStep(httpServletRequest);
550
551                 Mockito.verify(wizardProcessor, Mockito.times(1)).processWizardStep(httpServletRequest);
552         }
553
554
555         
556         @Test
557         public void testProcessWizardStep_processColumnAddEdit_case1() throws Exception {
558                 mockHttpParameter(AppConstants.RI_WIZARD_ACTION, AppConstants.WA_VALIDATE);
559                 mockHttpAttribute(AppConstants.RI_REPORT_ID,REPORT_ID);
560                 mockHttpAttribute("showDashboardOptions","");
561                 mockHttpAttribute(AppConstants.RI_DETAIL_ID,DETAIL_ID);
562                 
563                 setWizardSteps(AppConstants.WS_COLUMNS, AppConstants.WSS_ADD);
564                 
565                 DataSourceType dataSourceType = new DataSourceType();
566                 dataSourceType.setTableId("reportaccess");
567                 dataSourceType.setTableName("cr_report_access crc");
568
569                 Mockito.when(reportDefinition.getTableById(Mockito.anyString())).thenReturn(dataSourceType);
570                 Mockito.when(reportDefinition.getTableByDBName(Mockito.anyString())).thenReturn(dataSourceType);
571                 
572                 wizardProcessor.processWizardStep(httpServletRequest);
573
574                 Mockito.verify(wizardProcessor, Mockito.times(1)).processWizardStep(httpServletRequest);
575         }
576         
577         
578
579         @Test
580         public void testProcessWizardStep_processColumnAddEdit_case2() throws Exception {
581                 mockHttpParameter(AppConstants.RI_WIZARD_ACTION, AppConstants.WA_VALIDATE);
582                 mockHttpAttribute(AppConstants.RI_REPORT_ID,REPORT_ID);
583                 mockHttpAttribute("showDashboardOptions","");
584                 mockHttpAttribute(AppConstants.RI_DETAIL_ID,DETAIL_ID);
585
586                 setWizardSteps(AppConstants.WS_COLUMNS, AppConstants.WSS_EDIT);
587                 
588                 Mockito.when(reportDefinition.getReportType()).thenReturn(AppConstants.RT_CROSSTAB);
589                 Mockito.when(reportDefinition.getReportDefType()).thenReturn(AppConstants.RD_SQL_BASED);
590                 
591                 DataColumnType dataColumnType = new DataColumnType();
592                 
593                 dataColumnType.setTableId("reportaccess");
594                 dataColumnType.setDbColName("rep_id");
595                 dataColumnType.setColName("rep_id");
596                 dataColumnType.setDbColType("integer");
597                 
598                 Mockito.when(reportDefinition.getColumnById(Mockito.anyString())).thenReturn(dataColumnType);
599                 
600                 mockHttpAttribute("columnDetails","reportaccess|rep_id|integer");
601                 mockHttpAttribute("exprFormula","COUNT(*)");
602                 mockHttpAttribute("displayWidth","500");
603                 mockHttpAttribute("drillDownParams"," [this] ");
604                 mockHttpAttribute("visible", "true");
605                 mockHttpAttribute("sortable", "true");
606                 mockHttpAttribute("nowrap", "Yes");
607                 mockHttpAttribute("indentation", "100");
608                 mockHttpAttribute("dependsOnFormField", "100");
609                 mockHttpAttribute("groupBreak", "true");
610                 mockHttpAttribute("groupByPos", "1");
611                 mockHttpAttribute("subTotalCustomText", "");
612                 mockHttpAttribute("hideRepeatedKeys", "true");
613                 mockHttpAttribute("displayTotal", "100");
614                 mockHttpAttribute("widthInPxls", "500");
615                 mockHttpAttribute("crossTabValue", AppConstants.CV_VALUE);
616                 mockHttpAttribute("displayTotalPerRow", "100");
617                 mockHttpAttribute("displayName", "ONAP USER REPORT");
618                 mockHttpAttribute("colType", AppConstants.CT_HYPERLINK);
619                 mockHttpAttribute("hyperlinkURL", "http://onap.readthedocs.io/en/latest");
620                 mockHttpAttribute("anchor", "IMAGE");
621                 mockHttpAttribute("actionImg", "Dummy");
622                 mockHttpAttribute("displayFormat", "HTML");
623                 mockHttpAttribute("displayFormat", "HTML");
624                 mockHttpAttribute("displayAlign", "right");
625                 mockHttpAttribute("displayHeaderAlign", "right");
626                 mockHttpAttribute("drillDownURL", "");
627                 mockHttpAttribute("drillDownSuppress", "");
628                 mockHttpAttribute("drillDownPopUp", "");
629                 mockHttpAttribute("semaphore", "");
630                 mockHttpAttribute("semaphoreTypeHidden", "");
631                 mockHttpAttribute("multiGroupColLevel", "1000");
632                 mockHttpAttribute("startMultiGroup", "");
633                 mockHttpAttribute("colspan", "");
634                 mockHttpAttribute("colDataFormat", "GRID");
635                 mockHttpAttribute("enhancedPagination", "100");
636                 mockHttpAttribute("no_parse_date", "true");
637
638                 wizardProcessor.processWizardStep(httpServletRequest);
639
640                 Mockito.verify(wizardProcessor, Mockito.times(1)).processWizardStep(httpServletRequest);
641         }
642
643         /***
644                 @Test
645                 public void testProcessWizardStep_processColumnAddEdit_case3() throws Exception {
646         
647                 }
648                 
649                 @Test
650                 public void testProcessWizardStep_processColumnAddEdit_case4() throws Exception {
651         
652                 }
653                 
654                 @Test
655                 public void testProcessWizardStep_processColumnAddEdit_case5() throws Exception {
656         
657                 }
658         
659          ***/
660         
661         @Test
662         public void testProcessWizardStep_processColumnAddMulti_case1() throws Exception {
663                 mockHttpParameter(AppConstants.RI_WIZARD_ACTION, AppConstants.WA_VALIDATE);
664                 mockHttpAttribute(AppConstants.RI_REPORT_ID,REPORT_ID);
665                 mockHttpAttribute("showDashboardOptions","");
666                 mockHttpAttribute(AppConstants.RI_DETAIL_ID,DETAIL_ID);
667                 
668                 setWizardSteps(AppConstants.WS_COLUMNS, AppConstants.WSS_ADD_MULTI);
669
670                 String[] addColumn = {"Y", "N", "Y"};
671                 String[] tableId =  {"Id", "N", "Y"};
672                 String[] columnName = {"REP_ID", "ORDER_NO", "ROLE_ID"};
673                 String[] columnType = {"INTEGER", "INTEGER", "INTEGER"};
674                 String[] displayName = {"Report Id", "Order No", "Role Id"};
675                                                 
676                 mockHttpParameterValues("addColumn", addColumn);
677                 mockHttpParameterValues("tableId", tableId);
678                 mockHttpParameterValues("columnName", columnName);
679                 mockHttpParameterValues("columnType", columnType);
680                 mockHttpParameterValues("displayName", displayName);
681                 
682                 
683                 DataColumnType dataColumnType1 = new DataColumnType();
684                 
685                 dataColumnType1.setTableId("reportaccess");
686                 dataColumnType1.setDbColName("REP_ID");
687                 dataColumnType1.setColName("REP_ID");
688                 dataColumnType1.setDbColType("INTEGER");
689                 dataColumnType1.setDisplayName("Report Id");
690                 
691                 DataColumnType dataColumnType2 = new DataColumnType();
692                 
693                 dataColumnType2.setTableId("reportaccess");
694                 dataColumnType2.setDbColName("ORDER_NO");
695                 dataColumnType2.setColName("ORDER_NO");
696                 dataColumnType2.setDbColType("INTEGER");
697                 dataColumnType2.setDisplayName("Order No");
698                 
699                 List<DataColumnType> listDataColumnType = new ArrayList<DataColumnType>();
700                 listDataColumnType.add(dataColumnType1);
701                 listDataColumnType.add(dataColumnType2);
702                 
703                 Mockito.when(reportDefinition.getAllColumns()).thenReturn(listDataColumnType);
704
705                 wizardProcessor.processWizardStep(httpServletRequest);
706                 Mockito.verify(wizardProcessor, Mockito.times(1)).processWizardStep(httpServletRequest);
707
708         }
709
710         @Test
711         public void testProcessWizardStep_processColumnOrderAll_case1() throws Exception {
712                 mockHttpParameter(AppConstants.RI_WIZARD_ACTION, AppConstants.WA_VALIDATE);
713                 mockHttpAttribute(AppConstants.RI_REPORT_ID,REPORT_ID);
714                 mockHttpAttribute("showDashboardOptions","");
715                 mockHttpAttribute(AppConstants.RI_DETAIL_ID,DETAIL_ID);
716                 
717                 setWizardSteps(AppConstants.WS_COLUMNS, AppConstants.WSS_ORDER_ALL);
718
719                 String[] colId = {"REP_ID", "ORDER_NO", "ROLE_ID"};
720                 String[] colOrder = {"1", "2", "3"};
721                 
722                 mockHttpParameterValues("colId", colId);
723                 mockHttpParameterValues("colOrder", colOrder);
724                 
725                 DataColumnType dataColumnType1 = new DataColumnType();
726                 
727                 dataColumnType1.setTableId("reportaccess");
728                 dataColumnType1.setDbColName("REP_ID");
729                 dataColumnType1.setColName("REP_ID");
730                 dataColumnType1.setDbColType("INTEGER");
731                 dataColumnType1.setDisplayName("Report Id");
732                 
733                 Mockito.when(reportDefinition.getColumnById("REP_ID")).thenReturn(dataColumnType1);
734                 
735                 DataColumnType dataColumnType2 = new DataColumnType();
736                 
737                 dataColumnType2.setTableId("reportaccess");
738                 dataColumnType2.setDbColName("ORDER_NO");
739                 dataColumnType2.setColName("ORDER_NO");
740                 dataColumnType2.setDbColType("INTEGER");
741                 dataColumnType2.setDisplayName("Order No");
742                 
743                 List<DataColumnType> listDataColumnType = new ArrayList<DataColumnType>();
744                 listDataColumnType.add(dataColumnType1);
745                 listDataColumnType.add(dataColumnType2);
746                 
747                 Mockito.when(reportDefinition.getAllColumns()).thenReturn(listDataColumnType);
748
749                 wizardProcessor.processWizardStep(httpServletRequest);
750                 Mockito.verify(wizardProcessor, Mockito.times(1)).processWizardStep(httpServletRequest);
751
752         }
753
754         
755         @Test
756         public void testProcessWizardStep_processColumnDelete_case1() throws Exception {
757                 
758                 mockHttpParameter(AppConstants.RI_WIZARD_ACTION, AppConstants.WA_DELETE);
759                 mockHttpAttribute(AppConstants.RI_REPORT_ID,REPORT_ID);
760                 mockHttpAttribute("showDashboardOptions","");
761                 mockHttpAttribute(AppConstants.RI_DETAIL_ID,DETAIL_ID);
762
763                 setWizardSteps(AppConstants.WS_COLUMNS, "NA");
764
765                 wizardProcessor.processWizardStep(httpServletRequest);
766                 Mockito.verify(wizardProcessor, Mockito.times(1)).processWizardStep(httpServletRequest);
767         }
768         
769         @Test
770         public void testProcessWizardStep_processColumnMoveUp_case1() throws Exception {
771                 mockHttpParameter(AppConstants.RI_WIZARD_ACTION, AppConstants.WA_MOVE_UP);
772                 mockHttpAttribute(AppConstants.RI_REPORT_ID,REPORT_ID);
773                 mockHttpAttribute("showDashboardOptions","");
774                 mockHttpAttribute(AppConstants.RI_DETAIL_ID,DETAIL_ID);
775
776                 setWizardSteps(AppConstants.WS_COLUMNS, "NA");
777                 
778                 wizardProcessor.processWizardStep(httpServletRequest);
779                 Mockito.verify(wizardProcessor, Mockito.times(1)).processWizardStep(httpServletRequest);
780         }
781         
782         
783         @Test
784         public void testProcessWizardStep_processColumnMoveDown_case1() throws Exception {
785                 mockHttpParameter(AppConstants.RI_WIZARD_ACTION, AppConstants.WA_MOVE_DOWN);
786                 mockHttpAttribute(AppConstants.RI_REPORT_ID,REPORT_ID);
787                 mockHttpAttribute("showDashboardOptions","");
788                 mockHttpAttribute(AppConstants.RI_DETAIL_ID,DETAIL_ID);
789
790                 setWizardSteps(AppConstants.WS_COLUMNS, "NA");
791
792                 wizardProcessor.processWizardStep(httpServletRequest);
793                 Mockito.verify(wizardProcessor, Mockito.times(1)).processWizardStep(httpServletRequest);
794
795         }       
796         
797         @Test
798         public void testProcessWizardStep_processFormFieldAddEdit_case1() throws Exception {
799                 mockHttpParameter(AppConstants.RI_WIZARD_ACTION, "ACTION");
800                 mockHttpAttribute(AppConstants.RI_REPORT_ID,REPORT_ID);
801                 mockHttpAttribute("showDashboardOptions","");
802                 mockHttpAttribute(AppConstants.RI_DETAIL_ID,DETAIL_ID);
803
804                 setWizardSteps(AppConstants.WS_FORM_FIELDS, AppConstants.WSS_ADD);
805                 
806                 Mockito.when(reportDefinition.getReportDefType()).thenReturn(AppConstants.RD_SQL_BASED);
807
808                 FormFieldType formFieldType = new FormFieldType();              
809                 formFieldType.setFieldId(AppConstants.RI_REPORT_ID);
810                                 
811                 Mockito.when(reportDefinition.addFormFieldType(Mockito.anyObject(), Mockito.anyString(), Mockito.anyString(), Mockito.anyString(), Mockito.anyString(), Mockito.anyString(), Mockito.anyString(), Mockito.anyString(), Mockito.anyString(), Mockito.anyObject(), Mockito.anyObject(), Mockito.anyString(), Mockito.anyString())).thenReturn(formFieldType);
812                 
813                 mockHttpAttribute("fieldName", "REP_ID");
814                 mockHttpAttribute("fieldColId", "REP_ID");
815                 mockHttpAttribute("displayFormat", "TABLE");
816                 mockHttpAttribute("fieldType", "INTEGER");
817                 mockHttpAttribute("validation", "Success");
818                 mockHttpAttribute("mandatory", "Y");
819                 mockHttpAttribute("defaultValue", "null");
820                 mockHttpAttribute("fieldHelp", "Refer ONAP Help");
821                 mockHttpAttribute("fieldSQL", "SELECT 1 FROM DUAL");
822                 mockHttpAttribute("fieldDefaultSQL", "SELECT 1 FROM DUAL");
823                 mockHttpAttribute("visible", "Y");
824                 
825                 mockHttpAttribute("dependsOn", "");
826                 mockHttpAttribute("rangeStartDate", "01/01/2018");
827                 mockHttpAttribute("rangeEndDate", "12/12/2018");
828                 mockHttpAttribute("rangeStartDateSQL", "Y");
829                 mockHttpAttribute("rangeEndDateSQL", "Y");
830                 mockHttpAttribute("isGroupFormField", "Y");
831                 
832                 wizardProcessor.processWizardStep(httpServletRequest);
833                 Mockito.verify(wizardProcessor, Mockito.times(1)).processWizardStep(httpServletRequest);
834         }       
835         
836         
837         @Test
838         public void testProcessWizardStep_processFormFieldAddEdit_case2() throws Exception {
839                 mockHttpParameter(AppConstants.RI_WIZARD_ACTION, AppConstants.WA_ADD_USER);
840                 mockHttpAttribute(AppConstants.RI_REPORT_ID,REPORT_ID);
841                 mockHttpAttribute("showDashboardOptions","");
842                 mockHttpAttribute(AppConstants.RI_DETAIL_ID,DETAIL_ID);
843
844                 setWizardSteps(AppConstants.WS_FORM_FIELDS, AppConstants.WSS_EDIT);
845
846                 Mockito.when(reportDefinition.getReportDefType()).thenReturn(AppConstants.RD_SQL_BASED);
847
848                 FormFieldType formFieldType = new FormFieldType();              
849                 formFieldType.setFieldId(AppConstants.RI_REPORT_ID);
850                 
851                 Mockito.when(reportDefinition.getFormFieldById(Mockito.anyString())).thenReturn(formFieldType);
852                 
853                 Mockito.when(reportDefinition.addFormFieldType(Mockito.anyObject(), Mockito.anyString(), Mockito.anyString(), Mockito.anyString(), Mockito.anyString(), Mockito.anyString(), Mockito.anyString(), Mockito.anyString(), Mockito.anyString(), Mockito.anyObject(), Mockito.anyObject(), Mockito.anyString(), Mockito.anyString())).thenReturn(formFieldType);
854                 
855                 mockHttpAttribute("fieldName", "REP_ID");
856                 mockHttpAttribute("fieldColId", "REP_ID");
857                 mockHttpAttribute("displayFormat", "TABLE");
858                 mockHttpAttribute("fieldType", "INTEGER");
859                 mockHttpAttribute("validation", "Success");
860                 mockHttpAttribute("mandatory", "Y");
861                 mockHttpAttribute("defaultValue", "null");
862                 mockHttpAttribute("fieldHelp", "Refer ONAP Help");
863                 mockHttpAttribute("fieldSQL", "SELECT 1 FROM DUAL");
864                 mockHttpAttribute("fieldDefaultSQL", "SELECT 1 FROM DUAL");
865                 mockHttpAttribute("visible", "Y");
866                 mockHttpAttribute("dependsOn", "");
867                 mockHttpAttribute("rangeStartDate", "01/01/2018");
868                 mockHttpAttribute("rangeEndDate", "12/12/2018");
869                 mockHttpAttribute("rangeStartDateSQL", "Y");
870                 mockHttpAttribute("rangeEndDateSQL", "Y");
871                 mockHttpAttribute("isGroupFormField", "Y");
872                 mockHttpAttribute("newPredefinedValue", "Y");
873
874                 wizardProcessor.processWizardStep(httpServletRequest);
875                 Mockito.verify(wizardProcessor, Mockito.times(1)).processWizardStep(httpServletRequest);
876
877         }       
878         
879         
880         @Test
881         public void testProcessWizardStep_processFormFieldDelete_case1() throws Exception {
882                 mockHttpParameter(AppConstants.RI_WIZARD_ACTION, AppConstants.WA_DELETE);
883                 mockHttpAttribute(AppConstants.RI_REPORT_ID,REPORT_ID);
884                 mockHttpAttribute("showDashboardOptions","");
885                 mockHttpAttribute(AppConstants.RI_DETAIL_ID,DETAIL_ID);
886
887                 setWizardSteps(AppConstants.WS_FORM_FIELDS, AppConstants.WA_DELETE);
888                 Mockito.when(reportDefinition.getReportDefType()).thenReturn(AppConstants.RD_SQL_BASED);
889                 wizardProcessor.processWizardStep(httpServletRequest);
890                 Mockito.verify(wizardProcessor, Mockito.times(1)).processWizardStep(httpServletRequest);
891
892         }       
893
894         
895         @Test
896         public void testProcessWizardStep_processFormFieldMoveUp_case1() throws Exception {
897                 mockHttpParameter(AppConstants.RI_WIZARD_ACTION, AppConstants.WA_MOVE_UP);
898                 mockHttpAttribute(AppConstants.RI_REPORT_ID,REPORT_ID);
899                 mockHttpAttribute("showDashboardOptions","");
900                 mockHttpAttribute(AppConstants.RI_DETAIL_ID,DETAIL_ID);
901
902                 setWizardSteps(AppConstants.WS_FORM_FIELDS, AppConstants.WA_MOVE_UP);
903                 Mockito.when(reportDefinition.getReportDefType()).thenReturn(AppConstants.RD_SQL_BASED);
904
905                 wizardProcessor.processWizardStep(httpServletRequest);
906                 Mockito.verify(wizardProcessor, Mockito.times(1)).processWizardStep(httpServletRequest);
907
908         }       
909                 
910         @Test
911         public void testProcessWizardStep_processFormFieldMoveDown_case1() throws Exception {
912                 mockHttpParameter(AppConstants.RI_WIZARD_ACTION, AppConstants.WA_MOVE_DOWN);
913                 mockHttpAttribute(AppConstants.RI_REPORT_ID,REPORT_ID);
914                 mockHttpAttribute("showDashboardOptions","");
915                 mockHttpAttribute(AppConstants.RI_DETAIL_ID,DETAIL_ID);
916
917                 setWizardSteps(AppConstants.WS_FORM_FIELDS, AppConstants.WA_MOVE_DOWN);
918                 Mockito.when(reportDefinition.getReportDefType()).thenReturn(AppConstants.RD_SQL_BASED);
919
920                 wizardProcessor.processWizardStep(httpServletRequest);
921                 Mockito.verify(wizardProcessor, Mockito.times(1)).processWizardStep(httpServletRequest);
922         }       
923         
924         @Test
925         public void testProcessWizardStep_processFormFieldBlank_case1() throws Exception {
926                 mockHttpParameter(AppConstants.RI_WIZARD_ACTION, AppConstants.WSS_ADD_BLANK);
927                 mockHttpAttribute(AppConstants.RI_REPORT_ID,REPORT_ID);
928                 mockHttpAttribute("showDashboardOptions","");
929                 mockHttpAttribute(AppConstants.RI_DETAIL_ID,DETAIL_ID);
930
931                 setWizardSteps(AppConstants.WS_FORM_FIELDS, AppConstants.WSS_ADD_BLANK);
932                 
933                 Mockito.when(reportDefinition.getReportDefType()).thenReturn(AppConstants.RD_SQL_BASED);
934
935                 wizardProcessor.processWizardStep(httpServletRequest);
936                 Mockito.verify(wizardProcessor, Mockito.times(1)).processWizardStep(httpServletRequest);
937         }       
938         
939         
940         @Test
941         public void testProcessWizardStep_processFormFieldInfoBar_case1() throws Exception {
942                 mockHttpParameter(AppConstants.RI_WIZARD_ACTION, AppConstants.WSS_INFO_BAR);
943                 mockHttpAttribute(AppConstants.RI_REPORT_ID,REPORT_ID);
944                 mockHttpAttribute("showDashboardOptions","");
945                 mockHttpAttribute(AppConstants.RI_DETAIL_ID,DETAIL_ID);
946                 mockHttpAttribute("blueBarField", "REPORT ID");
947
948                 setWizardSteps(AppConstants.WS_FORM_FIELDS, AppConstants.WSS_INFO_BAR);
949                 
950                 Mockito.when(reportDefinition.getReportDefType()).thenReturn(AppConstants.RD_SQL_BASED);
951
952                 wizardProcessor.processWizardStep(httpServletRequest);
953                 Mockito.verify(wizardProcessor, Mockito.times(1)).processWizardStep(httpServletRequest);
954         }       
955         
956                 
957         @Test
958         public void testProcessWizardStep_processFilterAddEdit_case1() throws Exception {
959                 mockHttpParameter(AppConstants.RI_WIZARD_ACTION, "ACTION");
960                 mockHttpAttribute(AppConstants.RI_REPORT_ID,REPORT_ID);
961                 mockHttpAttribute("showDashboardOptions","");
962                 mockHttpAttribute(AppConstants.RI_DETAIL_ID,DETAIL_ID);
963                 mockHttpAttribute("blueBarField", "REPORT ID");
964
965                 setWizardSteps(AppConstants.WS_FILTERS, AppConstants.WSS_ADD);
966                 
967                 DataColumnType dataColumnType1 = new DataColumnType();
968                 
969                 dataColumnType1.setTableId("reportaccess");
970                 dataColumnType1.setDbColName("REP_ID");
971                 dataColumnType1.setColName("REP_ID");
972                 dataColumnType1.setDbColType("INTEGER");
973                 dataColumnType1.setDisplayName("Report Id");
974                 
975                 DataColumnType dataColumnType2 = new DataColumnType();
976                 
977                 dataColumnType2.setTableId("reportaccess");
978                 dataColumnType2.setDbColName("ORDER_NO");
979                 dataColumnType2.setColName("ORDER_NO");
980                 dataColumnType2.setDbColType("INTEGER");
981                 dataColumnType2.setDisplayName("Order No");
982
983                 List<DataColumnType> listDataColumnType = new ArrayList<DataColumnType>();
984                 listDataColumnType.add(dataColumnType1);
985                 listDataColumnType.add(dataColumnType2);
986
987                 Mockito.when(reportDefinition.getColumnById(Mockito.anyString())).thenReturn(dataColumnType2);
988                 Mockito.when(reportDefinition.getAllColumns()).thenReturn(listDataColumnType);
989                 
990                 mockHttpAttribute("filterColId", "ORDER_NO");
991                 mockHttpAttribute("filterExpr", "ORDER_NO=");
992                 mockHttpAttribute("argType", AppConstants.AT_COLUMN);
993                 mockHttpAttribute("argValue", "1001");
994                 
995                 mockHttpAttribute("rangeEndDateSQL", "Y");
996                 mockHttpAttribute("isGroupFormField", "Y");
997                 
998                 mockHttpAttribute("newPredefinedValue", "Y");
999                 
1000                 mockHttpAttribute("filterJoin", "+");
1001                 mockHttpAttribute("openBrackets", "(");
1002                 mockHttpAttribute("closeBrackets", ")");
1003
1004                 wizardProcessor.processWizardStep(httpServletRequest);
1005                 Mockito.verify(wizardProcessor, Mockito.times(1)).processWizardStep(httpServletRequest);
1006         }
1007         
1008         
1009         @Test
1010         public void testProcessWizardStep_processFilterAddEdit_case2() throws Exception {
1011                 mockHttpParameter(AppConstants.RI_WIZARD_ACTION, "ACTION");
1012                 mockHttpAttribute(AppConstants.RI_REPORT_ID,REPORT_ID);
1013                 mockHttpAttribute("showDashboardOptions","");
1014                 mockHttpAttribute(AppConstants.RI_DETAIL_ID,DETAIL_ID);
1015                 mockHttpAttribute("blueBarField", "REPORT ID");
1016
1017                 setWizardSteps(AppConstants.WS_FILTERS, AppConstants.WSS_EDIT);
1018
1019                 DataColumnType dataColumnType1 = new DataColumnType();
1020                 
1021                 dataColumnType1.setTableId("reportaccess");
1022                 dataColumnType1.setDbColName("REP_ID");
1023                 dataColumnType1.setColName("REP_ID");
1024                 dataColumnType1.setDbColType("INTEGER");
1025                 dataColumnType1.setDisplayName("Report Id");
1026                 
1027                 DataColumnType dataColumnType2 = new DataColumnType();
1028                 
1029                 dataColumnType2.setTableId("reportaccess");
1030                 dataColumnType2.setDbColName("ORDER_NO");
1031                 dataColumnType2.setColName("ORDER_NO");
1032                 dataColumnType2.setDbColType("INTEGER");
1033                 dataColumnType2.setDisplayName("Order No");
1034                 dataColumnType2.setColType("INTEGER");
1035
1036                 PowerMockito.when(Globals.getProcessFilterAddEdit()).thenReturn("= \'[argValue]\'");
1037                 
1038                 Mockito.when(reportDefinition.getColumnById(Mockito.anyString())).thenReturn(dataColumnType2);
1039
1040                 
1041                 List<DataColumnType> listDataColumnType = new ArrayList<DataColumnType>();
1042                 listDataColumnType.add(dataColumnType1);
1043                 listDataColumnType.add(dataColumnType2);
1044
1045                 ColFilterType colFilterType = new ColFilterType();
1046
1047                 Mockito.when(reportDefinition.getAllColumns()).thenReturn(listDataColumnType);
1048                 Mockito.when(reportDefinition.getFilterById(Mockito.anyString(), Mockito.anyInt())).thenReturn(colFilterType);
1049                 
1050                 mockHttpAttribute("filterColId", "ORDER_NO");
1051                 mockHttpAttribute("filterExpr", "ORDER_NO=");
1052                 mockHttpAttribute("argType", AppConstants.AT_VALUE);
1053                 mockHttpAttribute("argValue", "1001");
1054                 
1055                 mockHttpAttribute("filterPos", "1");
1056                 
1057                 mockHttpAttribute("rangeEndDateSQL", "Y");
1058                 mockHttpAttribute("isGroupFormField", "Y");
1059                 
1060                 mockHttpAttribute("newPredefinedValue", "Y");
1061                 
1062                 mockHttpAttribute("filterJoin", "+");
1063                 mockHttpAttribute("openBrackets", "(");
1064                 mockHttpAttribute("closeBrackets", ")");
1065
1066                 wizardProcessor.processWizardStep(httpServletRequest);
1067                 Mockito.verify(wizardProcessor, Mockito.times(1)).processWizardStep(httpServletRequest);
1068         }
1069         
1070
1071         
1072         @Test
1073         public void testProcessWizardStep_processFilterDelete_case1() throws Exception {
1074                 
1075                 mockHttpParameter(AppConstants.RI_WIZARD_ACTION, AppConstants.WA_DELETE);
1076                 mockHttpAttribute(AppConstants.RI_REPORT_ID,REPORT_ID);
1077                 mockHttpAttribute("showDashboardOptions","");
1078                 mockHttpAttribute(AppConstants.RI_DETAIL_ID, "ORDER_NO|1");
1079                 mockHttpAttribute("blueBarField", "REPORT ID");
1080
1081                 setWizardSteps(AppConstants.WS_FILTERS, AppConstants.WA_DELETE);
1082
1083                 wizardProcessor.processWizardStep(httpServletRequest);
1084                 Mockito.verify(wizardProcessor, Mockito.times(1)).processWizardStep(httpServletRequest);
1085         }
1086         
1087
1088         @Test
1089         public void testProcessWizardStep_processSortAddEdit_case1() throws Exception {
1090                 mockHttpParameter(AppConstants.RI_WIZARD_ACTION, AppConstants.WS_SORTING);
1091                 mockHttpAttribute(AppConstants.RI_REPORT_ID,REPORT_ID);
1092                 mockHttpAttribute("showDashboardOptions","");
1093                 mockHttpAttribute(AppConstants.RI_DETAIL_ID,DETAIL_ID);
1094                 mockHttpAttribute("sortAscDesc","Asc");
1095                 setWizardSteps(AppConstants.WS_SORTING, AppConstants.WSS_ADD);
1096                                 
1097                 DataColumnType dataColumnType = new DataColumnType();
1098                 
1099                 dataColumnType.setTableId("reportaccess");
1100                 dataColumnType.setDbColName("rep_id");
1101                 dataColumnType.setColName("rep_id");
1102                 dataColumnType.setDbColType("integer");
1103                 
1104                 Mockito.when(reportDefinition.getColumnById(Mockito.anyString())).thenReturn(dataColumnType);           
1105                 mockHttpAttribute("sortColId","1");
1106
1107                 wizardProcessor.processWizardStep(httpServletRequest);
1108                 Mockito.verify(wizardProcessor, Mockito.times(1)).processWizardStep(httpServletRequest);
1109         }
1110         
1111         
1112         @Test
1113         public void testProcessWizardStep_processSortAddEdit_case2() throws Exception {
1114                 mockHttpParameter(AppConstants.RI_WIZARD_ACTION, AppConstants.WS_SORTING);
1115                 mockHttpAttribute(AppConstants.RI_REPORT_ID,REPORT_ID);
1116                 mockHttpAttribute("showDashboardOptions","");
1117                 mockHttpAttribute(AppConstants.RI_DETAIL_ID,DETAIL_ID);
1118                 mockHttpAttribute("sortAscDesc","Asc");
1119
1120                 setWizardSteps(AppConstants.WS_SORTING, AppConstants.WSS_EDIT);
1121                                 
1122                 DataColumnType dataColumnType = new DataColumnType();
1123                 
1124                 dataColumnType.setTableId("reportaccess");
1125                 dataColumnType.setDbColName("rep_id");
1126                 dataColumnType.setColName("rep_id");
1127                 dataColumnType.setDbColType("integer");
1128                 
1129                 Mockito.when(reportDefinition.getColumnById(Mockito.anyString())).thenReturn(dataColumnType);           
1130                 mockHttpAttribute("sortColId","1");
1131
1132                 wizardProcessor.processWizardStep(httpServletRequest);
1133                 Mockito.verify(wizardProcessor, Mockito.times(1)).processWizardStep(httpServletRequest);
1134         }
1135         
1136
1137         @Test
1138         public void testProcessWizardStep_processSortOrderAll_case1() throws Exception {
1139                 mockHttpParameter(AppConstants.RI_WIZARD_ACTION, AppConstants.WS_SORTING);
1140                 mockHttpAttribute(AppConstants.RI_REPORT_ID,REPORT_ID);
1141                 mockHttpAttribute("showDashboardOptions","");
1142                 mockHttpAttribute(AppConstants.RI_DETAIL_ID,DETAIL_ID);
1143
1144                 setWizardSteps(AppConstants.WS_SORTING, AppConstants.WSS_ORDER_ALL);
1145
1146                 String[] colId =new String [0];
1147                 String[] colOrder = {"1", "2", "3"};
1148                 String[] sortAscDesc = {"Desc", "Desc", "Desc"};
1149                 
1150                 mockHttpParameterValues("colId", colId);
1151                 mockHttpParameterValues("colOrder", colOrder);
1152                 mockHttpParameterValues("sortAscDesc", sortAscDesc);
1153                 
1154                 DataColumnType dataColumnType = new DataColumnType();
1155                 
1156                 dataColumnType.setTableId("reportaccess");
1157                 dataColumnType.setDbColName("rep_id");
1158                 dataColumnType.setColName("rep_id");
1159                 dataColumnType.setDbColType("integer");
1160                 
1161                 Mockito.when(reportDefinition.getColumnById(Mockito.anyString())).thenReturn(dataColumnType);           
1162                 mockHttpAttribute("sortColId","1");
1163
1164                 wizardProcessor.processWizardStep(httpServletRequest);
1165                 Mockito.verify(wizardProcessor, Mockito.times(1)).processWizardStep(httpServletRequest);
1166         }
1167         
1168         @Test
1169         public void testProcessWizardStep_processSortOrderAll_case2() throws Exception {
1170                 mockHttpParameter(AppConstants.RI_WIZARD_ACTION, AppConstants.WS_SORTING);
1171                 mockHttpAttribute(AppConstants.RI_REPORT_ID,REPORT_ID);
1172                 mockHttpAttribute("showDashboardOptions","");
1173                 mockHttpAttribute(AppConstants.RI_DETAIL_ID,DETAIL_ID);
1174
1175                 setWizardSteps(AppConstants.WS_SORTING, AppConstants.WSS_ORDER_ALL);
1176
1177                 String[] colId = {"REP_ID", "ORDER_NO", "ROLE_ID"};
1178                 String[] sortOrder = {"1", "2", "0"};
1179                 String[] sortAscDesc = {"Desc", "Asc", "Desc"};
1180                 
1181                 mockHttpParameterValues("colId", colId);
1182                 mockHttpParameterValues("sortOrder", sortOrder);
1183                 mockHttpParameterValues("sortAscDesc", sortAscDesc);
1184
1185                 DataColumnType dataColumnType1 = new DataColumnType();
1186                 
1187                 dataColumnType1.setTableId("reportaccess");
1188                 dataColumnType1.setDbColName("REP_ID");
1189                 dataColumnType1.setColName("REP_ID");
1190                 dataColumnType1.setDbColType("INTEGER");
1191                 dataColumnType1.setDisplayName("Report Id");
1192                 dataColumnType1.setOrderByAscDesc("Desc");
1193                 dataColumnType1.setOrderBySeq(1);
1194                 
1195                 DataColumnType dataColumnType2 = new DataColumnType();
1196                 
1197                 dataColumnType2.setTableId("reportaccess");
1198                 dataColumnType2.setDbColName("ORDER_NO");
1199                 dataColumnType2.setColName("ORDER_NO");
1200                 dataColumnType2.setDbColType("INTEGER");
1201                 dataColumnType2.setDisplayName("Order No");
1202                 dataColumnType2.setOrderByAscDesc("Desc");
1203                 dataColumnType2.setOrderBySeq(1);
1204
1205                 DataColumnType dataColumnType3 = new DataColumnType();
1206                 
1207                 dataColumnType3.setTableId("reportaccess");
1208                 dataColumnType3.setDbColName("ROLE_ID");
1209                 dataColumnType3.setColName("ROLE_ID");
1210                 dataColumnType3.setDbColType("INTEGER");
1211                 dataColumnType3.setDisplayName("Role Id");
1212                 dataColumnType3.setOrderByAscDesc("Desc");
1213                 dataColumnType3.setOrderBySeq(0);
1214
1215                 List<DataColumnType> listDataColumnType = new ArrayList<DataColumnType>();
1216                 listDataColumnType.add(dataColumnType1);
1217                 listDataColumnType.add(dataColumnType2);
1218                 
1219                 Mockito.when(reportDefinition.getAllColumns()).thenReturn(listDataColumnType);
1220                 
1221                 Mockito.when(reportHandler.loadReportDefinition(httpServletRequest, "1001")).thenReturn(reportDefinition);
1222                 
1223                 Mockito.when(reportDefinition.getColumnById(Mockito.anyString())).thenAnswer(new Answer<DataColumnType>() {
1224                         @Override
1225                         public DataColumnType answer(InvocationOnMock invocation) throws Throwable {
1226                               Object[] args = invocation.getArguments();
1227                               String inputString = (String) args[0];
1228                               
1229                               if ("REP_ID".equals(inputString))
1230                                   return dataColumnType1;
1231                                   
1232                               else if("ORDER_NO".equals(inputString))
1233                                   return dataColumnType2;
1234                               
1235                                else
1236                                   return null;
1237
1238                         }
1239                 } );
1240
1241                 mockHttpAttribute("sortColId","1");
1242                 wizardProcessor.processWizardStep(httpServletRequest);
1243                 Mockito.verify(wizardProcessor, Mockito.times(1)).processWizardStep(httpServletRequest);
1244         }
1245         
1246         @Test
1247         public void testProcessWizardStep_processSortDelete_case1() throws Exception {
1248                 mockHttpParameter(AppConstants.RI_WIZARD_ACTION, AppConstants.WA_DELETE);
1249                 mockHttpAttribute(AppConstants.RI_REPORT_ID,REPORT_ID);
1250                 mockHttpAttribute("showDashboardOptions","");
1251                 mockHttpAttribute(AppConstants.RI_DETAIL_ID,DETAIL_ID);
1252
1253                 setWizardSteps(AppConstants.WS_SORTING, AppConstants.WA_DELETE);
1254                 wizardProcessor.processWizardStep(httpServletRequest);
1255                 Mockito.verify(wizardProcessor, Mockito.times(1)).processWizardStep(httpServletRequest);
1256         }
1257         
1258
1259         @Test
1260         public void testProcessWizardStep_processSortMoveUp_case1() throws Exception {
1261                 mockHttpParameter(AppConstants.RI_WIZARD_ACTION, AppConstants.WA_MOVE_UP);
1262                 mockHttpAttribute(AppConstants.RI_REPORT_ID,REPORT_ID);
1263                 mockHttpAttribute("showDashboardOptions","");
1264                 mockHttpAttribute(AppConstants.RI_DETAIL_ID,DETAIL_ID);
1265
1266                 setWizardSteps(AppConstants.WS_SORTING, AppConstants.WA_MOVE_UP);
1267                 wizardProcessor.processWizardStep(httpServletRequest);
1268                 Mockito.verify(wizardProcessor, Mockito.times(1)).processWizardStep(httpServletRequest);
1269         }
1270         
1271
1272         @Test
1273         public void testProcessWizardStep_processSortMoveDown_case1() throws Exception {
1274                 mockHttpParameter(AppConstants.RI_WIZARD_ACTION, AppConstants.WA_MOVE_DOWN);
1275                 mockHttpAttribute(AppConstants.RI_REPORT_ID,REPORT_ID);
1276                 mockHttpAttribute("showDashboardOptions","");
1277                 mockHttpAttribute(AppConstants.RI_DETAIL_ID,DETAIL_ID);
1278
1279                 setWizardSteps(AppConstants.WS_SORTING, AppConstants.WA_MOVE_DOWN);
1280                 wizardProcessor.processWizardStep(httpServletRequest);
1281                 Mockito.verify(wizardProcessor, Mockito.times(1)).processWizardStep(httpServletRequest);
1282         }
1283         
1284         @Test
1285         public void testProcessWizardStep_processAddJavascriptElement_case1() throws Exception {
1286                 mockHttpParameter(AppConstants.RI_WIZARD_ACTION, AppConstants.WSS_ADD);
1287                 mockHttpAttribute(AppConstants.RI_REPORT_ID,REPORT_ID);
1288                 mockHttpAttribute("showDashboardOptions","");
1289                 mockHttpAttribute(AppConstants.RI_DETAIL_ID,DETAIL_ID);
1290
1291                 setWizardSteps(AppConstants.WS_JAVASCRIPT, AppConstants.WSS_ADD);
1292                 JavascriptItemType javascriptItemType = new JavascriptItemType();
1293
1294                 Mockito.when(reportDefinition.addJavascriptType(Mockito.anyObject(), Mockito.anyString())).thenReturn(javascriptItemType);
1295                 wizardProcessor.processWizardStep(httpServletRequest);
1296                 Mockito.verify(wizardProcessor, Mockito.times(1)).processWizardStep(httpServletRequest);
1297         }
1298         
1299         @Test
1300         public void testProcessWizardStep_processSaveJavascriptElement_case1() throws Exception {
1301                 mockHttpParameter(AppConstants.RI_WIZARD_ACTION, AppConstants.WA_SAVE);
1302                 mockHttpAttribute(AppConstants.RI_REPORT_ID,REPORT_ID);
1303                 mockHttpAttribute("showDashboardOptions","");
1304                 mockHttpAttribute(AppConstants.RI_DETAIL_ID,DETAIL_ID);
1305
1306                 setWizardSteps(AppConstants.WS_JAVASCRIPT, AppConstants.WA_SAVE);
1307
1308                 mockHttpAttribute(AppConstants.RI_JAVASCRIPT, "document.getElementById(\"REP_ID\");");
1309                 mockHttpAttribute(AppConstants.RI_JAVASCRIPT_ITEM_ID, "1");
1310                 mockHttpAttribute("javascriptFormField-1", "-1");
1311
1312                 JavascriptItemType javascriptItemType = new JavascriptItemType();
1313                 Mockito.when(reportDefinition.addJavascriptType(Mockito.anyObject(), Mockito.anyString())).thenReturn(javascriptItemType);
1314                                 
1315                 wizardProcessor.processWizardStep(httpServletRequest);
1316                 Mockito.verify(wizardProcessor, Mockito.times(1)).processWizardStep(httpServletRequest);
1317         }       
1318         
1319         @Test
1320         public void testProcessWizardStep_processSaveJavascriptElement_case2() throws Exception {
1321                 mockHttpParameter(AppConstants.RI_WIZARD_ACTION, AppConstants.WA_SAVE);
1322                 mockHttpAttribute(AppConstants.RI_REPORT_ID,REPORT_ID);
1323                 mockHttpAttribute("showDashboardOptions","");
1324                 mockHttpAttribute(AppConstants.RI_DETAIL_ID,DETAIL_ID);
1325
1326                 setWizardSteps(AppConstants.WS_JAVASCRIPT, AppConstants.WA_SAVE);
1327
1328                 mockHttpAttribute(AppConstants.RI_JAVASCRIPT, "document.getElementById(\"REP_ID\");");
1329                 mockHttpAttribute(AppConstants.RI_JAVASCRIPT_ITEM_ID, "-1");
1330
1331                 mockHttpAttribute("callText--1", "document.getElementById(\\\"REP_ID\\\");");
1332                 mockHttpAttribute("javascriptFormField--1", "1");
1333                 
1334                 JavascriptItemType javascriptItemType = new JavascriptItemType();
1335                 Mockito.when(reportDefinition.addJavascriptType(Mockito.anyObject(), Mockito.anyString())).thenReturn(javascriptItemType);
1336                 
1337                 wizardProcessor.processWizardStep(httpServletRequest);
1338                 Mockito.verify(wizardProcessor, Mockito.times(1)).processWizardStep(httpServletRequest);
1339         }               
1340         
1341         @Test
1342         public void testProcessWizardStep_processSaveJavascriptElement_case3() throws Exception {
1343                 mockHttpParameter(AppConstants.RI_WIZARD_ACTION, AppConstants.WA_SAVE);
1344                 mockHttpAttribute(AppConstants.RI_REPORT_ID,REPORT_ID);
1345                 mockHttpAttribute("showDashboardOptions","");
1346                 mockHttpAttribute(AppConstants.RI_DETAIL_ID,DETAIL_ID);
1347
1348                 setWizardSteps(AppConstants.WS_JAVASCRIPT, AppConstants.WA_SAVE);
1349         
1350                 mockHttpAttribute(AppConstants.RI_JAVASCRIPT, "document.getElementById(\"REP_ID\");");
1351                 mockHttpAttribute(AppConstants.RI_JAVASCRIPT_ITEM_ID, "-1");
1352                 mockHttpAttribute("callText--1", "document.getElementById(\\\"REP_ID\\\");");
1353                 mockHttpAttribute("javascriptFormField--1", "os1");
1354                 
1355                 JavascriptItemType javascriptItemType = new JavascriptItemType();
1356                 Mockito.when(reportDefinition.addJavascriptType(Mockito.anyObject(), Mockito.anyString())).thenReturn(javascriptItemType);
1357
1358                 wizardProcessor.processWizardStep(httpServletRequest);
1359                 Mockito.verify(wizardProcessor, Mockito.times(1)).processWizardStep(httpServletRequest);
1360         }               
1361         
1362         @Test
1363         public void testProcessWizardStep_processDeleteJavascriptElement_case1() throws Exception {
1364                 mockHttpParameter(AppConstants.RI_WIZARD_ACTION, AppConstants.WA_DELETE);
1365                 mockHttpAttribute(AppConstants.RI_REPORT_ID,REPORT_ID);
1366                 mockHttpAttribute("showDashboardOptions","");
1367                 mockHttpAttribute(AppConstants.RI_DETAIL_ID,DETAIL_ID);
1368
1369                 mockHttpAttribute(AppConstants.RI_JAVASCRIPT_ITEM_ID, "-1");
1370
1371                 setWizardSteps(AppConstants.WS_JAVASCRIPT, AppConstants.WA_DELETE);
1372                 
1373                 Mockito.when(reportDefinition.deleteJavascriptType(Mockito.anyString())).thenReturn(false);
1374                 wizardProcessor.processWizardStep(httpServletRequest);
1375                 
1376                 Mockito.when(reportDefinition.deleteJavascriptType(Mockito.anyString())).thenReturn(true);
1377                 wizardProcessor.processWizardStep(httpServletRequest);
1378
1379                 Mockito.verify(wizardProcessor, Mockito.times(2)).processWizardStep(httpServletRequest);
1380         }
1381         
1382         @Test
1383         public void testProcessWizardStep_processJavascript_case1() throws Exception {
1384
1385                 mockHttpParameter(AppConstants.RI_WIZARD_ACTION, AppConstants.WA_MOVE_UP);
1386                 mockHttpAttribute(AppConstants.RI_REPORT_ID,REPORT_ID);
1387                 mockHttpAttribute("showDashboardOptions","");
1388                 mockHttpAttribute(AppConstants.RI_DETAIL_ID,DETAIL_ID);
1389
1390                 mockHttpAttribute(AppConstants.RI_JAVASCRIPT_ITEM_ID, "-1");
1391
1392                 setWizardSteps(AppConstants.WS_JAVASCRIPT, AppConstants.WA_SAVE);
1393
1394                 mockHttpAttribute(AppConstants.RI_JAVASCRIPT, "document.getElementById(\"REP_ID\");");
1395                 mockHttpAttribute(AppConstants.RI_JAVASCRIPT_ITEM_ID, "1");
1396                 mockHttpAttribute("javascriptFormField-1", "-1");
1397                 JavascriptItemType javascriptItemType = new JavascriptItemType();
1398                 Mockito.when(reportDefinition.addJavascriptType(Mockito.anyObject(), Mockito.anyString())).thenReturn(javascriptItemType);
1399                 
1400                 wizardProcessor.processWizardStep(httpServletRequest);
1401                 Mockito.verify(wizardProcessor, Mockito.times(1)).processWizardStep(httpServletRequest);
1402
1403         }       
1404         
1405
1406         @Test
1407         public void testProcessWizardStep_processChart_MultiplePieChart_case1() throws Exception {
1408                 
1409                 mockHttpParameter(AppConstants.RI_WIZARD_ACTION, "WIZ_ACTION");
1410                 mockHttpAttribute(AppConstants.RI_REPORT_ID,REPORT_ID);
1411                 mockHttpAttribute("showDashboardOptions","");
1412                 mockHttpAttribute(AppConstants.RI_DETAIL_ID,DETAIL_ID);
1413                 mockHttpAttribute("blueBarField", "REPORT ID");
1414
1415                 setWizardSteps(AppConstants.WS_CHART, AppConstants.WA_SAVE);
1416                 
1417                 mockHttpAttribute("chartType", AppConstants.GT_PIE_MULTIPLE);
1418                 mockHttpAttribute("chartTypeFixed", "N");
1419                 mockHttpAttribute("legendCol", "MULTI COLUMN");
1420                 mockHttpAttribute("leftAxisLabel", "USER");
1421                 mockHttpAttribute("rightAxisLabel", "TIME");
1422                 mockHttpAttribute("chartWidth", "500");
1423                 mockHttpAttribute("chartHeight", "500");
1424                 mockHttpAttribute("multiSeries", "N");
1425                 mockHttpAttribute("lastSeriesALineChart", "N");
1426                 mockHttpAttribute("lastSeriesABarChart", "N");          
1427                 mockHttpAttribute("animatedOption", "animate");
1428                 
1429                 mockHttpAttribute("multiplePieOrder", "N");
1430                 mockHttpAttribute("multiplePieLabelDisplay", "N");
1431                 mockHttpAttribute("chartDisplay", "N");
1432                 mockHttpAttribute("animatedOption", "N");
1433                 mockHttpAttribute("multiplePieOrderInRunPage", "Y");
1434                 mockHttpAttribute("multiplePieLabelDisplayInRunPage", "Y");
1435                 mockHttpAttribute("chartDisplayInRunPage", "Y");        
1436                 
1437                 mockHttpAttribute("yAxisLowerLimit", "500");
1438                 mockHttpAttribute("yAxisUpperLimit", "1200");
1439                 mockHttpAttribute("labelAngle", "N");
1440                 mockHttpAttribute("legendPosition", "Top");
1441                 mockHttpAttribute("labelAngle", "N");
1442                 mockHttpAttribute("maxLabelsInDomainAxis", "N");
1443                 mockHttpAttribute("hideLegend", "labelAngle");
1444                 mockHttpAttribute("showLegendDisplayOptionsInRunPage", "N");
1445                 mockHttpAttribute("hideTooltips", "N");
1446                 mockHttpAttribute("keepAsString", "N");
1447                 
1448                 mockHttpAttribute("drillDownReport", "-1");
1449                 
1450                 mockHttpAttribute("newChart1Axis", "1");
1451                 mockHttpAttribute("valueCol1", "");
1452                 mockHttpAttribute("valueCol1Color", "1");
1453                 mockHttpAttribute("valueColAxis", "1");
1454                 mockHttpAttribute("chartGroupAxis", "1");
1455                 mockHttpAttribute("YAxisLabel", "1");           
1456                 
1457                 DataColumnType dataColumnType = new DataColumnType();
1458                 ChartDrillOptions chartDrillOptions = new ChartDrillOptions();
1459
1460                 List<ChartDrillFormfield> listChartDrillFormfield = chartDrillOptions.getTargetFormfield();
1461                 ChartDrillFormfield chartDrillFormfield = new ChartDrillFormfield();
1462                 chartDrillFormfield.setFormfield("REPORT_ID");
1463                 listChartDrillFormfield.add(chartDrillFormfield);
1464                 
1465                 Mockito.when(reportDefinition.getColumnById(Mockito.anyString())).thenReturn(dataColumnType);
1466                 Mockito.when(reportDefinition.getChartDrillOptions()).thenReturn(chartDrillOptions);
1467                                 
1468                 wizardProcessor.processWizardStep(httpServletRequest);
1469         
1470                 
1471                 ChartAdditionalOptions chartAdditionalOptions = new ChartAdditionalOptions();
1472                 Mockito.when(reportDefinition.getChartAdditionalOptions()).thenReturn(chartAdditionalOptions);
1473
1474                 mockHttpAttribute("leftAxisLabel", "");
1475                 mockHttpAttribute("rightAxisLabel", "");
1476                 
1477                 wizardProcessor.processWizardStep(httpServletRequest);
1478         
1479                 Mockito.verify(wizardProcessor, Mockito.times(2)).processWizardStep(httpServletRequest);
1480         }       
1481
1482         @Test
1483         public void testProcessWizardStep_processChart_MultiplePieChart_case2() throws Exception {
1484                 
1485                 mockHttpParameter(AppConstants.RI_WIZARD_ACTION, "WIZ_ACTION");
1486                 mockHttpAttribute(AppConstants.RI_REPORT_ID,REPORT_ID);
1487                 mockHttpAttribute("showDashboardOptions","");
1488                 mockHttpAttribute(AppConstants.RI_DETAIL_ID,DETAIL_ID);
1489                 mockHttpAttribute("blueBarField", "REPORT ID");
1490
1491                 setWizardSteps(AppConstants.WS_CHART, AppConstants.WA_SAVE);
1492
1493                 mockHttpAttribute("chartType", AppConstants.GT_PIE_MULTIPLE);
1494                 mockHttpAttribute("chartTypeFixed", "N");
1495                 mockHttpAttribute("legendCol", "REP_ID");
1496                 mockHttpAttribute("leftAxisLabel", "");
1497                 mockHttpAttribute("rightAxisLabel", "");
1498                 mockHttpAttribute("chartWidth", "500");
1499                 mockHttpAttribute("chartHeight", "500");
1500                 mockHttpAttribute("multiSeries", "N");
1501                 mockHttpAttribute("lastSeriesALineChart", "N");
1502                 mockHttpAttribute("lastSeriesABarChart", "N");          
1503                 mockHttpAttribute("animatedOption", "animate");
1504                 
1505                 mockHttpAttribute("multiplePieOrder", "N");
1506                 mockHttpAttribute("multiplePieLabelDisplay", "N");
1507                 mockHttpAttribute("chartDisplay", "N");
1508                 mockHttpAttribute("animatedOption", "N");
1509                 mockHttpAttribute("multiplePieOrderInRunPage", "Y");
1510                 mockHttpAttribute("multiplePieLabelDisplayInRunPage", "Y");
1511                 mockHttpAttribute("chartDisplayInRunPage", "Y");        
1512                 
1513                 mockHttpAttribute("yAxisLowerLimit", "500");
1514                 mockHttpAttribute("yAxisUpperLimit", "1200");
1515                 mockHttpAttribute("labelAngle", "N");
1516                 mockHttpAttribute("legendPosition", "Top");
1517                 mockHttpAttribute("labelAngle", "N");
1518                 mockHttpAttribute("maxLabelsInDomainAxis", "N");
1519                 mockHttpAttribute("hideLegend", "labelAngle");
1520                 mockHttpAttribute("showLegendDisplayOptionsInRunPage", "N");
1521                 mockHttpAttribute("hideTooltips", "N");
1522                 mockHttpAttribute("keepAsString", "N");
1523                 
1524                 mockHttpAttribute("drillDownReport", "-1");
1525                 
1526                 mockHttpAttribute("newChart1Axis", "1");
1527                 mockHttpAttribute("valueCol1", "");
1528                 mockHttpAttribute("valueCol1Color", "1");
1529                 mockHttpAttribute("valueColAxis", "1");
1530                 mockHttpAttribute("chartGroupAxis", "1");
1531                 mockHttpAttribute("YAxisLabel", "1");           
1532                 
1533                 DataColumnType dataColumnType = new DataColumnType();
1534
1535                 Mockito.when(reportDefinition.getColumnById(Mockito.anyString())).thenReturn(dataColumnType);
1536
1537                 ChartAdditionalOptions chartAdditionalOptions = new ChartAdditionalOptions();
1538                 Mockito.when(reportDefinition.getChartAdditionalOptions()).thenReturn(chartAdditionalOptions);
1539
1540                 ChartDrillOptions chartDrillOptions = new ChartDrillOptions();
1541
1542                 List<ChartDrillFormfield> listChartDrillFormfield = chartDrillOptions.getTargetFormfield();
1543                 ChartDrillFormfield chartDrillFormfield = new ChartDrillFormfield();
1544                 chartDrillFormfield.setFormfield("REPORT_ID");
1545                 listChartDrillFormfield.add(chartDrillFormfield);
1546
1547                 DataColumnType dataColumnType1 = new DataColumnType();
1548                 
1549                 dataColumnType1.setTableId("reportaccess");
1550                 dataColumnType1.setDbColName("REP_ID");
1551                 dataColumnType1.setColName("REP_ID");
1552                 dataColumnType1.setDbColType("INTEGER");
1553                 dataColumnType1.setDisplayName("Report Id");
1554                 dataColumnType1.setColId("REP_ID");
1555                 dataColumnType1.setColOnChart(AppConstants.GT_COMPARE_PREVYEAR_CHART);
1556
1557                 DataColumnType dataColumnType2 = new DataColumnType();
1558                 
1559                 dataColumnType2.setTableId("reportaccess");
1560                 dataColumnType2.setDbColName("ORDER_NO");
1561                 dataColumnType2.setColName("ORDER_NO");
1562                 dataColumnType2.setDbColType("INTEGER");
1563                 dataColumnType2.setDisplayName("Order No");
1564                 dataColumnType2.setColId("ORDER_NO");
1565                 
1566                 dataColumnType2.setColOnChart(AppConstants.GC_LEGEND);
1567                 
1568                 
1569                 List<DataColumnType> listDataColumnType = new ArrayList<DataColumnType>();
1570                 listDataColumnType.add(dataColumnType1);
1571                 listDataColumnType.add(dataColumnType2);
1572                 
1573                 Mockito.when(reportDefinition.getAllColumns()).thenReturn(listDataColumnType);
1574                 Mockito.when(reportDefinition.getChartDrillOptions()).thenReturn(chartDrillOptions);
1575                                 
1576                 wizardProcessor.processWizardStep(httpServletRequest);
1577
1578                 Mockito.verify(wizardProcessor, Mockito.times(1)).processWizardStep(httpServletRequest);
1579         }       
1580
1581                 
1582         @Test
1583         public void testProcessWizardStep_processChart_RegressionPlotChart_case1() throws Exception {
1584                 mockHttpParameter(AppConstants.RI_WIZARD_ACTION, "WIZ_ACTION");
1585                 mockHttpAttribute(AppConstants.RI_REPORT_ID,REPORT_ID);
1586                 mockHttpAttribute("showDashboardOptions","");
1587                 mockHttpAttribute(AppConstants.RI_DETAIL_ID,DETAIL_ID);
1588                 mockHttpAttribute("blueBarField", "REPORT ID");
1589
1590                 setWizardSteps(AppConstants.WS_CHART, AppConstants.WA_SAVE);
1591
1592                 mockHttpAttribute("chartType", AppConstants.GT_REGRESSION);
1593                 mockHttpAttribute("chartTypeFixed", "N");
1594                 mockHttpAttribute("legendCol", "REP_ID");
1595                 mockHttpAttribute("leftAxisLabel", "");
1596                 mockHttpAttribute("rightAxisLabel", "");
1597                 mockHttpAttribute("chartWidth", "500");
1598                 mockHttpAttribute("chartHeight", "500");
1599                 mockHttpAttribute("multiSeries", "N");
1600                 mockHttpAttribute("lastSeriesALineChart", "N");
1601                 mockHttpAttribute("lastSeriesABarChart", "N");          
1602                 mockHttpAttribute("animatedOption", "animate");
1603                 
1604                 mockHttpAttribute("multiplePieOrder", "N");
1605                 mockHttpAttribute("multiplePieLabelDisplay", "N");
1606                 mockHttpAttribute("chartDisplay", "N");
1607                 mockHttpAttribute("animatedOption", "N");
1608                 mockHttpAttribute("multiplePieOrderInRunPage", "Y");
1609                 mockHttpAttribute("multiplePieLabelDisplayInRunPage", "Y");
1610                 mockHttpAttribute("chartDisplayInRunPage", "Y");        
1611                 
1612                 mockHttpAttribute("yAxisLowerLimit", "500");
1613                 mockHttpAttribute("yAxisUpperLimit", "1200");
1614                 mockHttpAttribute("labelAngle", "N");
1615                 mockHttpAttribute("legendPosition", "Top");
1616                 mockHttpAttribute("labelAngle", "N");
1617                 mockHttpAttribute("maxLabelsInDomainAxis", "N");
1618                 mockHttpAttribute("hideLegend", "labelAngle");
1619                 mockHttpAttribute("showLegendDisplayOptionsInRunPage", "N");
1620                 mockHttpAttribute("hideTooltips", "N");
1621                 mockHttpAttribute("keepAsString", "N");
1622                 
1623                 mockHttpAttribute("drillDownReport", "-1");
1624                 
1625                 mockHttpAttribute("newChart1Axis", "1");
1626                 mockHttpAttribute("valueCol1", "");
1627                 mockHttpAttribute("valueCol1Color", "1");
1628                 mockHttpAttribute("valueColAxis", "1");
1629                 mockHttpAttribute("chartGroupAxis", "1");
1630                 mockHttpAttribute("YAxisLabel", "1");           
1631                 
1632                 mockHttpAttribute("regressionType", "Y");
1633                 mockHttpAttribute("valueLinearRegressionColor", "Y");
1634                 mockHttpAttribute("valueExponentialRegressionColor", "BLUE");
1635                 mockHttpAttribute("regressionPointCustomization", "YELLOW");
1636                 
1637                 mockHttpAttribute("chartSeries", "REP_ID");
1638                 
1639                 DataColumnType dataColumnType = new DataColumnType();
1640
1641                 Mockito.when(reportDefinition.getColumnById(Mockito.anyString())).thenReturn(dataColumnType);
1642
1643                 ChartAdditionalOptions chartAdditionalOptions = new ChartAdditionalOptions();
1644                 Mockito.when(reportDefinition.getChartAdditionalOptions()).thenReturn(chartAdditionalOptions);
1645                 
1646                 ChartDrillOptions chartDrillOptions = new ChartDrillOptions();
1647
1648                 List<ChartDrillFormfield> listChartDrillFormfield = chartDrillOptions.getTargetFormfield();
1649                 ChartDrillFormfield chartDrillFormfield = new ChartDrillFormfield();
1650                 chartDrillFormfield.setFormfield("REPORT_ID");
1651                 listChartDrillFormfield.add(chartDrillFormfield);
1652
1653                 DataColumnType dataColumnType1 = new DataColumnType();
1654                 
1655                 dataColumnType1.setTableId("reportaccess");
1656                 dataColumnType1.setDbColName("REP_ID");
1657                 dataColumnType1.setColName("REP_ID");
1658                 dataColumnType1.setDbColType("INTEGER");
1659                 dataColumnType1.setDisplayName("Report Id");
1660                 dataColumnType1.setColId("REP_ID");
1661                 dataColumnType1.setColOnChart(AppConstants.GT_COMPARE_PREVYEAR_CHART);
1662
1663                 DataColumnType dataColumnType2 = new DataColumnType();
1664                 
1665                 dataColumnType2.setTableId("reportaccess");
1666                 dataColumnType2.setDbColName("ORDER_NO");
1667                 dataColumnType2.setColName("ORDER_NO");
1668                 dataColumnType2.setDbColType("INTEGER");
1669                 dataColumnType2.setDisplayName("Order No");
1670                 dataColumnType2.setColId("ORDER_NO");
1671                 
1672                 dataColumnType2.setColOnChart(AppConstants.GC_LEGEND);
1673                 
1674                 
1675                 List<DataColumnType> listDataColumnType = new ArrayList<DataColumnType>();
1676                 listDataColumnType.add(dataColumnType1);
1677                 listDataColumnType.add(dataColumnType2);
1678                 
1679                 Mockito.when(reportDefinition.getAllColumns()).thenReturn(listDataColumnType);
1680                 
1681                 Mockito.when(reportDefinition.getChartDrillOptions()).thenReturn(chartDrillOptions);
1682                                 
1683                 wizardProcessor.processWizardStep(httpServletRequest);
1684         
1685                 Mockito.verify(wizardProcessor, Mockito.times(1)).processWizardStep(httpServletRequest);
1686
1687         }       
1688
1689         @Test
1690         public void testProcessWizardStep_processChart_RegressionPlotChart_case2() throws Exception {
1691                 
1692                 mockHttpParameter(AppConstants.RI_WIZARD_ACTION, "WIZ_ACTION");
1693                 mockHttpAttribute(AppConstants.RI_REPORT_ID,REPORT_ID);
1694                 mockHttpAttribute("showDashboardOptions","");
1695                 mockHttpAttribute(AppConstants.RI_DETAIL_ID,DETAIL_ID);
1696                 mockHttpAttribute("blueBarField", "REPORT ID");
1697
1698                 setWizardSteps(AppConstants.WS_CHART, AppConstants.WA_SAVE);
1699
1700                 mockHttpAttribute("chartType", AppConstants.GT_REGRESSION);
1701                 mockHttpAttribute("chartTypeFixed", "N");
1702                 mockHttpAttribute("legendCol", "REP_ID");
1703                 mockHttpAttribute("leftAxisLabel", "");
1704                 mockHttpAttribute("rightAxisLabel", "");
1705                 mockHttpAttribute("chartWidth", "500");
1706                 mockHttpAttribute("chartHeight", "500");
1707                 mockHttpAttribute("multiSeries", "N");
1708                 mockHttpAttribute("lastSeriesALineChart", "N");
1709                 mockHttpAttribute("lastSeriesABarChart", "N");          
1710                 mockHttpAttribute("animatedOption", "animate");
1711                 
1712                 mockHttpAttribute("multiplePieOrder", "N");
1713                 mockHttpAttribute("multiplePieLabelDisplay", "N");
1714                 mockHttpAttribute("chartDisplay", "N");
1715                 mockHttpAttribute("animatedOption", "N");
1716                 mockHttpAttribute("multiplePieOrderInRunPage", "Y");
1717                 mockHttpAttribute("multiplePieLabelDisplayInRunPage", "Y");
1718                 mockHttpAttribute("chartDisplayInRunPage", "Y");        
1719                 
1720                 mockHttpAttribute("yAxisLowerLimit", "500");
1721                 mockHttpAttribute("yAxisUpperLimit", "1200");
1722                 mockHttpAttribute("labelAngle", "N");
1723                 mockHttpAttribute("legendPosition", "Top");
1724                 mockHttpAttribute("labelAngle", "N");
1725                 mockHttpAttribute("maxLabelsInDomainAxis", "N");
1726                 mockHttpAttribute("hideLegend", "labelAngle");
1727                 mockHttpAttribute("showLegendDisplayOptionsInRunPage", "N");
1728                 mockHttpAttribute("hideTooltips", "N");
1729                 mockHttpAttribute("keepAsString", "N");
1730                 
1731                 mockHttpAttribute("drillDownReport", "-1");
1732                 
1733                 mockHttpAttribute("newChart1Axis", "1");
1734                 mockHttpAttribute("valueCol1", "");
1735                 mockHttpAttribute("valueCol1Color", "1");
1736                 mockHttpAttribute("valueColAxis", "1");
1737                 mockHttpAttribute("chartGroupAxis", "1");
1738                 mockHttpAttribute("YAxisLabel", "1");           
1739                 
1740                 mockHttpAttribute("regressionType", "");
1741                 mockHttpAttribute("valueLinearRegressionColor", "Y");
1742                 mockHttpAttribute("valueExponentialRegressionColor", "BLUE");
1743                 mockHttpAttribute("regressionPointCustomization", "YELLOW");
1744                 
1745                 mockHttpAttribute("chartSeries", "REP_ID");
1746                 
1747                 DataColumnType dataColumnType = new DataColumnType();
1748
1749                 Mockito.when(reportDefinition.getColumnById(Mockito.anyString())).thenReturn(dataColumnType);
1750
1751                 ChartAdditionalOptions chartAdditionalOptions = new ChartAdditionalOptions();
1752                 Mockito.when(reportDefinition.getChartAdditionalOptions()).thenReturn(chartAdditionalOptions);
1753
1754                 
1755                 ChartDrillOptions chartDrillOptions = new ChartDrillOptions();
1756
1757                 List<ChartDrillFormfield> listChartDrillFormfield = chartDrillOptions.getTargetFormfield();
1758                 ChartDrillFormfield chartDrillFormfield = new ChartDrillFormfield();
1759                 chartDrillFormfield.setFormfield("REPORT_ID");
1760                 listChartDrillFormfield.add(chartDrillFormfield);
1761                 
1762
1763                 DataColumnType dataColumnType1 = new DataColumnType();
1764                 
1765                 dataColumnType1.setTableId("reportaccess");
1766                 dataColumnType1.setDbColName("REP_ID");
1767                 dataColumnType1.setColName("REP_ID");
1768                 dataColumnType1.setDbColType("INTEGER");
1769                 dataColumnType1.setDisplayName("Report Id");
1770                 dataColumnType1.setColId("REP_ID");
1771                 dataColumnType1.setColOnChart(AppConstants.GT_COMPARE_PREVYEAR_CHART);
1772
1773                 DataColumnType dataColumnType2 = new DataColumnType();
1774                 
1775                 dataColumnType2.setTableId("reportaccess");
1776                 dataColumnType2.setDbColName("ORDER_NO");
1777                 dataColumnType2.setColName("ORDER_NO");
1778                 dataColumnType2.setDbColType("INTEGER");
1779                 dataColumnType2.setDisplayName("Order No");
1780                 dataColumnType2.setColId("ORDER_NO");
1781                 
1782                 dataColumnType2.setColOnChart(AppConstants.GC_LEGEND);
1783                 
1784                 
1785                 List<DataColumnType> listDataColumnType = new ArrayList<DataColumnType>();
1786                 listDataColumnType.add(dataColumnType1);
1787                 listDataColumnType.add(dataColumnType2);
1788                 
1789                 Mockito.when(reportDefinition.getAllColumns()).thenReturn(listDataColumnType);
1790                 
1791                 Mockito.when(reportDefinition.getChartDrillOptions()).thenReturn(chartDrillOptions);
1792                                 
1793                 wizardProcessor.processWizardStep(httpServletRequest);
1794         
1795                 Mockito.verify(wizardProcessor, Mockito.times(1)).processWizardStep(httpServletRequest);
1796
1797         }       
1798         
1799         @Test
1800         public void testProcessWizardStep_processChart_BarChart3D_case1() throws Exception {
1801                 mockHttpParameter(AppConstants.RI_WIZARD_ACTION, "WIZ_ACTION");
1802                 mockHttpAttribute(AppConstants.RI_REPORT_ID,REPORT_ID);
1803                 mockHttpAttribute("showDashboardOptions","");
1804                 mockHttpAttribute(AppConstants.RI_DETAIL_ID,DETAIL_ID);
1805                 mockHttpAttribute("blueBarField", "REPORT ID");
1806
1807                 setWizardSteps(AppConstants.WS_CHART, AppConstants.WA_SAVE);
1808
1809                 mockHttpAttribute("chartType", AppConstants.GT_BAR_3D);
1810                 mockHttpAttribute("chartTypeFixed", "N");
1811                 mockHttpAttribute("legendCol", "REP_ID");
1812                 mockHttpAttribute("leftAxisLabel", "");
1813                 mockHttpAttribute("rightAxisLabel", "");
1814                 mockHttpAttribute("chartWidth", "500");
1815                 mockHttpAttribute("chartHeight", "500");
1816                 mockHttpAttribute("multiSeries", "N");
1817                 mockHttpAttribute("lastSeriesALineChart", "N");
1818                 mockHttpAttribute("lastSeriesABarChart", "N");          
1819                 mockHttpAttribute("animatedOption", "animate");
1820         
1821                 mockHttpAttribute("chartGroup", "Group");
1822                 mockHttpAttribute("drillDownReport", "DrillDown");              
1823                 mockHttpAttribute("yAxis", "Y");
1824                 mockHttpAttribute("drillDownReport", "-1");
1825                 
1826                 mockHttpAttribute("drillDownXAxisFormfield", "1");
1827                 mockHttpAttribute("drillDownYAxisFormfield", "1");
1828                 mockHttpAttribute("drillDownSeriesAxisFormfield", "1");
1829                 
1830                 mockHttpAttribute("yAxisLowerLimit", "500");
1831                 mockHttpAttribute("yAxisUpperLimit", "1200");
1832                 mockHttpAttribute("labelAngle", "N");
1833                 mockHttpAttribute("legendPosition", "Top");
1834                 mockHttpAttribute("labelAngle", "N");
1835                 mockHttpAttribute("maxLabelsInDomainAxis", "N");
1836                 mockHttpAttribute("hideLegend", "labelAngle");
1837                 mockHttpAttribute("showLegendDisplayOptionsInRunPage", "N");
1838                 mockHttpAttribute("hideTooltips", "N");
1839                 mockHttpAttribute("keepAsString", "N");
1840                 
1841                 mockHttpAttribute("drillDownReport", "-1");
1842                 
1843                 mockHttpAttribute("newChart1Axis", "1");
1844                 mockHttpAttribute("valueCol1", "");
1845                 mockHttpAttribute("valueCol1Color", "1");
1846                 mockHttpAttribute("valueColAxis", "1");
1847                 mockHttpAttribute("chartGroupAxis", "1");
1848                 mockHttpAttribute("YAxisLabel", "1");           
1849                 
1850                 
1851                 mockHttpAttribute("chartOrientation", "1");             
1852                 mockHttpAttribute("secondaryChartRenderer", "1");               
1853                 mockHttpAttribute("chartDisplay", "1");         
1854                 mockHttpAttribute("chartOrientationInRunPage", "1");            
1855                 mockHttpAttribute("secondaryChartRendererInRunPage", "1");              
1856                 mockHttpAttribute("chartDisplayInRunPage", "1");                
1857
1858                 mockHttpAttribute("chartSeries", "REP_ID");
1859                 
1860                 DataColumnType dataColumnType = new DataColumnType();
1861
1862                 Mockito.when(reportDefinition.getColumnById(Mockito.anyString())).thenReturn(dataColumnType);
1863
1864                 ChartAdditionalOptions chartAdditionalOptions = new ChartAdditionalOptions();
1865                 Mockito.when(reportDefinition.getChartAdditionalOptions()).thenReturn(chartAdditionalOptions);
1866
1867                 ChartDrillOptions chartDrillOptions = new ChartDrillOptions();
1868
1869                 List<ChartDrillFormfield> listChartDrillFormfield = chartDrillOptions.getTargetFormfield();
1870                 ChartDrillFormfield chartDrillFormfield = new ChartDrillFormfield();
1871                 chartDrillFormfield.setFormfield("REPORT_ID");
1872                 listChartDrillFormfield.add(chartDrillFormfield);
1873
1874                 DataColumnType dataColumnType1 = new DataColumnType();
1875                 
1876                 dataColumnType1.setTableId("reportaccess");
1877                 dataColumnType1.setDbColName("REP_ID");
1878                 dataColumnType1.setColName("REP_ID");
1879                 dataColumnType1.setDbColType("INTEGER");
1880                 dataColumnType1.setDisplayName("Report Id");
1881                 dataColumnType1.setColId("REP_ID");
1882                 dataColumnType1.setColOnChart(AppConstants.GT_COMPARE_PREVYEAR_CHART);
1883
1884                 DataColumnType dataColumnType2 = new DataColumnType();
1885                 
1886                 dataColumnType2.setTableId("reportaccess");
1887                 dataColumnType2.setDbColName("ORDER_NO");
1888                 dataColumnType2.setColName("ORDER_NO");
1889                 dataColumnType2.setDbColType("INTEGER");
1890                 dataColumnType2.setDisplayName("Order No");
1891                 dataColumnType2.setColId("ORDER_NO");
1892                 
1893                 dataColumnType2.setColOnChart(AppConstants.GC_LEGEND);
1894                 
1895                 List<DataColumnType> listDataColumnType = new ArrayList<DataColumnType>();
1896                 listDataColumnType.add(dataColumnType1);
1897                 listDataColumnType.add(dataColumnType2);
1898                 
1899                 Mockito.when(reportDefinition.getAllColumns()).thenReturn(listDataColumnType);
1900                 
1901                 Mockito.when(reportDefinition.getChartDrillOptions()).thenReturn(chartDrillOptions);
1902                                 
1903                 wizardProcessor.processWizardStep(httpServletRequest);
1904         
1905                 Mockito.verify(wizardProcessor, Mockito.times(1)).processWizardStep(httpServletRequest);
1906         }               
1907         
1908         @Test
1909         public void testProcessWizardStep_processChart_BarChart3D_case2() throws Exception {
1910                 mockHttpParameter(AppConstants.RI_WIZARD_ACTION, "WIZ_ACTION");
1911                 mockHttpAttribute(AppConstants.RI_REPORT_ID,REPORT_ID);
1912                 mockHttpAttribute("showDashboardOptions","");
1913                 mockHttpAttribute(AppConstants.RI_DETAIL_ID,DETAIL_ID);
1914                 mockHttpAttribute("blueBarField", "REPORT ID");
1915
1916                 setWizardSteps(AppConstants.WS_CHART, AppConstants.WA_SAVE);
1917
1918                 mockHttpAttribute("chartType", AppConstants.GT_BAR_3D);
1919                 mockHttpAttribute("chartTypeFixed", "N");
1920                 mockHttpAttribute("legendCol", "REP_ID");
1921                 mockHttpAttribute("leftAxisLabel", "");
1922                 mockHttpAttribute("rightAxisLabel", "");
1923                 mockHttpAttribute("chartWidth", "500");
1924                 mockHttpAttribute("chartHeight", "500");
1925                 mockHttpAttribute("multiSeries", "N");
1926                 mockHttpAttribute("lastSeriesALineChart", "N");
1927                 mockHttpAttribute("lastSeriesABarChart", "N");          
1928                 mockHttpAttribute("animatedOption", "animate");
1929         
1930                 mockHttpAttribute("chartGroup", "Group");
1931                 mockHttpAttribute("drillDownReport", "DrillDown");              
1932                 mockHttpAttribute("yAxis", "Y");
1933                 mockHttpAttribute("drillDownReport", "-1");
1934                 
1935                 mockHttpAttribute("drillDownXAxisFormfield", "-1");
1936                 mockHttpAttribute("drillDownYAxisFormfield", "-1");
1937                 mockHttpAttribute("drillDownSeriesAxisFormfield", "-1");
1938                 
1939                 
1940                 mockHttpAttribute("yAxisLowerLimit", "500");
1941                 mockHttpAttribute("yAxisUpperLimit", "1200");
1942                 mockHttpAttribute("labelAngle", "N");
1943                 mockHttpAttribute("legendPosition", "Top");
1944                 mockHttpAttribute("labelAngle", "N");
1945                 mockHttpAttribute("maxLabelsInDomainAxis", "N");
1946                 mockHttpAttribute("hideLegend", "labelAngle");
1947                 mockHttpAttribute("showLegendDisplayOptionsInRunPage", "N");
1948                 mockHttpAttribute("hideTooltips", "N");
1949                 mockHttpAttribute("keepAsString", "N");
1950                 
1951                 mockHttpAttribute("drillDownReport", "-1");
1952                 
1953                 mockHttpAttribute("newChart1Axis", "1");
1954                 mockHttpAttribute("valueCol1", "");
1955                 mockHttpAttribute("valueCol1Color", "1");
1956                 mockHttpAttribute("valueColAxis", "1");
1957                 mockHttpAttribute("chartGroupAxis", "1");
1958                 mockHttpAttribute("YAxisLabel", "1");           
1959                 
1960                 mockHttpAttribute("chartOrientation", "1");             
1961                 mockHttpAttribute("secondaryChartRenderer", "1");               
1962                 mockHttpAttribute("chartDisplay", "1");         
1963                 mockHttpAttribute("chartOrientationInRunPage", "1");            
1964                 mockHttpAttribute("secondaryChartRendererInRunPage", "1");              
1965                 mockHttpAttribute("chartDisplayInRunPage", "1");                
1966                 
1967                 mockHttpAttribute("chartSeries", "REP_ID");
1968                 
1969                 DataColumnType dataColumnType = new DataColumnType();
1970
1971                 Mockito.when(reportDefinition.getColumnById(Mockito.anyString())).thenReturn(dataColumnType);
1972
1973                 ChartAdditionalOptions chartAdditionalOptions = new ChartAdditionalOptions();
1974                 Mockito.when(reportDefinition.getChartAdditionalOptions()).thenReturn(chartAdditionalOptions);
1975                 
1976                 ChartDrillOptions chartDrillOptions = new ChartDrillOptions();
1977
1978                 List<ChartDrillFormfield> listChartDrillFormfield = chartDrillOptions.getTargetFormfield();
1979                 ChartDrillFormfield chartDrillFormfield = new ChartDrillFormfield();
1980                 chartDrillFormfield.setFormfield("REPORT_ID");
1981                 listChartDrillFormfield.add(chartDrillFormfield);
1982                 
1983
1984                 DataColumnType dataColumnType1 = new DataColumnType();
1985                 
1986                 dataColumnType1.setTableId("reportaccess");
1987                 dataColumnType1.setDbColName("REP_ID");
1988                 dataColumnType1.setColName("REP_ID");
1989                 dataColumnType1.setDbColType("INTEGER");
1990                 dataColumnType1.setDisplayName("Report Id");
1991                 dataColumnType1.setColId("REP_ID");
1992                 dataColumnType1.setColOnChart(AppConstants.GT_COMPARE_PREVYEAR_CHART);
1993
1994                 DataColumnType dataColumnType2 = new DataColumnType();
1995                 
1996                 dataColumnType2.setTableId("reportaccess");
1997                 dataColumnType2.setDbColName("ORDER_NO");
1998                 dataColumnType2.setColName("ORDER_NO");
1999                 dataColumnType2.setDbColType("INTEGER");
2000                 dataColumnType2.setDisplayName("Order No");
2001                 dataColumnType2.setColId("ORDER_NO");
2002                 
2003                 dataColumnType2.setColOnChart(AppConstants.GC_LEGEND);
2004                 
2005                 
2006                 List<DataColumnType> listDataColumnType = new ArrayList<DataColumnType>();
2007                 listDataColumnType.add(dataColumnType1);
2008                 listDataColumnType.add(dataColumnType2);
2009                 
2010                 Mockito.when(reportDefinition.getAllColumns()).thenReturn(listDataColumnType);
2011                 
2012                 Mockito.when(reportDefinition.getChartDrillOptions()).thenReturn(chartDrillOptions);
2013                                 
2014                 wizardProcessor.processWizardStep(httpServletRequest);
2015         
2016                 Mockito.verify(wizardProcessor, Mockito.times(1)).processWizardStep(httpServletRequest);
2017         }               
2018         
2019         
2020         @Test
2021         public void testProcessWizardStep_processChart_LineChart_case1() throws Exception {
2022                 mockHttpParameter(AppConstants.RI_WIZARD_ACTION, "WIZ_ACTION");
2023                 mockHttpAttribute(AppConstants.RI_REPORT_ID,REPORT_ID);
2024                 mockHttpAttribute("showDashboardOptions","");
2025                 mockHttpAttribute(AppConstants.RI_DETAIL_ID,DETAIL_ID);
2026                 mockHttpAttribute("blueBarField", "REPORT ID");
2027
2028                 setWizardSteps(AppConstants.WS_CHART, AppConstants.WA_SAVE);
2029
2030                 mockHttpAttribute("chartType", AppConstants.GT_LINE);
2031                 mockHttpAttribute("chartTypeFixed", "N");
2032                 mockHttpAttribute("legendCol", "REP_ID");
2033                 mockHttpAttribute("leftAxisLabel", "");
2034                 mockHttpAttribute("rightAxisLabel", "");
2035                 mockHttpAttribute("chartWidth", "500");
2036                 mockHttpAttribute("chartHeight", "500");
2037                 mockHttpAttribute("multiSeries", "N");
2038                 mockHttpAttribute("lastSeriesALineChart", "N");
2039                 mockHttpAttribute("lastSeriesABarChart", "N");          
2040                 mockHttpAttribute("animatedOption", "animate");
2041         
2042                 mockHttpAttribute("chartGroup", "Group");
2043                 mockHttpAttribute("drillDownReport", "DrillDown");              
2044                 mockHttpAttribute("yAxis", "Y");
2045                 mockHttpAttribute("drillDownReport", "-1");
2046                 
2047                 mockHttpAttribute("drillDownXAxisFormfield", "-1");
2048                 mockHttpAttribute("drillDownYAxisFormfield", "-1");
2049                 mockHttpAttribute("drillDownSeriesAxisFormfield", "-1");
2050                 
2051                 
2052                 mockHttpAttribute("yAxisLowerLimit", "500");
2053                 mockHttpAttribute("yAxisUpperLimit", "1200");
2054                 mockHttpAttribute("labelAngle", "N");
2055                 mockHttpAttribute("legendPosition", "Top");
2056                 mockHttpAttribute("labelAngle", "N");
2057                 mockHttpAttribute("maxLabelsInDomainAxis", "N");
2058                 mockHttpAttribute("hideLegend", "labelAngle");
2059                 mockHttpAttribute("showLegendDisplayOptionsInRunPage", "N");
2060                 mockHttpAttribute("hideTooltips", "N");
2061                 mockHttpAttribute("keepAsString", "N");
2062                 
2063                 mockHttpAttribute("drillDownReport", "-1");
2064                 
2065                 mockHttpAttribute("newChart1Axis", "1");
2066                 mockHttpAttribute("valueCol1", "");
2067                 mockHttpAttribute("valueCol1Color", "1");
2068                 mockHttpAttribute("valueColAxis", "1");
2069                 mockHttpAttribute("chartGroupAxis", "1");
2070                 mockHttpAttribute("YAxisLabel", "1");           
2071                 
2072                 mockHttpAttribute("chartOrientation", "1");             
2073                 mockHttpAttribute("secondaryChartRenderer", "1");               
2074                 mockHttpAttribute("chartDisplay", "1");         
2075                 mockHttpAttribute("chartOrientationInRunPage", "1");            
2076                 mockHttpAttribute("secondaryChartRendererInRunPage", "1");              
2077                 mockHttpAttribute("chartDisplayInRunPage", "1");                
2078         
2079                 mockHttpAttribute("chartSeries", "REP_ID");
2080                 
2081                 DataColumnType dataColumnType = new DataColumnType();
2082
2083                 Mockito.when(reportDefinition.getColumnById(Mockito.anyString())).thenReturn(dataColumnType);
2084
2085                 ChartAdditionalOptions chartAdditionalOptions = new ChartAdditionalOptions();
2086                 Mockito.when(reportDefinition.getChartAdditionalOptions()).thenReturn(chartAdditionalOptions);
2087
2088                 ChartDrillOptions chartDrillOptions = new ChartDrillOptions();
2089
2090                 List<ChartDrillFormfield> listChartDrillFormfield = chartDrillOptions.getTargetFormfield();
2091                 ChartDrillFormfield chartDrillFormfield = new ChartDrillFormfield();
2092                 chartDrillFormfield.setFormfield("REPORT_ID");
2093                 listChartDrillFormfield.add(chartDrillFormfield);
2094
2095                 DataColumnType dataColumnType1 = new DataColumnType();
2096                 
2097                 dataColumnType1.setTableId("reportaccess");
2098                 dataColumnType1.setDbColName("REP_ID");
2099                 dataColumnType1.setColName("REP_ID");
2100                 dataColumnType1.setDbColType("INTEGER");
2101                 dataColumnType1.setDisplayName("Report Id");
2102                 dataColumnType1.setColId("REP_ID");
2103                 dataColumnType1.setColOnChart(AppConstants.GT_COMPARE_PREVYEAR_CHART);
2104
2105                 DataColumnType dataColumnType2 = new DataColumnType();
2106                 
2107                 dataColumnType2.setTableId("reportaccess");
2108                 dataColumnType2.setDbColName("ORDER_NO");
2109                 dataColumnType2.setColName("ORDER_NO");
2110                 dataColumnType2.setDbColType("INTEGER");
2111                 dataColumnType2.setDisplayName("Order No");
2112                 dataColumnType2.setColId("ORDER_NO");
2113                 
2114                 dataColumnType2.setColOnChart(AppConstants.GC_LEGEND);
2115                 
2116                 List<DataColumnType> listDataColumnType = new ArrayList<DataColumnType>();
2117                 listDataColumnType.add(dataColumnType1);
2118                 listDataColumnType.add(dataColumnType2);
2119                 
2120                 Mockito.when(reportDefinition.getAllColumns()).thenReturn(listDataColumnType);
2121                 Mockito.when(reportDefinition.getChartDrillOptions()).thenReturn(chartDrillOptions);
2122                                 
2123                 wizardProcessor.processWizardStep(httpServletRequest);
2124
2125                 Mockito.verify(wizardProcessor, Mockito.times(1)).processWizardStep(httpServletRequest);
2126         }               
2127
2128         
2129         @Test
2130         public void testProcessWizardStep_processChart_TimeDifferenceChart_case1() throws Exception {
2131                 mockHttpParameter(AppConstants.RI_WIZARD_ACTION, "WIZ_ACTION");
2132                 mockHttpAttribute(AppConstants.RI_REPORT_ID,REPORT_ID);
2133                 mockHttpAttribute("showDashboardOptions","");
2134                 mockHttpAttribute(AppConstants.RI_DETAIL_ID,DETAIL_ID);
2135                 mockHttpAttribute("blueBarField", "REPORT ID");
2136
2137                 setWizardSteps(AppConstants.WS_CHART, AppConstants.WA_SAVE);
2138                 
2139                 mockHttpAttribute("chartType", AppConstants.GT_TIME_DIFFERENCE_CHART);
2140                 mockHttpAttribute("chartTypeFixed", "N");
2141                 mockHttpAttribute("legendCol", "REP_ID");
2142                 mockHttpAttribute("leftAxisLabel", "");
2143                 mockHttpAttribute("rightAxisLabel", "");
2144                 mockHttpAttribute("chartWidth", "500");
2145                 mockHttpAttribute("chartHeight", "500");
2146                 mockHttpAttribute("multiSeries", "N");
2147                 mockHttpAttribute("lastSeriesALineChart", "N");
2148                 mockHttpAttribute("lastSeriesABarChart", "N");          
2149                 mockHttpAttribute("animatedOption", "animate");
2150         
2151                 mockHttpAttribute("intervalFromDate", "Y");
2152                 mockHttpAttribute("intervalToDate", "Y");
2153                 mockHttpAttribute("intervalLabel", "Y");
2154                 mockHttpAttribute("intervalInputInRunPage", "Y");
2155                 
2156                 
2157                 mockHttpAttribute("chartGroup", "Group");
2158                 mockHttpAttribute("drillDownReport", "DrillDown");              
2159                 mockHttpAttribute("yAxis", "Y");
2160                 mockHttpAttribute("drillDownReport", "-1");
2161                 
2162                 mockHttpAttribute("drillDownXAxisFormfield", "-1");
2163                 mockHttpAttribute("drillDownYAxisFormfield", "-1");
2164                 mockHttpAttribute("drillDownSeriesAxisFormfield", "-1");
2165                 
2166                 
2167                 mockHttpAttribute("yAxisLowerLimit", "500");
2168                 mockHttpAttribute("yAxisUpperLimit", "1200");
2169                 mockHttpAttribute("labelAngle", "N");
2170                 mockHttpAttribute("legendPosition", "Top");
2171                 mockHttpAttribute("labelAngle", "N");
2172                 mockHttpAttribute("maxLabelsInDomainAxis", "N");
2173                 mockHttpAttribute("hideLegend", "labelAngle");
2174                 mockHttpAttribute("showLegendDisplayOptionsInRunPage", "N");
2175                 mockHttpAttribute("hideTooltips", "N");
2176                 mockHttpAttribute("keepAsString", "N");
2177                 
2178                 mockHttpAttribute("drillDownReport", "-1");
2179                 
2180                 mockHttpAttribute("newChart1Axis", "1");
2181                 mockHttpAttribute("valueCol1", "");
2182                 mockHttpAttribute("valueCol1Color", "1");
2183                 mockHttpAttribute("valueColAxis", "1");
2184                 mockHttpAttribute("chartGroupAxis", "1");
2185                 mockHttpAttribute("YAxisLabel", "1");           
2186                 
2187                 
2188                 mockHttpAttribute("chartOrientation", "1");             
2189                 mockHttpAttribute("secondaryChartRenderer", "1");               
2190                 mockHttpAttribute("chartDisplay", "1");         
2191                 mockHttpAttribute("chartOrientationInRunPage", "1");            
2192                 mockHttpAttribute("secondaryChartRendererInRunPage", "1");              
2193                 mockHttpAttribute("chartDisplayInRunPage", "1");                
2194         
2195                 mockHttpAttribute("chartSeries", "REP_ID");
2196                 
2197                 DataColumnType dataColumnType = new DataColumnType();
2198
2199                 Mockito.when(reportDefinition.getColumnById(Mockito.anyString())).thenReturn(dataColumnType);
2200
2201                 ChartAdditionalOptions chartAdditionalOptions = new ChartAdditionalOptions();
2202                 Mockito.when(reportDefinition.getChartAdditionalOptions()).thenReturn(chartAdditionalOptions);
2203
2204                 
2205                 ChartDrillOptions chartDrillOptions = new ChartDrillOptions();
2206
2207                 List<ChartDrillFormfield> listChartDrillFormfield = chartDrillOptions.getTargetFormfield();
2208                 ChartDrillFormfield chartDrillFormfield = new ChartDrillFormfield();
2209                 chartDrillFormfield.setFormfield("REPORT_ID");
2210                 listChartDrillFormfield.add(chartDrillFormfield);
2211                 
2212
2213                 DataColumnType dataColumnType1 = new DataColumnType();
2214                 
2215                 dataColumnType1.setTableId("reportaccess");
2216                 dataColumnType1.setDbColName("REP_ID");
2217                 dataColumnType1.setColName("REP_ID");
2218                 dataColumnType1.setDbColType("INTEGER");
2219                 dataColumnType1.setDisplayName("Report Id");
2220                 dataColumnType1.setColId("REP_ID");
2221                 dataColumnType1.setColOnChart(AppConstants.GT_COMPARE_PREVYEAR_CHART);
2222
2223                 DataColumnType dataColumnType2 = new DataColumnType();
2224                 
2225                 dataColumnType2.setTableId("reportaccess");
2226                 dataColumnType2.setDbColName("ORDER_NO");
2227                 dataColumnType2.setColName("ORDER_NO");
2228                 dataColumnType2.setDbColType("INTEGER");
2229                 dataColumnType2.setDisplayName("Order No");
2230                 dataColumnType2.setColId("ORDER_NO");
2231                 
2232                 dataColumnType2.setColOnChart(AppConstants.GC_LEGEND);
2233                 
2234                 List<DataColumnType> listDataColumnType = new ArrayList<DataColumnType>();
2235                 listDataColumnType.add(dataColumnType1);
2236                 listDataColumnType.add(dataColumnType2);
2237                 
2238                 Mockito.when(reportDefinition.getAllColumns()).thenReturn(listDataColumnType);
2239                 
2240                 Mockito.when(reportDefinition.getChartDrillOptions()).thenReturn(chartDrillOptions);
2241                                 
2242                 wizardProcessor.processWizardStep(httpServletRequest);
2243
2244                 Mockito.verify(wizardProcessor, Mockito.times(1)).processWizardStep(httpServletRequest);
2245         }               
2246         
2247         @Test
2248         public void testProcessWizardStep_processChart_VerticalStackedBarChart_case1() throws Exception {
2249                 mockHttpParameter(AppConstants.RI_WIZARD_ACTION, "WIZ_ACTION");
2250                 mockHttpAttribute(AppConstants.RI_REPORT_ID,REPORT_ID);
2251                 mockHttpAttribute("showDashboardOptions","");
2252                 mockHttpAttribute(AppConstants.RI_DETAIL_ID,DETAIL_ID);
2253                 mockHttpAttribute("blueBarField", "REPORT ID");
2254
2255                 setWizardSteps(AppConstants.WS_CHART, AppConstants.WA_SAVE);
2256
2257                 mockHttpAttribute("chartType", AppConstants.GT_STACKED_VERT_BAR);
2258                 mockHttpAttribute("chartTypeFixed", "N");
2259                 mockHttpAttribute("legendCol", "REP_ID");
2260                 mockHttpAttribute("leftAxisLabel", "");
2261                 mockHttpAttribute("rightAxisLabel", "");
2262                 mockHttpAttribute("chartWidth", "500");
2263                 mockHttpAttribute("chartHeight", "500");
2264                 mockHttpAttribute("multiSeries", "N");
2265                 mockHttpAttribute("lastSeriesALineChart", "N");
2266                 mockHttpAttribute("lastSeriesABarChart", "N");          
2267                 mockHttpAttribute("animatedOption", "animate");
2268         
2269                 mockHttpAttribute("intervalFromDate", "Y");
2270                 mockHttpAttribute("intervalToDate", "Y");
2271                 mockHttpAttribute("intervalLabel", "Y");
2272                 mockHttpAttribute("intervalInputInRunPage", "Y");
2273
2274                 mockHttpAttribute("overlayItemValue", "Y");
2275                 mockHttpAttribute("animatedOption", "animate");
2276                 
2277                 mockHttpAttribute("chartGroup", "Group");
2278                 mockHttpAttribute("drillDownReport", "DrillDown");              
2279                 mockHttpAttribute("yAxis", "Y");
2280                 mockHttpAttribute("drillDownReport", "-1");
2281                 
2282                 mockHttpAttribute("drillDownXAxisFormfield", "-1");
2283                 mockHttpAttribute("drillDownYAxisFormfield", "-1");
2284                 mockHttpAttribute("drillDownSeriesAxisFormfield", "-1");
2285                 
2286                 mockHttpAttribute("yAxisLowerLimit", "500");
2287                 mockHttpAttribute("yAxisUpperLimit", "1200");
2288                 mockHttpAttribute("labelAngle", "N");
2289                 mockHttpAttribute("legendPosition", "Top");
2290                 mockHttpAttribute("labelAngle", "N");
2291                 mockHttpAttribute("maxLabelsInDomainAxis", "N");
2292                 mockHttpAttribute("hideLegend", "labelAngle");
2293                 mockHttpAttribute("showLegendDisplayOptionsInRunPage", "N");
2294                 mockHttpAttribute("hideTooltips", "N");
2295                 mockHttpAttribute("keepAsString", "N");
2296                 
2297                 mockHttpAttribute("drillDownReport", "-1");
2298                 
2299                 mockHttpAttribute("newChart1Axis", "1");
2300                 mockHttpAttribute("valueCol1", "");
2301                 mockHttpAttribute("valueCol1Color", "1");
2302                 mockHttpAttribute("valueColAxis", "1");
2303                 mockHttpAttribute("chartGroupAxis", "1");
2304                 mockHttpAttribute("YAxisLabel", "1");           
2305                 
2306                 
2307                 mockHttpAttribute("chartOrientation", "1");             
2308                 mockHttpAttribute("secondaryChartRenderer", "1");               
2309                 mockHttpAttribute("chartDisplay", "1");         
2310                 mockHttpAttribute("chartOrientationInRunPage", "1");            
2311                 mockHttpAttribute("secondaryChartRendererInRunPage", "1");              
2312                 mockHttpAttribute("chartDisplayInRunPage", "1");                
2313         
2314                 mockHttpAttribute("chartSeries", "REP_ID");
2315                 
2316                 DataColumnType dataColumnType = new DataColumnType();
2317
2318                 Mockito.when(reportDefinition.getColumnById(Mockito.anyString())).thenReturn(dataColumnType);
2319
2320                 ChartAdditionalOptions chartAdditionalOptions = new ChartAdditionalOptions();
2321                 Mockito.when(reportDefinition.getChartAdditionalOptions()).thenReturn(chartAdditionalOptions);
2322
2323                 
2324                 ChartDrillOptions chartDrillOptions = new ChartDrillOptions();
2325
2326                 List<ChartDrillFormfield> listChartDrillFormfield = chartDrillOptions.getTargetFormfield();
2327                 ChartDrillFormfield chartDrillFormfield = new ChartDrillFormfield();
2328                 chartDrillFormfield.setFormfield("REPORT_ID");
2329                 listChartDrillFormfield.add(chartDrillFormfield);
2330
2331                 DataColumnType dataColumnType1 = new DataColumnType();
2332                 
2333                 dataColumnType1.setTableId("reportaccess");
2334                 dataColumnType1.setDbColName("REP_ID");
2335                 dataColumnType1.setColName("REP_ID");
2336                 dataColumnType1.setDbColType("INTEGER");
2337                 dataColumnType1.setDisplayName("Report Id");
2338                 dataColumnType1.setColId("REP_ID");
2339                 dataColumnType1.setColOnChart(AppConstants.GT_COMPARE_PREVYEAR_CHART);
2340
2341                 DataColumnType dataColumnType2 = new DataColumnType();
2342                 
2343                 dataColumnType2.setTableId("reportaccess");
2344                 dataColumnType2.setDbColName("ORDER_NO");
2345                 dataColumnType2.setColName("ORDER_NO");
2346                 dataColumnType2.setDbColType("INTEGER");
2347                 dataColumnType2.setDisplayName("Order No");
2348                 dataColumnType2.setColId("ORDER_NO");
2349                 
2350                 dataColumnType2.setColOnChart(AppConstants.GC_LEGEND);
2351                 
2352                 List<DataColumnType> listDataColumnType = new ArrayList<DataColumnType>();
2353                 listDataColumnType.add(dataColumnType1);
2354                 listDataColumnType.add(dataColumnType2);
2355                 
2356                 Mockito.when(reportDefinition.getAllColumns()).thenReturn(listDataColumnType);
2357                 
2358                 Mockito.when(reportDefinition.getChartDrillOptions()).thenReturn(chartDrillOptions);
2359                                 
2360                 wizardProcessor.processWizardStep(httpServletRequest);
2361         
2362                 Mockito.verify(wizardProcessor, Mockito.times(1)).processWizardStep(httpServletRequest);
2363         }               
2364         
2365         @Test
2366         public void testProcessWizardStep_processChart_HorizontalStackedBarChart_case1() throws Exception {
2367                 mockHttpParameter(AppConstants.RI_WIZARD_ACTION, "WIZ_ACTION");
2368                 mockHttpAttribute(AppConstants.RI_REPORT_ID,REPORT_ID);
2369                 mockHttpAttribute("showDashboardOptions","");
2370                 mockHttpAttribute(AppConstants.RI_DETAIL_ID,DETAIL_ID);
2371                 mockHttpAttribute("blueBarField", "REPORT ID");
2372
2373                 setWizardSteps(AppConstants.WS_CHART, AppConstants.WA_SAVE);
2374
2375                 mockHttpAttribute("chartType", AppConstants.GT_STACKED_HORIZ_BAR);
2376                 mockHttpAttribute("chartTypeFixed", "N");
2377                 mockHttpAttribute("legendCol", "REP_ID");
2378                 mockHttpAttribute("leftAxisLabel", "");
2379                 mockHttpAttribute("rightAxisLabel", "");
2380                 mockHttpAttribute("chartWidth", "500");
2381                 mockHttpAttribute("chartHeight", "500");
2382                 mockHttpAttribute("multiSeries", "N");
2383                 mockHttpAttribute("lastSeriesALineChart", "N");
2384                 mockHttpAttribute("lastSeriesABarChart", "N");          
2385                 mockHttpAttribute("animatedOption", "animate");
2386         
2387                 mockHttpAttribute("intervalFromDate", "Y");
2388                 mockHttpAttribute("intervalToDate", "Y");
2389                 mockHttpAttribute("intervalLabel", "Y");
2390                 mockHttpAttribute("intervalInputInRunPage", "Y");
2391                 
2392                 mockHttpAttribute("overlayItemValue", "Y");
2393                 mockHttpAttribute("animatedOption", "animate");
2394                 
2395                 mockHttpAttribute("chartGroup", "Group");
2396                 mockHttpAttribute("drillDownReport", "DrillDown");              
2397                 mockHttpAttribute("yAxis", "Y");
2398                 mockHttpAttribute("drillDownReport", "-1");
2399                 
2400                 mockHttpAttribute("drillDownXAxisFormfield", "-1");
2401                 mockHttpAttribute("drillDownYAxisFormfield", "-1");
2402                 mockHttpAttribute("drillDownSeriesAxisFormfield", "-1");
2403                 
2404                 mockHttpAttribute("yAxisLowerLimit", "500");
2405                 mockHttpAttribute("yAxisUpperLimit", "1200");
2406                 mockHttpAttribute("labelAngle", "N");
2407                 mockHttpAttribute("legendPosition", "Top");
2408                 mockHttpAttribute("labelAngle", "N");
2409                 mockHttpAttribute("maxLabelsInDomainAxis", "N");
2410                 mockHttpAttribute("hideLegend", "labelAngle");
2411                 mockHttpAttribute("showLegendDisplayOptionsInRunPage", "N");
2412                 mockHttpAttribute("hideTooltips", "N");
2413                 mockHttpAttribute("keepAsString", "N");
2414                 
2415                 mockHttpAttribute("drillDownReport", "-1");
2416                 
2417                 mockHttpAttribute("newChart1Axis", "1");
2418                 mockHttpAttribute("valueCol1", "");
2419                 mockHttpAttribute("valueCol1Color", "1");
2420                 mockHttpAttribute("valueColAxis", "1");
2421                 mockHttpAttribute("chartGroupAxis", "1");
2422                 mockHttpAttribute("YAxisLabel", "1");           
2423                 
2424                 mockHttpAttribute("chartOrientation", "1");             
2425                 mockHttpAttribute("secondaryChartRenderer", "1");               
2426                 mockHttpAttribute("chartDisplay", "1");         
2427                 mockHttpAttribute("chartOrientationInRunPage", "1");            
2428                 mockHttpAttribute("secondaryChartRendererInRunPage", "1");              
2429                 mockHttpAttribute("chartDisplayInRunPage", "1");                
2430         
2431                 mockHttpAttribute("chartSeries", "REP_ID");
2432                 
2433                 DataColumnType dataColumnType = new DataColumnType();
2434
2435                 Mockito.when(reportDefinition.getColumnById(Mockito.anyString())).thenReturn(dataColumnType);
2436
2437                 ChartAdditionalOptions chartAdditionalOptions = new ChartAdditionalOptions();
2438                 Mockito.when(reportDefinition.getChartAdditionalOptions()).thenReturn(chartAdditionalOptions);
2439                 
2440                 ChartDrillOptions chartDrillOptions = new ChartDrillOptions();
2441
2442                 List<ChartDrillFormfield> listChartDrillFormfield = chartDrillOptions.getTargetFormfield();
2443                 ChartDrillFormfield chartDrillFormfield = new ChartDrillFormfield();
2444                 chartDrillFormfield.setFormfield("REPORT_ID");
2445                 listChartDrillFormfield.add(chartDrillFormfield);
2446                 
2447
2448                 DataColumnType dataColumnType1 = new DataColumnType();
2449                 
2450                 dataColumnType1.setTableId("reportaccess");
2451                 dataColumnType1.setDbColName("REP_ID");
2452                 dataColumnType1.setColName("REP_ID");
2453                 dataColumnType1.setDbColType("INTEGER");
2454                 dataColumnType1.setDisplayName("Report Id");
2455                 dataColumnType1.setColId("REP_ID");
2456                 dataColumnType1.setColOnChart(AppConstants.GT_COMPARE_PREVYEAR_CHART);
2457
2458                 DataColumnType dataColumnType2 = new DataColumnType();
2459                 
2460                 dataColumnType2.setTableId("reportaccess");
2461                 dataColumnType2.setDbColName("ORDER_NO");
2462                 dataColumnType2.setColName("ORDER_NO");
2463                 dataColumnType2.setDbColType("INTEGER");
2464                 dataColumnType2.setDisplayName("Order No");
2465                 dataColumnType2.setColId("ORDER_NO");
2466                 
2467                 dataColumnType2.setColOnChart(AppConstants.GC_LEGEND);
2468                 
2469                 List<DataColumnType> listDataColumnType = new ArrayList<DataColumnType>();
2470                 listDataColumnType.add(dataColumnType1);
2471                 listDataColumnType.add(dataColumnType2);
2472                 
2473                 Mockito.when(reportDefinition.getAllColumns()).thenReturn(listDataColumnType);
2474                 Mockito.when(reportDefinition.getChartDrillOptions()).thenReturn(chartDrillOptions);
2475                                 
2476                 wizardProcessor.processWizardStep(httpServletRequest);
2477
2478                 Mockito.verify(wizardProcessor, Mockito.times(1)).processWizardStep(httpServletRequest);
2479         }               
2480         
2481
2482         @Test
2483         public void testProcessWizardStep_processChart_VerticalStackedBarLinesChart_case1() throws Exception {
2484                 mockHttpParameter(AppConstants.RI_WIZARD_ACTION, AppConstants.WA_ADD_USER);
2485                 mockHttpAttribute(AppConstants.RI_REPORT_ID,REPORT_ID);
2486                 mockHttpAttribute("showDashboardOptions","");
2487                 mockHttpAttribute(AppConstants.RI_DETAIL_ID,DETAIL_ID);
2488                 mockHttpAttribute("blueBarField", "REPORT ID");
2489
2490                 setWizardSteps(AppConstants.WS_CHART, AppConstants.WA_SAVE);
2491
2492                 mockHttpAttribute("chartType", AppConstants.GT_STACKED_VERT_BAR_LINES);
2493                 mockHttpAttribute("chartTypeFixed", "N");
2494                 mockHttpAttribute("legendCol", "REP_ID");
2495                 mockHttpAttribute("leftAxisLabel", "");
2496                 mockHttpAttribute("rightAxisLabel", "");
2497                 mockHttpAttribute("chartWidth", "500");
2498                 mockHttpAttribute("chartHeight", "500");
2499                 mockHttpAttribute("multiSeries", "N");
2500                 mockHttpAttribute("lastSeriesALineChart", "N");
2501                 mockHttpAttribute("lastSeriesABarChart", "N");          
2502                 mockHttpAttribute("animatedOption", "animate");
2503         
2504                 mockHttpAttribute("intervalFromDate", "Y");
2505                 mockHttpAttribute("intervalToDate", "Y");
2506                 mockHttpAttribute("intervalLabel", "Y");
2507                 mockHttpAttribute("intervalInputInRunPage", "Y");
2508
2509                 mockHttpAttribute("overlayItemValue", "Y");
2510                 mockHttpAttribute("animatedOption", "animate");
2511                 
2512                 mockHttpAttribute("chartGroup", "Group");
2513                 mockHttpAttribute("drillDownReport", "DrillDown");              
2514                 mockHttpAttribute("yAxis", "Y");
2515                 mockHttpAttribute("drillDownReport", "-1");
2516                 
2517                 mockHttpAttribute("drillDownXAxisFormfield", "-1");
2518                 mockHttpAttribute("drillDownYAxisFormfield", "-1");
2519                 mockHttpAttribute("drillDownSeriesAxisFormfield", "-1");
2520                 
2521                 mockHttpAttribute("yAxisLowerLimit", "500");
2522                 mockHttpAttribute("yAxisUpperLimit", "1200");
2523                 mockHttpAttribute("labelAngle", "N");
2524                 mockHttpAttribute("legendPosition", "Top");
2525                 mockHttpAttribute("labelAngle", "N");
2526                 mockHttpAttribute("maxLabelsInDomainAxis", "N");
2527                 mockHttpAttribute("hideLegend", "labelAngle");
2528                 mockHttpAttribute("showLegendDisplayOptionsInRunPage", "N");
2529                 mockHttpAttribute("hideTooltips", "N");
2530                 mockHttpAttribute("keepAsString", "N");
2531                 
2532                 mockHttpAttribute("drillDownReport", "-1");
2533                 
2534                 mockHttpAttribute("newChart1Axis", "1");
2535                 mockHttpAttribute("valueCol1", "");
2536                 mockHttpAttribute("valueCol1Color", "1");
2537                 mockHttpAttribute("valueColAxis", "1");
2538                 mockHttpAttribute("chartGroupAxis", "1");
2539                 mockHttpAttribute("YAxisLabel", "1");           
2540                 
2541                 
2542                 mockHttpAttribute("chartOrientation", "1");             
2543                 mockHttpAttribute("secondaryChartRenderer", "1");               
2544                 mockHttpAttribute("chartDisplay", "1");         
2545                 mockHttpAttribute("chartOrientationInRunPage", "1");            
2546                 mockHttpAttribute("secondaryChartRendererInRunPage", "1");              
2547                 mockHttpAttribute("chartDisplayInRunPage", "1");                
2548         
2549                 mockHttpAttribute("chartSeries", "REP_ID");
2550                 
2551                 mockHttpAttribute("valueColNew", "REP_ID");             
2552                 mockHttpAttribute("valueColNewColor", "YELLOW");                
2553                 mockHttpAttribute("valueColNewAxis", "Y");              
2554                 
2555                 ChartAdditionalOptions chartAdditionalOptions = new ChartAdditionalOptions();
2556                 Mockito.when(reportDefinition.getChartAdditionalOptions()).thenReturn(chartAdditionalOptions);
2557                 
2558                 ChartDrillOptions chartDrillOptions = new ChartDrillOptions();
2559
2560                 List<ChartDrillFormfield> listChartDrillFormfield = chartDrillOptions.getTargetFormfield();
2561                 ChartDrillFormfield chartDrillFormfield = new ChartDrillFormfield();
2562                 chartDrillFormfield.setFormfield("REPORT_ID");
2563                 listChartDrillFormfield.add(chartDrillFormfield);
2564                 
2565
2566                 DataColumnType dataColumnType1 = new DataColumnType();
2567                 
2568                 dataColumnType1.setTableId("reportaccess");
2569                 dataColumnType1.setDbColName("REP_ID");
2570                 dataColumnType1.setColName("REP_ID");
2571                 dataColumnType1.setDbColType("INTEGER");
2572                 dataColumnType1.setDisplayName("Report Id");
2573                 dataColumnType1.setColId("REP_ID");
2574                 dataColumnType1.setColOnChart(AppConstants.GT_COMPARE_PREVYEAR_CHART);
2575
2576                 DataColumnType dataColumnType2 = new DataColumnType();
2577                 
2578                 dataColumnType2.setTableId("reportaccess");
2579                 dataColumnType2.setDbColName("ORDER_NO");
2580                 dataColumnType2.setColName("ORDER_NO");
2581                 dataColumnType2.setDbColType("INTEGER");
2582                 dataColumnType2.setDisplayName("Order No");
2583                 dataColumnType2.setColId("ORDER_NO");
2584                 
2585                 dataColumnType2.setColOnChart(AppConstants.GC_LEGEND);
2586                 
2587                 List<DataColumnType> listDataColumnType = new ArrayList<DataColumnType>();
2588                 listDataColumnType.add(dataColumnType1);
2589                 listDataColumnType.add(dataColumnType2);
2590                 
2591                 Mockito.when(reportDefinition.getAllColumns()).thenReturn(listDataColumnType);
2592                 Mockito.when(reportDefinition.getColumnById(Mockito.anyString())).thenReturn(dataColumnType1);
2593                 Mockito.when(reportDefinition.getChartDrillOptions()).thenReturn(chartDrillOptions);
2594                                 
2595                 wizardProcessor.processWizardStep(httpServletRequest);
2596
2597                 Mockito.verify(wizardProcessor, Mockito.times(1)).processWizardStep(httpServletRequest);
2598         }               
2599         
2600
2601         @Test
2602         public void testProcessWizardStep_processChart_HorizontalStackedBarLinesChart_case1() throws Exception {
2603                 mockHttpParameter(AppConstants.RI_WIZARD_ACTION, AppConstants.WA_ADD_USER);
2604                 mockHttpAttribute(AppConstants.RI_REPORT_ID,REPORT_ID);
2605                 mockHttpAttribute("showDashboardOptions","");
2606                 mockHttpAttribute(AppConstants.RI_DETAIL_ID,DETAIL_ID);
2607                 mockHttpAttribute("blueBarField", "REPORT ID");
2608
2609                 setWizardSteps(AppConstants.WS_CHART, AppConstants.WA_SAVE);
2610
2611                 mockHttpAttribute("chartType", AppConstants.GT_STACKED_HORIZ_BAR_LINES);
2612                 mockHttpAttribute("chartTypeFixed", "N");
2613                 mockHttpAttribute("legendCol", "REP_ID");
2614                 mockHttpAttribute("leftAxisLabel", "");
2615                 mockHttpAttribute("rightAxisLabel", "");
2616                 mockHttpAttribute("chartWidth", "500");
2617                 mockHttpAttribute("chartHeight", "500");
2618                 mockHttpAttribute("multiSeries", "N");
2619                 mockHttpAttribute("lastSeriesALineChart", "N");
2620                 mockHttpAttribute("lastSeriesABarChart", "N");          
2621                 mockHttpAttribute("animatedOption", "animate");
2622         
2623                 mockHttpAttribute("intervalFromDate", "Y");
2624                 mockHttpAttribute("intervalToDate", "Y");
2625                 mockHttpAttribute("intervalLabel", "Y");
2626                 mockHttpAttribute("intervalInputInRunPage", "Y");
2627
2628                 mockHttpAttribute("overlayItemValue", "Y");
2629                 mockHttpAttribute("animatedOption", "animate");
2630
2631                 mockHttpAttribute("chartGroup", "Group");
2632                 mockHttpAttribute("drillDownReport", "DrillDown");              
2633                 mockHttpAttribute("yAxis", "Y");
2634                 mockHttpAttribute("drillDownReport", "-1");
2635                 
2636                 mockHttpAttribute("drillDownXAxisFormfield", "-1");
2637                 mockHttpAttribute("drillDownYAxisFormfield", "-1");
2638                 mockHttpAttribute("drillDownSeriesAxisFormfield", "-1");
2639                 
2640                 mockHttpAttribute("yAxisLowerLimit", "500");
2641                 mockHttpAttribute("yAxisUpperLimit", "1200");
2642                 mockHttpAttribute("labelAngle", "N");
2643                 mockHttpAttribute("legendPosition", "Top");
2644                 mockHttpAttribute("labelAngle", "N");
2645                 mockHttpAttribute("maxLabelsInDomainAxis", "N");
2646                 mockHttpAttribute("hideLegend", "labelAngle");
2647                 mockHttpAttribute("showLegendDisplayOptionsInRunPage", "N");
2648                 mockHttpAttribute("hideTooltips", "N");
2649                 mockHttpAttribute("keepAsString", "N");
2650                 
2651                 mockHttpAttribute("drillDownReport", "-1");
2652                 
2653                 mockHttpAttribute("newChart1Axis", "1");
2654                 mockHttpAttribute("valueCol1", "");
2655                 mockHttpAttribute("valueCol1Color", "1");
2656                 mockHttpAttribute("valueColAxis", "1");
2657                 mockHttpAttribute("chartGroupAxis", "1");
2658                 mockHttpAttribute("YAxisLabel", "1");           
2659                 
2660                 mockHttpAttribute("chartOrientation", "1");             
2661                 mockHttpAttribute("secondaryChartRenderer", "1");               
2662                 mockHttpAttribute("chartDisplay", "1");         
2663                 mockHttpAttribute("chartOrientationInRunPage", "1");            
2664                 mockHttpAttribute("secondaryChartRendererInRunPage", "1");              
2665                 mockHttpAttribute("chartDisplayInRunPage", "1");                
2666         
2667                 mockHttpAttribute("chartSeries", "REP_ID");
2668                 
2669                 mockHttpAttribute("valueColNew", "");           
2670                 mockHttpAttribute("valueColNewColor", "YELLOW");                
2671                 mockHttpAttribute("valueColNewAxis", "Y");              
2672
2673                 DataColumnType dataColumnType = new DataColumnType();
2674
2675                 Mockito.when(reportDefinition.getColumnById(Mockito.anyString())).thenReturn(dataColumnType);
2676
2677                 ChartAdditionalOptions chartAdditionalOptions = new ChartAdditionalOptions();
2678                 Mockito.when(reportDefinition.getChartAdditionalOptions()).thenReturn(chartAdditionalOptions);
2679                 
2680                 ChartDrillOptions chartDrillOptions = new ChartDrillOptions();
2681
2682                 List<ChartDrillFormfield> listChartDrillFormfield = chartDrillOptions.getTargetFormfield();
2683                 ChartDrillFormfield chartDrillFormfield = new ChartDrillFormfield();
2684                 chartDrillFormfield.setFormfield("REPORT_ID");
2685                 listChartDrillFormfield.add(chartDrillFormfield);
2686
2687                 DataColumnType dataColumnType1 = new DataColumnType();
2688                 
2689                 dataColumnType1.setTableId("reportaccess");
2690                 dataColumnType1.setDbColName("REP_ID");
2691                 dataColumnType1.setColName("REP_ID");
2692                 dataColumnType1.setDbColType("INTEGER");
2693                 dataColumnType1.setDisplayName("Report Id");
2694                 dataColumnType1.setColId("REP_ID");
2695                 dataColumnType1.setColOnChart(AppConstants.GT_COMPARE_PREVYEAR_CHART);
2696
2697                 DataColumnType dataColumnType2 = new DataColumnType();
2698                 
2699                 dataColumnType2.setTableId("reportaccess");
2700                 dataColumnType2.setDbColName("ORDER_NO");
2701                 dataColumnType2.setColName("ORDER_NO");
2702                 dataColumnType2.setDbColType("INTEGER");
2703                 dataColumnType2.setDisplayName("Order No");
2704                 dataColumnType2.setColId("ORDER_NO");
2705                 
2706                 dataColumnType2.setColOnChart(AppConstants.GC_LEGEND);
2707                 
2708                 List<DataColumnType> listDataColumnType = new ArrayList<DataColumnType>();
2709                 listDataColumnType.add(dataColumnType1);
2710                 listDataColumnType.add(dataColumnType2);
2711                 
2712                 Mockito.when(reportDefinition.getAllColumns()).thenReturn(listDataColumnType);
2713                 Mockito.when(reportDefinition.getColumnById(Mockito.anyString())).thenReturn(dataColumnType1);
2714                 Mockito.when(reportDefinition.getChartDrillOptions()).thenReturn(chartDrillOptions);
2715                                 
2716                 wizardProcessor.processWizardStep(httpServletRequest);
2717                 Mockito.verify(wizardProcessor, Mockito.times(1)).processWizardStep(httpServletRequest);
2718         }               
2719                 
2720
2721         @Test
2722         public void testProcessWizardStep_Schedule_Add_User_case1() throws Exception {
2723                 mockHttpParameter(AppConstants.RI_WIZARD_ACTION, AppConstants.WA_ADD_USER);
2724                 mockHttpAttribute(AppConstants.RI_REPORT_ID,REPORT_ID);
2725                 mockHttpAttribute("showDashboardOptions","");
2726                 mockHttpAttribute(AppConstants.RI_DETAIL_ID,DETAIL_ID);
2727                 mockHttpAttribute("blueBarField", "REPORT ID");
2728
2729                 setWizardSteps(AppConstants.WS_SCHEDULE, AppConstants.WA_SAVE);
2730                 
2731                 mockHttpAttribute(AppConstants.RI_DETAIL_ID, "2001");
2732                 mockHttpAttribute("pdfAttachmentKey", "PdfKey");
2733                 mockHttpAttribute("log_id", "Log#1234");
2734                 mockHttpAttribute("user_id", "demo");
2735                 
2736                 mockHttpAttribute("schedEnabled", "N");
2737                 mockHttpAttribute("schedStartDate", "03/12/2018");
2738                 mockHttpAttribute("schedEndDate", "03/12/2999");
2739                 mockHttpAttribute("schedEndHour", "9");
2740                 mockHttpAttribute("schedMin", "30");
2741                 mockHttpAttribute("schedEndMin", "10");
2742                 mockHttpAttribute("schedEndAMPM", "AM");
2743                 mockHttpAttribute("schedRunDate", "N");
2744                 mockHttpAttribute("schedHour", "10");
2745                 mockHttpAttribute("schedAMPM", "AM");
2746                                 
2747                 mockHttpAttribute("schedRecurrence", "Y");
2748                 mockHttpAttribute("conditional", "Y");
2749                 mockHttpAttribute("encryptMode" , "Y");
2750                 mockHttpAttribute("conditionSQL", "REPORT_ID=1001");
2751                 mockHttpAttribute("notify_type", "QUEUE");
2752                 mockHttpAttribute("downloadLimit", "1024mb");
2753                 mockHttpAttribute("formFields", "REPORT_ID");
2754                 mockHttpAttribute("sendAttachment", "Y");
2755                 mockHttpAttribute("schedEmailAdd", "Y");
2756                 mockHttpAttribute("schedEmailAddRole", "Y");
2757                 
2758                 PowerMockito.when(Globals.getUseLoginIdInSchedYN()).thenReturn("Y");
2759                 
2760                 wizardProcessor.processWizardStep(httpServletRequest);
2761                 Mockito.verify(wizardProcessor, Mockito.times(1)).processWizardStep(httpServletRequest);
2762         }               
2763
2764         @Test
2765         public void testProcessWizardStep_Schedule_Delete_User_case1() throws Exception {
2766                 mockHttpParameter(AppConstants.RI_WIZARD_ACTION, AppConstants.WA_DELETE_USER);
2767                 mockHttpAttribute(AppConstants.RI_REPORT_ID,REPORT_ID);
2768                 mockHttpAttribute("showDashboardOptions","");
2769                 mockHttpAttribute(AppConstants.RI_DETAIL_ID,DETAIL_ID);
2770                 mockHttpAttribute("blueBarField", "REPORT ID");
2771
2772                 setWizardSteps(AppConstants.WS_SCHEDULE, AppConstants.WA_SAVE);
2773                         
2774                 mockHttpAttribute("pdfAttachmentKey", "PdfKey");
2775                 mockHttpAttribute("log_id", "Log#1234");
2776                 mockHttpAttribute("user_id", "demo");
2777                 
2778                 mockHttpAttribute("schedEnabled", "N");
2779                 mockHttpAttribute("schedStartDate", "03/12/2018");
2780                 mockHttpAttribute("schedEndDate", "03/12/2999");
2781                 mockHttpAttribute("schedEndHour", "9");
2782                 mockHttpAttribute("schedMin", "30");
2783                 mockHttpAttribute("schedEndMin", "10");
2784                 mockHttpAttribute("schedEndAMPM", "AM");
2785                 mockHttpAttribute("schedRunDate", "N");
2786                 mockHttpAttribute("schedHour", "10");
2787                 mockHttpAttribute("schedAMPM", "AM");
2788                                 
2789                 mockHttpAttribute("schedRecurrence", "Y");
2790                 mockHttpAttribute("conditional", "Y");
2791                 mockHttpAttribute("encryptMode" , "Y");
2792
2793                 mockHttpAttribute("conditionSQL", "REPORT_ID=1001");
2794                 mockHttpAttribute("notify_type", "QUEUE");
2795                 mockHttpAttribute("downloadLimit", "1024mb");
2796                 mockHttpAttribute("formFields", "REPORT_ID");
2797                 
2798                 mockHttpAttribute("sendAttachment", "Y");
2799                 mockHttpAttribute("schedEmailAdd", "Y");
2800                 mockHttpAttribute("schedEmailAddRole", "Y");
2801                 
2802                 wizardProcessor.processWizardStep(httpServletRequest);
2803
2804                 Mockito.verify(wizardProcessor, Mockito.times(1)).processWizardStep(httpServletRequest);
2805         }               
2806
2807         
2808         @Test
2809         public void testProcessWizardStep_Schedule_Add_Role_case1() throws Exception {
2810                 mockHttpParameter(AppConstants.RI_WIZARD_ACTION, AppConstants.WA_ADD_ROLE);
2811                 mockHttpAttribute(AppConstants.RI_REPORT_ID,REPORT_ID);
2812                 mockHttpAttribute("showDashboardOptions","");
2813                 mockHttpAttribute(AppConstants.RI_DETAIL_ID,DETAIL_ID);
2814                 mockHttpAttribute("blueBarField", "REPORT ID");
2815
2816                 setWizardSteps(AppConstants.WS_SCHEDULE, AppConstants.WA_SAVE);
2817
2818                 mockHttpAttribute("pdfAttachmentKey", "PdfKey");
2819                 mockHttpAttribute("log_id", "Log#1234");
2820                 mockHttpAttribute("user_id", "demo");
2821                 
2822                 mockHttpAttribute("schedEnabled", "N");
2823                 mockHttpAttribute("schedStartDate", "03/12/2018");
2824                 mockHttpAttribute("schedEndDate", "03/12/2999");
2825                 mockHttpAttribute("schedEndHour", "9");
2826                 mockHttpAttribute("schedMin", "30");
2827                 mockHttpAttribute("schedEndMin", "10");
2828                 mockHttpAttribute("schedEndAMPM", "AM");
2829                 mockHttpAttribute("schedRunDate", "N");
2830                 mockHttpAttribute("schedHour", "10");
2831                 mockHttpAttribute("schedAMPM", "AM");
2832                 mockHttpAttribute("schedRecurrence", "Y");
2833                 mockHttpAttribute("conditional", "Y");
2834                 mockHttpAttribute("encryptMode" , "Y");
2835                 mockHttpAttribute("conditionSQL", "REPORT_ID=1001");
2836                 mockHttpAttribute("notify_type", "QUEUE");
2837                 mockHttpAttribute("downloadLimit", "1024mb");
2838                 mockHttpAttribute("formFields", "REPORT_ID");
2839                 mockHttpAttribute("sendAttachment", "Y");
2840                 mockHttpAttribute("schedEmailAdd", "Y");
2841                 mockHttpAttribute("schedEmailAddRole", "Y");
2842                 
2843                 wizardProcessor.processWizardStep(httpServletRequest);
2844
2845                 Mockito.verify(wizardProcessor, Mockito.times(1)).processWizardStep(httpServletRequest);
2846         }               
2847         
2848         @Test
2849         public void testProcessWizardStep_Schedule_Delete_Role_case1() throws Exception {
2850                 mockHttpParameter(AppConstants.RI_WIZARD_ACTION, AppConstants.WA_DELETE_ROLE);
2851                 mockHttpAttribute(AppConstants.RI_REPORT_ID,REPORT_ID);
2852                 mockHttpAttribute("showDashboardOptions","");
2853                 mockHttpAttribute(AppConstants.RI_DETAIL_ID,DETAIL_ID);
2854                 mockHttpAttribute("blueBarField", "REPORT ID");
2855
2856                 setWizardSteps(AppConstants.WS_SCHEDULE, AppConstants.WA_SAVE);
2857
2858                 mockHttpAttribute(AppConstants.RI_DETAIL_ID, "2001");
2859                 mockHttpAttribute("pdfAttachmentKey", "PdfKey");
2860                 mockHttpAttribute("log_id", "Log#1234");
2861                 mockHttpAttribute("user_id", "demo");
2862                 
2863                 mockHttpAttribute("schedEnabled", "N");
2864                 mockHttpAttribute("schedStartDate", "03/12/2018");
2865                 mockHttpAttribute("schedEndDate", "03/12/2999");
2866                 mockHttpAttribute("schedEndHour", "9");
2867                 mockHttpAttribute("schedMin", "30");
2868                 mockHttpAttribute("schedEndMin", "10");
2869                 mockHttpAttribute("schedEndAMPM", "AM");
2870                 mockHttpAttribute("schedRunDate", "N");
2871                 mockHttpAttribute("schedHour", "10");
2872                 mockHttpAttribute("schedAMPM", "AM");
2873                                 
2874                 mockHttpAttribute("schedRecurrence", "Y");
2875                 
2876                 mockHttpAttribute("conditional", "Y");
2877                 
2878                 mockHttpAttribute("encryptMode" , "Y");
2879                 
2880                 mockHttpAttribute("conditionSQL", "REPORT_ID=1001");
2881                 mockHttpAttribute("notify_type", "QUEUE");
2882                 mockHttpAttribute("downloadLimit", "1024mb");
2883                 mockHttpAttribute("formFields", "REPORT_ID");
2884                 
2885                 mockHttpAttribute("sendAttachment", "Y");
2886
2887                 mockHttpAttribute("schedEmailAdd", "Y");
2888                 mockHttpAttribute("schedEmailAddRole", "Y");
2889                 
2890                 wizardProcessor.processWizardStep(httpServletRequest);
2891                 Mockito.verify(wizardProcessor, Mockito.times(1)).processWizardStep(httpServletRequest);
2892         }               
2893
2894         @Test
2895         public void testProcessWizardStep_processUserAccess_Add_User_case1() throws Exception {
2896         
2897                 mockHttpParameter(AppConstants.RI_WIZARD_ACTION, AppConstants.WA_ADD_USER);
2898                 mockHttpAttribute(AppConstants.RI_REPORT_ID,REPORT_ID);
2899                 mockHttpAttribute("showDashboardOptions","");
2900                 mockHttpAttribute(AppConstants.RI_DETAIL_ID,DETAIL_ID);
2901                 mockHttpAttribute("blueBarField", "REPORT ID");
2902
2903                 setWizardSteps(AppConstants.WS_USER_ACCESS, AppConstants.WA_SAVE);
2904
2905                 mockHttpAttribute("reportOwner", "Owner");
2906                 mockHttpAttribute("public", "Y");
2907                 mockHttpAttribute("newUserId", "Y");
2908                 
2909                 Mockito.when(reportDefinition.getReportSecurity()).thenReturn(reportSecurity);
2910                 wizardProcessor.processWizardStep(httpServletRequest);
2911         
2912                 Mockito.verify(wizardProcessor, Mockito.times(1)).processWizardStep(httpServletRequest);
2913         }               
2914
2915         @Test
2916         public void testProcessWizardStep_processUserAccess_Delete_User_case1() throws Exception {
2917                 mockHttpParameter(AppConstants.RI_WIZARD_ACTION, AppConstants.WA_DELETE_USER);
2918                 mockHttpAttribute(AppConstants.RI_REPORT_ID,REPORT_ID);
2919                 mockHttpAttribute("showDashboardOptions","");
2920                 mockHttpAttribute(AppConstants.RI_DETAIL_ID,DETAIL_ID);
2921                 mockHttpAttribute("blueBarField", "REPORT ID");
2922
2923                 setWizardSteps(AppConstants.WS_USER_ACCESS, AppConstants.WA_SAVE);
2924
2925                 mockHttpAttribute("reportOwner", "Owner");
2926                 mockHttpAttribute("public", "Y");
2927                 mockHttpAttribute("newUserId", "Y");
2928
2929                 Mockito.when(reportDefinition.getReportSecurity()).thenReturn(reportSecurity);
2930
2931                 wizardProcessor.processWizardStep(httpServletRequest);
2932         
2933                 Mockito.verify(wizardProcessor, Mockito.times(1)).processWizardStep(httpServletRequest);
2934         }               
2935         
2936         @Test
2937         public void testProcessImportSemaphore_case1() throws Exception {
2938                 mockHttpAttribute(AppConstants.RI_REPORT_ID,REPORT_ID);
2939                 Mockito.when(reportRuntime.getSemaphoreList()).thenReturn(null);
2940                 wizardProcessor.processImportSemaphorePopup(httpServletRequest);
2941         
2942                 Mockito.verify(wizardProcessor, Mockito.times(1)).processImportSemaphorePopup(httpServletRequest);
2943         }               
2944         
2945         @Test
2946         public void testProcessImportSemaphore_case2() throws Exception {
2947                 SemaphoreList semaphoreList = new SemaphoreList();              
2948                 List<SemaphoreType> listSemaphoreType = semaphoreList.getSemaphore();
2949                 
2950                 SemaphoreType st1 = new SemaphoreType();
2951                 SemaphoreType st2 = new SemaphoreType();
2952                 
2953                 st1.setSemaphoreName("Name1");
2954             st1.setSemaphoreId("Id1");
2955             
2956                 st2.setSemaphoreName("Name2");
2957             st2.setSemaphoreId("Id2");
2958             
2959             listSemaphoreType.add(st1);
2960             listSemaphoreType.add(st2);
2961                 
2962             mockHttpAttribute(AppConstants.RI_REPORT_ID, REPORT_ID);
2963                 
2964                 Mockito.when(reportRuntime.getSemaphoreList()).thenReturn(semaphoreList);
2965                 
2966                 Mockito.when(reportDefinition.addSemaphore(Mockito.anyObject(), Mockito.anyObject())).thenReturn(st1);
2967                 
2968                 wizardProcessor.processImportSemaphorePopup(httpServletRequest);
2969         
2970                 Mockito.verify(wizardProcessor, Mockito.times(1)).processImportSemaphorePopup(httpServletRequest);
2971         }               
2972         
2973         /*
2974
2975         @Test
2976         public void testProcessSemaphorePopup_case1() throws Exception {
2977                 SemaphoreList semaphoreList = new SemaphoreList();              
2978                 List<SemaphoreType> listSemaphoreType = semaphoreList.getSemaphore();
2979                 
2980                 SemaphoreType st1 = new SemaphoreType();
2981                 SemaphoreType st2 = new SemaphoreType();
2982                 
2983                 st1.setSemaphoreName("Name1");
2984             st1.setSemaphoreId("Id1");
2985             
2986                 st2.setSemaphoreName("Name2");
2987             st2.setSemaphoreId("Id2");
2988             
2989             listSemaphoreType.add(st1);
2990             listSemaphoreType.add(st2);
2991                 
2992             mockHttpAttribute(AppConstants.RI_REPORT_ID, REPORT_ID);
2993                 
2994                 Mockito.when(reportRuntime.getSemaphoreList()).thenReturn(semaphoreList);
2995                 
2996                 Mockito.when(reportDefinition.addSemaphore(Mockito.anyObject(), Mockito.anyObject())).thenReturn(st1);
2997                 
2998                 wizardProcessor.processSemaphorePopup(httpServletRequest);
2999         
3000                 Mockito.verify(wizardProcessor, Mockito.times(1)).processImportSemaphorePopup(httpServletRequest);
3001         }               
3002
3003 */
3004         
3005         /*
3006         
3007         private void mockHttpAttribute(String attributeName, String attributeValue) {
3008                 mockHttpAttribute(attributeName)).thenReturn(attributeValue);
3009         }
3010         
3011         private void mockHttpParameterValues(String parameterName, String[] parameterValue) {
3012                 Mockito.when(httpServletRequest.getParameterValues(parameterName)).thenReturn(parameterValue);
3013         }*/
3014
3015
3016         /*
3017         @Test
3018         public void testProcessWizardStep_processTableAdd_case1() throws Exception {
3019                 //ReportSecurity reportSecurity = new ReportSecurity("10001");
3020                 
3021                 String reportUserAccessSql= Globals.getReportUserAccess();
3022                 reportUserAccessSql = reportUserAccessSql.replace("[reportID]", "1001");
3023                                                                 
3024                 PowerMockito.when(DbUtils.executeQuery(reportUserAccessSql)).thenReturn(dataSet1);
3025                 
3026                 String dataMock[][] = { {"Role1", "User1"},{"Role2", "User2"},{"Role3", "User3"} };
3027                 
3028                 
3029                 Mockito.when (dataSet1.getRowCount()).thenReturn(3);
3030                 
3031                 PowerMockito.when(dataSet1.getString(Mockito.anyInt(), Mockito.anyInt())).thenAnswer(new Answer<String>() {
3032                         
3033                         @Override
3034                         public String answer(InvocationOnMock invocation) throws Throwable {
3035                               Object[] args = invocation.getArguments();
3036                               int row = (int) args[0];
3037                               int col = (int) args[1];
3038                               
3039                               if (col < 2)
3040                                   return dataMock[row][col];
3041                               else
3042                                   return "Y";
3043                         }
3044                 });
3045                 
3046                 String newScheduleSql = Globals.getNewScheduleData();
3047                 PowerMockito.when(DbUtils.executeQuery(newScheduleSql)).thenReturn(dataSet2);
3048
3049                 Mockito.when(dataSet2.getString(0,0)).thenReturn("4001");
3050                 
3051
3052                 CustomReportType customReportType = new CustomReportType();
3053                 
3054                 customReportType.setReportName("ONAP Portal users");
3055                 customReportType.setReportDescr("Report for ONAP Portal users");
3056                 customReportType.setChartType("Bar Chart");
3057                 customReportType.setCreateId("2001");
3058                 customReportType.setReportType("User Type");
3059                 
3060                 GregorianCalendar gregorianCalendar = new GregorianCalendar();
3061                 gregorianCalendar.setTime(Calendar.getInstance().getTime());
3062                 
3063                 customReportType.setCreateDate(DatatypeFactory.newInstance().newXMLGregorianCalendar(gregorianCalendar));
3064                 
3065                 ReportWrapper rw = new ReportWrapper(customReportType,"1001", "ONAP PORTAL", "2001", "", "", "", "", false);
3066                 
3067                 //ReportWrapper(CustomReportType cr, String reportID, String ownerID, String createID, String createDate, String updateID, String updateDate, String menuID, boolean menuApproved)
3068                 
3069                 ReportDefinition localReportDefinition = new ReportDefinition(rw, httpServletRequest);
3070                 
3071                 Mockito.when(httpServletRequest.getParameter(AppConstants.RI_WIZARD_ACTION)).thenReturn(AppConstants.WA_VALIDATE);
3072                 mockHttpAttribute(AppConstants.RI_REPORT_ID)).thenReturn("1001");
3073                 mockHttpAttribute("showDashboardOptions")).thenReturn("");
3074                 mockHttpAttribute("folder_id")).thenReturn("2001");
3075                 
3076                 Mockito.when(reportHandler.loadReportDefinition(httpServletRequest, "1001")).thenReturn(localReportDefinition);
3077                 
3078                 Mockito.when(reportDefinition.getWizardSequence()).thenReturn(wizardSequence);
3079                 Mockito.when(wizardSequence.getCurrentStep()).thenReturn(AppConstants.WS_TABLES); 
3080                 Mockito.when(wizardSequence.getCurrentSubStep()).thenReturn(AppConstants.WSS_ADD);
3081
3082                 Mockito.when(reportDefinition.getReportID()).thenReturn("10001");
3083                 mockHttpAttribute("reportSQL")).thenReturn("SELECT  [colNames.toString()] FROM ( [reportSQL]");
3084                 
3085                 
3086                 mockHttpAttribute("tableName")).thenReturn("cr_report_access crc");
3087                 mockHttpAttribute("joinTableName")).thenReturn("cr_report cr");
3088                 mockHttpAttribute("joinExpr")).thenReturn("crc.rep_id = cr.rep_id");
3089                 mockHttpAttribute("tablePK")).thenReturn("crc.rep_id");
3090                 mockHttpAttribute("displayName")).thenReturn("Report Access");
3091                         
3092                 String columnNames[] = {"ID", "COL1", "COL2", "COL3"};
3093                 String columnType[] = {"Integer", "VARCHAR2", "VARCHAR2", "VARCHAR2"};
3094                 //String columnVal[] = {"1", "Val1", "Val2", "Val3"};
3095                 
3096
3097                 
3098                 Mockito.when(resultSet.next()).thenReturn(true);
3099                 Mockito.when(resultSet.getMetaData()).thenReturn(resultSetMetaData);
3100
3101                 Mockito.when(resultSetMetaData.getColumnCount()).thenReturn(columnNames.length);
3102                         
3103                 Mockito.when(resultSetMetaData.getColumnLabel(Mockito.anyInt())).thenAnswer(new Answer<String>() {
3104                         
3105                         @Override
3106                         public String answer(InvocationOnMock invocation) throws Throwable {
3107                               Object[] args = invocation.getArguments();
3108                               int columnIndex = Integer.parseInt((String) args[0]);
3109                                         return columnNames[columnIndex+1];
3110                         }
3111                 });
3112                 
3113                 Mockito.when(resultSetMetaData.getColumnType(Mockito.anyInt())).thenAnswer(new Answer<String>() {
3114                         
3115                         @Override
3116                         public String answer(InvocationOnMock invocation) throws Throwable {
3117                               Object[] args = invocation.getArguments();
3118                               int columnIndex = Integer.parseInt((String) args[0]);
3119                                         return columnType[columnIndex+1];
3120                         }
3121                 });     
3122                 
3123                 //DataSet localDataSet = new DataSet(resultSet);                                
3124                 //PowerMockito.when(DbUtils.executeQuery(reportUserAccessSql)).thenReturn(localDataSet);
3125                 
3126                 wizardProcessor.processWizardStep(httpServletRequest);
3127         }
3128         
3129         
3130         @Test
3131         public void testProcessWizardStep_not_null_arguments_crosstab() throws Exception {
3132                 PowerMockito.whenNew(ReportHandler.class).withNoArguments().thenReturn(reportHandler);  
3133                 Mockito.when(AppUtils.getRequestValue(httpServletRequest, AppConstants.RI_REPORT_ID)).thenReturn("1000");
3134                 Mockito.when(AppUtils.getRequestNvlValue(httpServletRequest, "showDashboardOptions")).thenReturn("");
3135         
3136                 Mockito.when(AppUtils.getRequestNvlValue(httpServletRequest, "reportType")).thenReturn(AppConstants.RT_CROSSTAB);
3137                 Mockito.when(reportHandler.loadReportDefinition(httpServletRequest,"1000")).thenReturn(reportDefinition);
3138                 
3139                 Mockito.when(httpServletRequest.getParameter(AppConstants.RI_WIZARD_ACTION)).thenReturn("NA");
3140                 Mockito.when(reportDefinition.getWizardSequence()).thenReturn(wizardSequence);
3141                 Mockito.when(wizardSequence.getCurrentStep()).thenReturn(AppConstants.WS_DEFINITION);
3142                 Mockito.when(wizardSequence.getCurrentSubStep()).thenReturn("NA");
3143                 
3144                 Mockito.when(reportDefinition.getReportID()).thenReturn("1");
3145                 Mockito.when(reportDefinition.getReportType()).thenReturn(AppConstants.RT_CROSSTAB);
3146                 
3147                 mockHttpAttribute("reportName")).thenReturn("Report 1");
3148                 mockHttpAttribute("reportDescr")).thenReturn("Report One help for testing...");
3149
3150                 wizardProcessor.processWizardStep(httpServletRequest);
3151                 
3152
3153                 //Mockito.when(AppUtils.getRequestNvlValue(httpServletRequest, "widthNo")).thenReturn("500px");
3154
3155                 //wizardProcessor.processWizardStep(httpServletRequest);
3156                 
3157                 
3158                 
3159         }
3160         
3161         ***/
3162         
3163         /***
3164
3165         @throws Exception 
3166          * @Test
3167         public void testProcessImportSemaphorePopup() {
3168                 fail("Not yet implemented");
3169         }
3170
3171         @Test
3172         public void testProcessSemaphorePopup() {
3173                 fail("Not yet implemented");
3174         }
3175 */
3176         
3177         @Test
3178         public void testProcessAdhocSchedule_Add_User_case1() throws Exception {
3179                 
3180                 mockHttpAttribute("pdfAttachmentKey", "PdfKey");
3181                 mockHttpAttribute("log_id", "Log#1234");
3182                 mockHttpAttribute("user_id", "demo");
3183                 
3184                 mockHttpAttribute("schedEnabled", "N");
3185                 mockHttpAttribute("schedStartDate", "03/12/2018");
3186                 mockHttpAttribute("schedEndDate", "03/12/2999");
3187                 mockHttpAttribute("schedEndHour", "9");
3188                 mockHttpAttribute("schedMin", "30");
3189                 mockHttpAttribute("schedEndMin", "10");
3190                 mockHttpAttribute("schedEndAMPM", "AM");
3191                 mockHttpAttribute("schedRunDate", "N");
3192                 mockHttpAttribute("schedHour", "10");
3193                 mockHttpAttribute("schedAMPM", "AM");
3194                                 
3195                 mockHttpAttribute("schedRecurrence", "Y");
3196                 
3197                 mockHttpAttribute("conditional", "Y");
3198                 
3199                 mockHttpAttribute("conditionSQL", "REPORT_ID=1001");
3200                 mockHttpAttribute("notify_type", "QUEUE");
3201                 mockHttpAttribute("downloadLimit", "1024mb");
3202                 mockHttpAttribute("formFields", "REPORT_ID");
3203                 
3204                 mockHttpAttribute("sendAttachment", "Y");
3205
3206                 mockHttpAttribute("schedEmailAdd", "Y");
3207                 mockHttpAttribute("schedEmailAddRole", "Y");
3208                 
3209                 Mockito.when(httpServletRequest.getSession(false)).thenReturn(httpSession);
3210                 Mockito.when(httpSession.getAttribute("user_attribute_name") ).thenReturn(user);
3211                 
3212                 PowerMockito.when(Globals.getUseLoginIdInSchedYN()).thenReturn("Y");
3213
3214                 wizardProcessor.processAdhocSchedule(httpServletRequest, AppConstants.WA_ADD_USER);
3215
3216                 Mockito.verify(wizardProcessor, Mockito.times(1)).processAdhocSchedule(httpServletRequest, AppConstants.WA_ADD_USER);
3217         }
3218
3219         @Test
3220         public void testProcessAdhocSchedule_Delete_User_case1() throws Exception {
3221
3222                 mockHttpAttribute(AppConstants.RI_DETAIL_ID, "2001");
3223                 mockHttpAttribute("pdfAttachmentKey", "PdfKey");
3224                 mockHttpAttribute("log_id", "Log#1234");
3225                 mockHttpAttribute("user_id", "demo");
3226                 
3227                 mockHttpAttribute("schedEnabled", "N");
3228                 mockHttpAttribute("schedStartDate", "03/12/2018");
3229                 mockHttpAttribute("schedEndDate", "03/12/2999");
3230                 mockHttpAttribute("schedEndHour", "9");
3231                 mockHttpAttribute("schedMin", "30");
3232                 mockHttpAttribute("schedEndMin", "10");
3233                 mockHttpAttribute("schedEndAMPM", "AM");
3234                 mockHttpAttribute("schedRunDate", "N");
3235                 mockHttpAttribute("schedHour", "10");
3236                 mockHttpAttribute("schedAMPM", "AM");
3237                                 
3238                 mockHttpAttribute("schedRecurrence", "Y");
3239                 mockHttpAttribute("conditional", "Y");
3240                 
3241                 mockHttpAttribute("conditionSQL", "REPORT_ID=1001");
3242                 mockHttpAttribute("notify_type", "QUEUE");
3243                 mockHttpAttribute("downloadLimit", "1024mb");
3244                 mockHttpAttribute("formFields", "REPORT_ID");
3245                 
3246                 mockHttpAttribute("sendAttachment", "Y");
3247                 mockHttpAttribute("schedEmailAdd", "Y");
3248                 mockHttpAttribute("schedEmailAddRole", "Y");
3249                 
3250                 Mockito.when(httpServletRequest.getSession(false)).thenReturn(httpSession);
3251                 Mockito.when(httpSession.getAttribute("user_attribute_name") ).thenReturn(user);
3252                 
3253                 wizardProcessor.processAdhocSchedule(httpServletRequest, AppConstants.WA_DELETE_USER);
3254                 Mockito.verify(wizardProcessor, Mockito.times(1)).processAdhocSchedule(httpServletRequest, AppConstants.WA_DELETE_USER);
3255         }
3256  
3257
3258         @Test
3259         public void testProcessAdhocSchedule_Add_Role_case1() throws Exception {
3260
3261                 mockHttpAttribute(AppConstants.RI_DETAIL_ID, "2001");
3262                 mockHttpAttribute("pdfAttachmentKey", "PdfKey");
3263                 mockHttpAttribute("log_id", "Log#1234");
3264                 mockHttpAttribute("user_id", "demo");
3265                 
3266                 mockHttpAttribute("schedEnabled", "N");
3267                 mockHttpAttribute("schedStartDate", "03/12/2018");
3268                 mockHttpAttribute("schedEndDate", "03/12/2999");
3269                 mockHttpAttribute("schedEndHour", "9");
3270                 mockHttpAttribute("schedMin", "30");
3271                 mockHttpAttribute("schedEndMin", "10");
3272                 mockHttpAttribute("schedEndAMPM", "AM");
3273                 mockHttpAttribute("schedRunDate", "N");
3274                 mockHttpAttribute("schedHour", "10");
3275                 mockHttpAttribute("schedAMPM", "AM");
3276                                 
3277                 mockHttpAttribute("schedRecurrence", "Y");
3278                 
3279                 mockHttpAttribute("conditional", "Y");
3280                 
3281                 mockHttpAttribute("conditionSQL", "REPORT_ID=1001");
3282                 mockHttpAttribute("notify_type", "QUEUE");
3283                 mockHttpAttribute("downloadLimit", "1024mb");
3284                 mockHttpAttribute("formFields", "REPORT_ID");
3285                 
3286                 mockHttpAttribute("sendAttachment", "Y");
3287
3288                 mockHttpAttribute("schedEmailAdd", "Y");
3289                 mockHttpAttribute("schedEmailAddRole", "Y");
3290                 
3291                 Mockito.when(httpServletRequest.getSession(false)).thenReturn(httpSession);
3292
3293                 Mockito.when(httpSession.getAttribute("user_attribute_name") ).thenReturn(user);
3294                 
3295                 PowerMockito.when(Globals.getUseLoginIdInSchedYN()).thenReturn("Y");
3296                 
3297                 wizardProcessor.processAdhocSchedule(httpServletRequest, AppConstants.WA_ADD_ROLE);
3298                 Mockito.verify(wizardProcessor, Mockito.times(1)).processAdhocSchedule(httpServletRequest, AppConstants.WA_ADD_ROLE);           
3299         }
3300
3301
3302         @Test
3303         public void testProcessAdhocSchedule_Delete_Role_case1() throws Exception {
3304
3305                 mockHttpAttribute(AppConstants.RI_DETAIL_ID, "2001");
3306                 mockHttpAttribute("pdfAttachmentKey", "PdfKey");
3307                 mockHttpAttribute("log_id", "Log#1234");
3308                 mockHttpAttribute("user_id", "demo");
3309                 
3310                 mockHttpAttribute("schedEnabled", "N");
3311                 mockHttpAttribute("schedStartDate", "03/12/2018");
3312                 mockHttpAttribute("schedEndDate", "03/12/2999");
3313                 mockHttpAttribute("schedEndHour", "9");
3314                 mockHttpAttribute("schedMin", "30");
3315                 mockHttpAttribute("schedEndMin", "10");
3316                 mockHttpAttribute("schedEndAMPM", "AM");
3317                 mockHttpAttribute("schedRunDate", "N");
3318                 mockHttpAttribute("schedHour", "10");
3319                 mockHttpAttribute("schedAMPM", "AM");
3320                                 
3321                 mockHttpAttribute("schedRecurrence", "Y");
3322                 
3323                 mockHttpAttribute("conditional", "Y");
3324                 
3325                 mockHttpAttribute("conditionSQL", "REPORT_ID=1001");
3326                 mockHttpAttribute("notify_type", "QUEUE");
3327                 mockHttpAttribute("downloadLimit", "1024mb");
3328                 mockHttpAttribute("formFields", "REPORT_ID");
3329                 
3330                 mockHttpAttribute("sendAttachment", "Y");
3331
3332                 mockHttpAttribute("schedEmailAdd", "Y");
3333                 mockHttpAttribute("schedEmailAddRole", "Y");
3334                 Mockito.when(httpServletRequest.getSession(false)).thenReturn(httpSession);
3335                 Mockito.when(httpSession.getAttribute("user_attribute_name") ).thenReturn(user);
3336                 wizardProcessor.processAdhocSchedule(httpServletRequest, AppConstants.WA_DELETE_ROLE);
3337                 
3338         }
3339         
3340
3341         private void mockHttpAttribute(String attributeName, String attributeValue) {
3342                 Mockito.when(httpServletRequest.getAttribute(attributeName)).thenReturn(attributeValue);
3343         }
3344         
3345         private void mockHttpParameter(String parameterName, String parameterValue) {
3346                 Mockito.when(httpServletRequest.getParameter(parameterName)).thenReturn(parameterValue);
3347         }
3348         
3349         private void mockHttpParameterValues(String parameterName, String[] parameterValue) {
3350                 Mockito.when(httpServletRequest.getParameterValues(parameterName)).thenReturn(parameterValue);
3351         }       
3352
3353 }