Produced by Araxis Merge on 12/20/2017 5:56:13 PM Eastern Standard Time. See www.araxis.com for information about Merge. This report uses XHTML and CSS2, and is best viewed with a modern standards-compliant browser. For optimum results when printing this report, use landscape orientation and enable printing of background images and colours in your browser.
| # | Location | File | Last Modified |
|---|---|---|---|
| 1 | Genisis_2.0_v6_bld6.zip\Source Code\UI\Services\src\test\java\gov\va\genisis2\util | Helper.java | Thu Dec 14 19:57:10 2017 UTC |
| 2 | Genisis_2.0_v6_bld6.zip\Source Code\UI\Services\src\test\java\gov\va\genisis2\util | Helper.java | Wed Dec 20 14:12:59 2017 UTC |
| Description | Between Files 1 and 2 |
|
|---|---|---|
| Text Blocks | Lines | |
| Unchanged | 2 | 1402 |
| Changed | 1 | 2 |
| Inserted | 0 | 0 |
| Removed | 0 | 0 |
| Whitespace | |
|---|---|
| Character case | Differences in character case are significant |
| Line endings | Differences in line endings (CR and LF characters) are ignored |
| CR/LF characters | Not shown in the comparison detail |
No regular expressions were active.
| 1 | package go v.va.genis is2.util; | |
| 2 | ||
| 3 | import jav a.util.Arr ayList; | |
| 4 | import jav a.util.Arr ays; | |
| 5 | import jav a.util.Cal endar; | |
| 6 | import jav a.util.Dat e; | |
| 7 | import jav a.util.Has hSet; | |
| 8 | import jav a.util.Lis t; | |
| 9 | import jav a.util.Set ; | |
| 10 | ||
| 11 | import gov .va.genisi s2.common. enums.User StatusEnum ; | |
| 12 | import gov .va.genisi s2.dto.Com mentHistor yDTO; | |
| 13 | import gov .va.genisi s2.dto.Dat aTypeDTO; | |
| 14 | import gov .va.genisi s2.dto.Req uestDTO; | |
| 15 | import gov .va.genisi s2.dto.Req uestHistor yDTO; | |
| 16 | import gov .va.genisi s2.dto.Req uestTypeDT O; | |
| 17 | import gov .va.genisi s2.dto.Rol eTypeDTO; | |
| 18 | import gov .va.genisi s2.dto.Sou rceDTO; | |
| 19 | import gov .va.genisi s2.dto.Stu dyApproval DTO; | |
| 20 | import gov .va.genisi s2.dto.Wor kflowStatu sDTO; | |
| 21 | import gov .va.genisi s2.model.C ommentHist ory; | |
| 22 | import gov .va.genisi s2.model.C ommentType ; | |
| 23 | import gov .va.genisi s2.model.D ataType; | |
| 24 | import gov .va.genisi s2.model.R efreshHist ory; | |
| 25 | import gov .va.genisi s2.model.R equest; | |
| 26 | import gov .va.genisi s2.model.R equestHist ory; | |
| 27 | import gov .va.genisi s2.model.R equestType ; | |
| 28 | import gov .va.genisi s2.model.R oleType; | |
| 29 | import gov .va.genisi s2.model.S ource; | |
| 30 | import gov .va.genisi s2.model.S tudyApprov al; | |
| 31 | import gov .va.genisi s2.model.U ser; | |
| 32 | import gov .va.genisi s2.model.U serApprove r; | |
| 33 | import gov .va.genisi s2.model.U serCount; | |
| 34 | import gov .va.genisi s2.model.U serRoleTyp e; | |
| 35 | import gov .va.genisi s2.model.U serType; | |
| 36 | import gov .va.genisi s2.model.W orkflowSta tus; | |
| 37 | import gov .va.genisi s2.vo.Copy TableSourc e; | |
| 38 | import gov .va.genisi s2.vo.Ldap User; | |
| 39 | ||
| 40 | /** | |
| 41 | * @author Getaneh K assahun | |
| 42 | * | |
| 43 | * | |
| 44 | */ | |
| 45 | public cla ss Helper { | |
| 46 | ||
| 47 | /* * | |
| 48 | * This meth od is used to getNew Request. | |
| 49 | * | |
| 50 | * @return t his return s new requ est. | |
| 51 | * | |
| 52 | * / | |
| 53 | pu blic stati c Request getNewRequ est() { | |
| 54 | Requ est reques t = new Re quest(); | |
| 55 | requ est.setId( 1); | |
| 56 | requ est.setTit le("Postma n Sample C reate Requ est"); | |
| 57 | requ est.setDes cription(" This is a sample new request f or demo pu rposes"); | |
| 58 | requ est.setReq uestTypeId (1); | |
| 59 | requ est.setSou rceId(1); | |
| 60 | requ est.setStu dyApproval Id(176); | |
| 61 | requ est.setCre atedBy("ge nisisresea rcher1@gma il.com"); | |
| 62 | requ est.setCre atedOn(new Date()); | |
| 63 | requ est.setMod ifiedBy("g enisisrese archer1@gm ail.com"); | |
| 64 | requ est.setMod ifiedOn(ne w Date()); | |
| 65 | // r equest.set Type(1); | |
| 66 | requ est.setTas kId("taskI d"); | |
| 67 | requ est.setPro cessId(1); | |
| 68 | requ est.setApp roverId("g enisismger 1@gmail.co m"); | |
| 69 | requ est.setReq uestHistor ies(getNew RequestHis tories()); | |
| 70 | requ est.setSta tusDescrip tion("Stat usDescript ion"); | |
| 71 | ||
| 72 | retu rn request ; | |
| 73 | } | |
| 74 | ||
| 75 | pr ivate stat ic Set<Req uestHistor y> getNewR equestHist ories() { | |
| 76 | Set< RequestHis tory> requ estHistori es = new H ashSet<>(A rrays.asLi st(getNewR equestHist ory())); | |
| 77 | ||
| 78 | retu rn request Histories; | |
| 79 | } | |
| 80 | ||
| 81 | pu blic stati c RequestH istory get NewRequest History() { | |
| 82 | Requ estHistory requestHi story = ne w RequestH istory(); | |
| 83 | ||
| 84 | requ estHistory .setHistLi neNo(1); | |
| 85 | requ estHistory .setReques t(new Requ est()); | |
| 86 | requ estHistory .setProces sId(1); | |
| 87 | requ estHistory .setTitle( "Postman S ample Crea te Request - Updated "); | |
| 88 | requ estHistory .setDescri ption("Thi s is a sam ple new re quest for demo purpo ses - upda ted"); | |
| 89 | requ estHistory .setStatus Descriptio n("Draft") ; | |
| 90 | requ estHistory .setReques tTypeId(1) ; | |
| 91 | requ estHistory .setSource Id(1); | |
| 92 | requ estHistory .setStudyA pprovalId( 1); | |
| 93 | requ estHistory .setCreate dOn(new Da te()); | |
| 94 | requ estHistory .setModifi edOn(new D ate()); | |
| 95 | requ estHistory .setCreate dBy("genis isdatamgr1 @gmail.com "); | |
| 96 | requ estHistory .setModifi edBy("rese archer1"); | |
| 97 | requ estHistory .setApprov erId("geni sisdatamgr 2@gmail.co m"); | |
| 98 | requ estHistory .setTaskId ("taskId") ; | |
| 99 | requ estHistory .setDataTy peId(1); | |
| 100 | ||
| 101 | retu rn request History; | |
| 102 | } | |
| 103 | ||
| 104 | pu blic stati c RequestH istoryDTO getRequest HistoryDTO () { | |
| 105 | Requ estHistory DTO reques tHistoryDT O = new Re questHisto ryDTO(); | |
| 106 | ||
| 107 | requ estHistory DTO.setHis tLineNo(1) ; | |
| 108 | requ estHistory DTO.setPro cessId(1); | |
| 109 | requ estHistory DTO.setTit le("Postma n Sample C reate Requ est - Upda ted"); | |
| 110 | requ estHistory DTO.setDes cription(" This is a sample new request f or demo pu rposes - u pdated"); | |
| 111 | requ estHistory DTO.setSta tusDescrip tion("Draf t"); | |
| 112 | requ estHistory DTO.setReq uestTypeId (1); | |
| 113 | requ estHistory DTO.setSou rceId(1); | |
| 114 | requ estHistory DTO.setStu dyApproval Id(1); | |
| 115 | requ estHistory DTO.setCre atedOn(new Date()); | |
| 116 | requ estHistory DTO.setMod ifiedOn(ne w Date()); | |
| 117 | requ estHistory DTO.setCre atedBy("ge nisisdatam gr1@gmail. com"); | |
| 118 | requ estHistory DTO.setMod ifiedBy("r esearcher1 "); | |
| 119 | requ estHistory DTO.setApp roverId("g enisisdata mgr2@gmail .com"); | |
| 120 | requ estHistory DTO.setTas kId("taskI d"); | |
| 121 | requ estHistory DTO.setDat aTypeId(1) ; | |
| 122 | ||
| 123 | retu rn request HistoryDTO ; | |
| 124 | } | |
| 125 | ||
| 126 | /* * | |
| 127 | * This meth od is used to getExi stingReque st. | |
| 128 | * | |
| 129 | * @return t his return s Existing Request. | |
| 130 | * | |
| 131 | * / | |
| 132 | pu blic stati c Request getExistin gRequest() { | |
| 133 | Requ est reques t = new Re quest(); | |
| 134 | requ est.setPro cessId(999 999999); | |
| 135 | requ est.setId( 1); | |
| 136 | requ est.setTit le("Postma n Sample C reate Requ est"); | |
| 137 | requ est.setDes cription(" This is a sample new request f or demo pu rposes"); | |
| 138 | requ est.setSta tusDescrip tion("Retu rn"); | |
| 139 | requ est.setCre atedOn(new Date()); | |
| 140 | // r equest.set Type(1); | |
| 141 | requ est.setCre atedBy("re searcher1" ); | |
| 142 | requ est.setMod ifiedBy("r esearcher1 "); | |
| 143 | requ est.setApp roverId("d atamanager 1"); | |
| 144 | // r equest.set Comments(" Need more informatio n"); | |
| 145 | requ est.setSou rce(getNew Source()); | |
| 146 | requ est.setReq uestType(g etNewReque stType()); | |
| 147 | requ est.setStu dyApproval (getStudyA pproval()) ; | |
| 148 | requ est.setDat aTypeId(ge tDataType( ).getId()) ; | |
| 149 | requ est.setDat aType(getD ataType()) ; | |
| 150 | ||
| 151 | retu rn request ; | |
| 152 | } | |
| 153 | ||
| 154 | pu blic stati c RequestD TO getRequ estDTO() { | |
| 155 | Requ estDTO req uestDTO = new Reques tDTO(); | |
| 156 | requ estDTO.set ProcessId( 999999999) ; | |
| 157 | requ estDTO.set Id(1); | |
| 158 | requ estDTO.set Title("Pos tman Sampl e Create R equest"); | |
| 159 | requ estDTO.set Descriptio n("This is a sample new reques t for demo purposes" ); | |
| 160 | requ estDTO.set StatusDesc ription("R eturn"); | |
| 161 | requ estDTO.set CreatedOn( new Date() ); | |
| 162 | // r equest.set Type(1); | |
| 163 | requ estDTO.set CreatedBy( "researche r1"); | |
| 164 | requ estDTO.set ModifiedBy ("research er1"); | |
| 165 | requ estDTO.set ApproverId ("datamana ger1"); | |
| 166 | // r equest.set Comments(" Need more informatio n"); | |
| 167 | requ estDTO.set Source(get SourceDTO( )); | |
| 168 | requ estDTO.set RequestTyp e(getReque stTypeDTO( )); | |
| 169 | requ estDTO.set StudyAppro val(getStu dyApproval DTO()); | |
| 170 | requ estDTO.set DataTypeId (getDataTy pe().getId ()); | |
| 171 | requ estDTO.set DataType(g etDataType DTO()); | |
| 172 | ||
| 173 | retu rn request DTO; | |
| 174 | } | |
| 175 | ||
| 176 | pu blic stati c DataType DTO getDat aTypeDTO() { | |
| 177 | ||
| 178 | Data TypeDTO da taTypeDTO = new Data TypeDTO(); | |
| 179 | data TypeDTO.se tId(1); | |
| 180 | data TypeDTO.se tDescripti on("Aggreg ate Data") ; | |
| 181 | ||
| 182 | retu rn dataTyp eDTO; | |
| 183 | } | |
| 184 | ||
| 185 | pu blic stati c RequestT ypeDTO get RequestTyp eDTO() { | |
| 186 | ||
| 187 | Requ estTypeDTO requestTy peDTO = ne w RequestT ypeDTO(); | |
| 188 | requ estTypeDTO .setId(1); | |
| 189 | requ estTypeDTO .setDescri ption("VIN CI Data Re quest"); | |
| 190 | ||
| 191 | retu rn request TypeDTO; | |
| 192 | } | |
| 193 | ||
| 194 | pu blic stati c SourceDT O getSourc eDTO() { | |
| 195 | ||
| 196 | Sour ceDTO sour ceDTO = ne w SourceDT O(); | |
| 197 | sour ceDTO.setD escription ("Survey") ; | |
| 198 | sour ceDTO.setI d(1); | |
| 199 | ||
| 200 | retu rn sourceD TO; | |
| 201 | } | |
| 202 | ||
| 203 | pu blic stati c DataType getDataTy pe() { | |
| 204 | ||
| 205 | Data Type dataT ype = new DataType() ; | |
| 206 | ||
| 207 | data Type.setId (1); | |
| 208 | data Type.setDe scription( "Aggregate Data"); | |
| 209 | ||
| 210 | retu rn dataTyp e; | |
| 211 | } | |
| 212 | ||
| 213 | /* * | |
| 214 | * This meth od is used to getLis tOfRequest . | |
| 215 | * | |
| 216 | * @return t his return s listOfRe quest. | |
| 217 | * | |
| 218 | * / | |
| 219 | pu blic stati c List<Req uest> getL istOfReque st() { | |
| 220 | List <Request> listOfRequ est = new ArrayList< >(); | |
| 221 | Requ est reques t = getExi stingReque st(); | |
| 222 | Requ est reques t2 = getEx istingRequ est(); | |
| 223 | requ est2.setId (2); | |
| 224 | list OfRequest. add(reques t); | |
| 225 | list OfRequest. add(reques t2); | |
| 226 | ||
| 227 | retu rn listOfR equest; | |
| 228 | } | |
| 229 | ||
| 230 | /* * | |
| 231 | * Source | |
| 232 | * | |
| 233 | * @return S ource | |
| 234 | * / | |
| 235 | pu blic stati c Source g etNewSourc e() { | |
| 236 | Sour ce source = new Sour ce(); | |
| 237 | sour ce.setId(1 ); | |
| 238 | sour ce.setDesc ription("S urvey"); | |
| 239 | sour ce.setRequ ests(new H ashSet<>(A rrays.asLi st(new Req uest()))); | |
| 240 | ||
| 241 | retu rn source; | |
| 242 | } | |
| 243 | ||
| 244 | /* * | |
| 245 | * RequestTy pe | |
| 246 | * | |
| 247 | * @return R equestType | |
| 248 | * / | |
| 249 | pu blic stati c RequestT ype getNew RequestTyp e() { | |
| 250 | Requ estType re questType = new Requ estType(); | |
| 251 | requ estType.se tId(1); | |
| 252 | requ estType.se tDescripti on("VINCI Data Reque st"); | |
| 253 | requ estType.se tRequests( new HashSe t<>(Arrays .asList(ne w Request( )))); | |
| 254 | ||
| 255 | retu rn request Type; | |
| 256 | } | |
| 257 | ||
| 258 | /* * | |
| 259 | * StudyAppr oval | |
| 260 | * | |
| 261 | * @return S tudyApprov al | |
| 262 | * / | |
| 263 | pu blic stati c StudyApp roval getN ewStudyApp roval() { | |
| 264 | Stud yApproval studyAppro val = new StudyAppro val(); | |
| 265 | List <Integer> associated Approvals = new Arra yList<Inte ger>(); | |
| 266 | ||
| 267 | stud yApproval. setProcess Id(1); | |
| 268 | asso ciatedAppr ovals.add( 1); | |
| 269 | asso ciatedAppr ovals.add( 2); | |
| 270 | asso ciatedAppr ovals.add( 3); | |
| 271 | // s tudyApprov al.setAsso ciatedAppr ovals(asso ciatedAppr ovals); | |
| 272 | stud yApproval. setTitle(" Postman sa mple study approval" ); | |
| 273 | stud yApproval. setDescrip tion("this is a stud y approval for demo purposes") ; | |
| 274 | stud yApproval. setCreated By("resear cher1"); | |
| 275 | stud yApproval. setCreated On(new Dat e()); | |
| 276 | stud yApproval. setModifie dOn(new Da te()); | |
| 277 | stud yApproval. setApprova lIdObtaine d("approva lIdObtaine d"); | |
| 278 | stud yApproval. setModifie dBy("datam anager1"); | |
| 279 | stud yApproval. setCreated By("resear cher1"); | |
| 280 | stud yApproval. setRequest s(new Hash Set<>(Arra ys.asList( new Reques t()))); | |
| 281 | ||
| 282 | retu rn studyAp proval; | |
| 283 | } | |
| 284 | ||
| 285 | /* * | |
| 286 | * StudyAppr oval | |
| 287 | * | |
| 288 | * @return S tudyApprov al | |
| 289 | * | |
| 290 | * / | |
| 291 | pu blic stati c StudyApp roval getS tudyApprov al() { | |
| 292 | Stud yApproval studyAppro val = new StudyAppro val(); | |
| 293 | stud yApproval. setId(1); | |
| 294 | stud yApproval. setProcess Id(0); | |
| 295 | stud yApproval. setTitle(" csp572"); | |
| 296 | stud yApproval. setDescrip tion("csp5 72"); | |
| 297 | stud yApproval. setCreated On(new Dat e()); | |
| 298 | stud yApproval. setModifie dOn(new Da te()); | |
| 299 | stud yApproval. setProcess Id(9999999 99); | |
| 300 | stud yApproval. setApprova lIdObtaine d("approva lIdObtaine d"); | |
| 301 | stud yApproval. setModifie dBy("datam anager1"); | |
| 302 | stud yApproval. setCreated By("resear cher1"); | |
| 303 | ||
| 304 | retu rn studyAp proval; | |
| 305 | } | |
| 306 | ||
| 307 | pu blic stati c StudyApp rovalDTO g etStudyApp rovalDTO() { | |
| 308 | Stud yApprovalD TO studyAp proval = n ew StudyAp provalDTO( ); | |
| 309 | stud yApproval. setId(1); | |
| 310 | stud yApproval. setProcess Id(0); | |
| 311 | stud yApproval. setTitle(" csp572"); | |
| 312 | stud yApproval. setDescrip tion("csp5 72"); | |
| 313 | stud yApproval. setCreated On(new Dat e()); | |
| 314 | stud yApproval. setModifie dOn(new Da te()); | |
| 315 | stud yApproval. setProcess Id(9999999 99); | |
| 316 | stud yApproval. setApprova lIdObtaine d("approva lIdObtaine d"); | |
| 317 | stud yApproval. setModifie dBy("datam anager1"); | |
| 318 | stud yApproval. setCreated By("resear cher1"); | |
| 319 | ||
| 320 | retu rn studyAp proval; | |
| 321 | } | |
| 322 | ||
| 323 | /* * | |
| 324 | * User | |
| 325 | * | |
| 326 | * @return U ser | |
| 327 | * / | |
| 328 | pu blic stati c User get User() { | |
| 329 | User user = ne w User(); | |
| 330 | user .setFirstN ame("Getan eh"); | |
| 331 | user .setLastNa me("Kassa" ); | |
| 332 | user .setCreate Date(new D ate()); | |
| 333 | user .setEmailI d("genisis ad@gmail.c om"); | |
| 334 | user .setUserAc tive((byte ) 1); | |
| 335 | user .setActive Date(new D ate()); | |
| 336 | user .setInacti veDate(nul l); | |
| 337 | ||
| 338 | retu rn user; | |
| 339 | } | |
| 340 | ||
| 341 | /* * | |
| 342 | * User | |
| 343 | * | |
| 344 | * @return U ser | |
| 345 | * / | |
| 346 | pu blic stati c User get NewUser() { | |
| 347 | User user = ne w User(); | |
| 348 | user .setUserId (1); | |
| 349 | user .setFirstN ame("fNmae "); | |
| 350 | user .setMiddle Name("mNam e"); | |
| 351 | user .setLastNa me("lName" ); | |
| 352 | user .setLastNa me2("lName 2"); | |
| 353 | user .setCreate Date(new D ate()); | |
| 354 | user .setEmailI d("genisis datamgr1@g mail.com") ; | |
| 355 | user .setUserAc tive((byte ) 1); | |
| 356 | user .setActive Date(new D ate()); | |
| 357 | user .setInacti veDate(new Date()); | |
| 358 | user .setUserAp proversFor UserId(new HashSet<> (Arrays.as List(new U serApprove r()))); | |
| 359 | user .setUserRo leTypes(ne w HashSet< >(Arrays.a sList(new UserRoleTy pe()))); | |
| 360 | user .setUserAp proversFor UserApprov erId(new H ashSet<>(A rrays.asLi st(new Use rApprover( )))); | |
| 361 | ||
| 362 | retu rn user; | |
| 363 | } | |
| 364 | ||
| 365 | pu blic stati c User get UserLdap() { | |
| 366 | ||
| 367 | User user = ne w User(); | |
| 368 | user .setFirstN ame("First Name"); | |
| 369 | user .setLastNa me("LastNa me"); | |
| 370 | user .setEmailI d("EmailId "); | |
| 371 | user .setCreate Date(DateU til.getTod aysDate()) ; | |
| 372 | user .setUserAc tive((byte ) UserStat usEnum.ACT IVE.getId( )); | |
| 373 | user .setActive Date(DateU til.getTod aysDate()) ; | |
| 374 | user .setModifi edOn(DateU til.getTod aysDate()) ; | |
| 375 | user .setInacti veDate(Dat eUtil.getT odaysDate( )); | |
| 376 | user .setUserna me("VHAISM ICADM"); | |
| 377 | retu rn user; | |
| 378 | } | |
| 379 | ||
| 380 | /* * | |
| 381 | * StudyAppr oval | |
| 382 | * | |
| 383 | * @return S tudyApprov al | |
| 384 | * | |
| 385 | * / | |
| 386 | pu blic stati c List<Stu dyApproval > getListO fStudyAppr oval() { | |
| 387 | List <StudyAppr oval> list OfStudyApp roval = ne w ArrayLis t<StudyApp roval>(); | |
| 388 | ||
| 389 | Stud yApproval studyAppro val1 = new StudyAppr oval(); | |
| 390 | stud yApproval1 .setId(1); | |
| 391 | stud yApproval1 .setProces sId(0); | |
| 392 | stud yApproval1 .setTitle( "csp572"); | |
| 393 | stud yApproval1 .setDescri ption("csp 572"); | |
| 394 | stud yApproval1 .setCreate dOn(new Da te()); | |
| 395 | stud yApproval1 .setModifi edOn(new D ate()); | |
| 396 | stud yApproval1 .setProces sId(999999 999); | |
| 397 | stud yApproval1 .setApprov alIdObtain ed("approv alIdObtain ed"); | |
| 398 | stud yApproval1 .setModifi edBy("data manager1") ; | |
| 399 | stud yApproval1 .setCreate dBy("resea rcher1"); | |
| 400 | ||
| 401 | Stud yApproval studyAppro val2 = new StudyAppr oval(); | |
| 402 | stud yApproval2 .setId(2); | |
| 403 | stud yApproval2 .setProces sId(0); | |
| 404 | stud yApproval2 .setTitle( "csp572"); | |
| 405 | stud yApproval2 .setDescri ption("csp 572"); | |
| 406 | stud yApproval2 .setCreate dOn(new Da te()); | |
| 407 | stud yApproval2 .setModifi edOn(new D ate()); | |
| 408 | stud yApproval2 .setProces sId(999999 999); | |
| 409 | stud yApproval2 .setApprov alIdObtain ed("approv alIdObtain ed"); | |
| 410 | stud yApproval2 .setModifi edBy("data manager1") ; | |
| 411 | stud yApproval2 .setCreate dBy("resea rcher1"); | |
| 412 | ||
| 413 | list OfStudyApp roval.add( studyAppro val1); | |
| 414 | list OfStudyApp roval.add( studyAppro val2); | |
| 415 | ||
| 416 | retu rn listOfS tudyApprov al; | |
| 417 | } | |
| 418 | ||
| 419 | /* * | |
| 420 | * WorkflowS tatus | |
| 421 | * | |
| 422 | * @param st atus | |
| 423 | * @return W orkflowSta tus | |
| 424 | * | |
| 425 | * / | |
| 426 | pu blic stati c Workflow Status get WorkFlowSt atus(Strin g status) { | |
| 427 | Work flowStatus workflowS tatus = ne w Workflow Status(); | |
| 428 | ||
| 429 | swit ch (status ) { | |
| 430 | case "Draft": | |
| 431 | workfl owStatus.s etId(1); | |
| 432 | workfl owStatus.s etDescript ion("Draft "); | |
| 433 | break; | |
| 434 | case "Submitte d": | |
| 435 | workfl owStatus.s etId(2); | |
| 436 | workfl owStatus.s etDescript ion("Submi tted"); | |
| 437 | break; | |
| 438 | case "Denied": | |
| 439 | workfl owStatus.s etId(3); | |
| 440 | workfl owStatus.s etDescript ion("Denie d"); | |
| 441 | break; | |
| 442 | case "Returned ": | |
| 443 | workfl owStatus.s etId(4); | |
| 444 | workfl owStatus.s etDescript ion("Retur ned"); | |
| 445 | workfl owStatus.s etCommentH istories(n ew HashSet <>(Arrays. asList(new CommentHi story()))) ; | |
| 446 | break; | |
| 447 | case "Sent": | |
| 448 | workfl owStatus.s etId(5); | |
| 449 | workfl owStatus.s etDescript ion("Sent" ); | |
| 450 | break; | |
| 451 | case "Update": | |
| 452 | workfl owStatus.s etId(6); | |
| 453 | workfl owStatus.s etDescript ion("Updat e"); | |
| 454 | case "RequestA ccepted": | |
| 455 | workfl owStatus.s etId(7); | |
| 456 | workfl owStatus.s etDescript ion("Reque stAccepted "); | |
| 457 | break; | |
| 458 | case "RequestN otAccepted ": | |
| 459 | workfl owStatus.s etId(8); | |
| 460 | workfl owStatus.s etDescript ion("Reque stNotAccep ted"); | |
| 461 | break; | |
| 462 | case "ResultsA ccepted": | |
| 463 | workfl owStatus.s etId(9); | |
| 464 | workfl owStatus.s etDescript ion("Resul tsAccepted "); | |
| 465 | break; | |
| 466 | case "ResultsN otAccepted ": | |
| 467 | workfl owStatus.s etId(10); | |
| 468 | workfl owStatus.s etDescript ion("Resul tsNotAccep ted"); | |
| 469 | break; | |
| 470 | case "ResultsD elivered": | |
| 471 | workfl owStatus.s etId(11); | |
| 472 | workfl owStatus.s etDescript ion("Resul tsDelivere d"); | |
| 473 | break; | |
| 474 | defa ult: | |
| 475 | throw new Illega lArgumentE xception(" Invalid St atus: " + status); | |
| 476 | } | |
| 477 | ||
| 478 | retu rn workflo wStatus; | |
| 479 | } | |
| 480 | ||
| 481 | /* * | |
| 482 | * CommentHi story | |
| 483 | * | |
| 484 | * @return C ommentHist ory | |
| 485 | * / | |
| 486 | pu blic stati c CommentH istory get CommentHis tory() { | |
| 487 | Comm entHistory commentHi story = ne w CommentH istory(); | |
| 488 | comm entHistory .setReques t(getExist ingRequest ()); | |
| 489 | comm entHistory .setWorkfl owStatus(g etWorkFlow Status("Re turned")); | |
| 490 | comm entHistory .setCommen ts("Return ed request "); | |
| 491 | comm entHistory .setCreate dOn(new Da te()); | |
| 492 | comm entHistory .setCreate dBy("datam anger1"); | |
| 493 | comm entHistory .setReques tId(1); | |
| 494 | comm entHistory .setStatus ("status") ; | |
| 495 | comm entHistory .setType(" type"); | |
| 496 | comm entHistory .setTaskId ("taskId") ; | |
| 497 | comm entHistory .setCommen tType(getC ommentType ()); | |
| 498 | ||
| 499 | retu rn comment History; | |
| 500 | } | |
| 501 | ||
| 502 | pu blic stati c CommentT ype getCom mentType() { | |
| 503 | ||
| 504 | Comm entType co mmentType = new Comm entType(); | |
| 505 | comm entType.se tId(1); | |
| 506 | comm entType.se tDescripti on("Operat ions"); | |
| 507 | ||
| 508 | retu rn comment Type; | |
| 509 | ||
| 510 | } | |
| 511 | ||
| 512 | /* * | |
| 513 | * Create te st object for UserTy pe | |
| 514 | * | |
| 515 | * @return U serType | |
| 516 | * / | |
| 517 | pu blic stati c UserType getNewUse rType() { | |
| 518 | User Type userT ype = new UserType() ; | |
| 519 | user Type.setUs erTypeId(1 ); | |
| 520 | user Type.setUs erTypeDesc ("Employee "); | |
| 521 | user Type.setUs erRoleType s(null); | |
| 522 | ||
| 523 | retu rn userTyp e; | |
| 524 | } | |
| 525 | ||
| 526 | /* * | |
| 527 | * Create te st object for RoleTy pe | |
| 528 | * | |
| 529 | * @return R oleType | |
| 530 | * / | |
| 531 | pu blic stati c RoleType getNewRol eType() { | |
| 532 | Role Type roleT ype = new RoleType() ; | |
| 533 | role Type.setRo leTypeId(1 ); | |
| 534 | role Type.setRo leName("Ad ministrato r"); | |
| 535 | role Type.setRo leDescript ion("Admin istrator") ; | |
| 536 | role Type.setUs erRoleType s(null); | |
| 537 | ||
| 538 | retu rn roleTyp e; | |
| 539 | } | |
| 540 | ||
| 541 | /* * | |
| 542 | * Create te st object for RoleTy peDTO | |
| 543 | * | |
| 544 | * @return R oleTypeDTO | |
| 545 | * / | |
| 546 | pu blic stati c RoleType DTO getRol eTypeDTO() { | |
| 547 | ||
| 548 | Role TypeDTO ro leTypeDto = new Role TypeDTO(); | |
| 549 | role TypeDto.se tRoleTypeI d(1); | |
| 550 | role TypeDto.se tRoleName( "Administr ator"); | |
| 551 | role TypeDto.se tRoleDescr iption("Ad ministrato r"); | |
| 552 | retu rn roleTyp eDto; | |
| 553 | } | |
| 554 | ||
| 555 | /* * | |
| 556 | * Create te st object for UserRo leType | |
| 557 | * | |
| 558 | * @return U serRoleTyp e | |
| 559 | * / | |
| 560 | pu blic stati c UserRole Type getNe wUserRoleT ype() { | |
| 561 | User RoleType u serRoleTyp e = new Us erRoleType (); | |
| 562 | user RoleType.s etId(1); | |
| 563 | user RoleType.s etRoleType (getNewRol eType()); | |
| 564 | user RoleType.s etUser(get User()); | |
| 565 | user RoleType.s etUserType (getNewUse rType()); | |
| 566 | Cale ndar start Date = Cal endar.getI nstance(); | |
| 567 | star tDate.set( 2017, 5, 2 4); | |
| 568 | user RoleType.s etStartDat e(startDat e.getTime( )); | |
| 569 | user RoleType.s etEndDate( startDate. getTime()) ; | |
| 570 | ||
| 571 | retu rn userRol eType; | |
| 572 | } | |
| 573 | ||
| 574 | /* * | |
| 575 | * Create te st object for LdapUs er | |
| 576 | * | |
| 577 | * @return L dapUser | |
| 578 | * / | |
| 579 | pu blic stati c LdapUser getLdapUs er() { | |
| 580 | ||
| 581 | Ldap User ldapU ser = new LdapUser() ; | |
| 582 | ldap User.setFi rstName("F irstName") ; | |
| 583 | ldap User.setLa stName("La stName"); | |
| 584 | ldap User.setUs ername("Us ername"); | |
| 585 | ldap User.setEm ailId("Ema ilId"); | |
| 586 | ldap User.setCr eateDate(D ateUtil.ge tTodaysDat e()); | |
| 587 | ldap User.setUs erActive(( byte) User StatusEnum .ACTIVE.ge tId()); | |
| 588 | ldap User.setAc tiveDate(D ateUtil.ge tTodaysDat e()); | |
| 589 | ldap User.setIn activeDate (DateUtil. getTodaysD ate()); | |
| 590 | ||
| 591 | retu rn ldapUse r; | |
| 592 | } | |
| 593 | ||
| 594 | /* * | |
| 595 | * Create te st object for UserAp prover | |
| 596 | * | |
| 597 | * @return U serApprove r | |
| 598 | * / | |
| 599 | pu blic stati c UserAppr over getNe wUserAppro ver() { | |
| 600 | User Approver u serApprove r = new Us erApprover (); | |
| 601 | user Approver.s etId(1); | |
| 602 | user Approver.s etUsersByU serApprove rId(getNew User()); | |
| 603 | user Approver.s etUsersByU serId(getN ewUser()); | |
| 604 | ||
| 605 | retu rn userApp rover; | |
| 606 | } | |
| 607 | ||
| 608 | pu blic stati c UserAppr over getNe wUserAppro ver1() { | |
| 609 | User Approver u serApprove r = new Us erApprover (); | |
| 610 | user Approver.s etId(2); | |
| 611 | user Approver.s etUsersByU serApprove rId(null); | |
| 612 | user Approver.s etUsersByU serId(null ); | |
| 613 | ||
| 614 | retu rn userApp rover; | |
| 615 | } | |
| 616 | ||
| 617 | /* * | |
| 618 | * Create Co pyTableSou rce | |
| 619 | * | |
| 620 | * @return C opyTableSo urce | |
| 621 | * / | |
| 622 | /* public sta tic CopyTa bleSource getCopyTab leSource() { | |
| 623 | Copy TableSourc e copyTabl eSource = new CopyTa bleSource( "tableName Test", "tc SourceData BaseServer NameTest", "tcSource DataBaseNa meTest", " sourceSche maNameTest ", "tcDest inationDat aBaseServe rNameTest" , "tcDesti nationData BaseUserNa meTest", " tcDestinat ionDataBas eUserPassw ordTest", "tcDestina tionServer DataBaseNa meTest", " destinatio nSchemaNam eTest", "t cManagemen tDataBaseS erverNameT est", "tcM anagementD ataBaseUse rNameTest" , "tcManag ementDataB aseUserPas swordTest" , "tcManag ementDataB aseSchemaT est", "cmd FilePathTe st", "tcMa nagementDa taBaseName Test", "tc TemporaryD ataBaseNam eTest"); | |
| 624 | ||
| 625 | retu rn copyTab leSource; | |
| 626 | }* / | |
| 627 | ||
| 628 | /* * | |
| 629 | * Create Us erRoleType | |
| 630 | * | |
| 631 | * @return u serRoleTyp e | |
| 632 | * / | |
| 633 | pu blic stati c UserRole Type getUs erRoleType () { | |
| 634 | ||
| 635 | User RoleType u serRoleTyp e = new Us erRoleType (); | |
| 636 | user RoleType.s etId(1); | |
| 637 | user RoleType.s etRoleType Id(1); | |
| 638 | user RoleType.s etUserId(1 ); | |
| 639 | user RoleType.s etUserId(1 ); | |
| 640 | user RoleType.s etStartDat e(new Date ()); | |
| 641 | retu rn userRol eType; | |
| 642 | } | |
| 643 | ||
| 644 | /* * | |
| 645 | * Create Us erRefreshH istory | |
| 646 | * | |
| 647 | * @return u serRefresh History | |
| 648 | * / | |
| 649 | pu blic stati c RefreshH istory get UserRefres hHistory() { | |
| 650 | ||
| 651 | Refr eshHistory userRefre shHistory = new Refr eshHistory (); | |
| 652 | user RefreshHis tory.setSt artDate(ge tDate()); | |
| 653 | user RefreshHis tory.setEn dDate(getD ate()); | |
| 654 | user RefreshHis tory.setSc heduledBy( "NightlyJo b"); | |
| 655 | user RefreshHis tory.setSt atus("Star ted"); | |
| 656 | ||
| 657 | retu rn userRef reshHistor y; | |
| 658 | } | |
| 659 | ||
| 660 | pu blic stati c Workflow Status get WorkflowSt atus() { | |
| 661 | ||
| 662 | Work flowStatus workflowS tatus = ne w Workflow Status(); | |
| 663 | work flowStatus .setDescri ption("Dra ft"); | |
| 664 | work flowStatus .setId(1); | |
| 665 | work flowStatus .setCount( 1L); | |
| 666 | ||
| 667 | retu rn workflo wStatus; | |
| 668 | } | |
| 669 | ||
| 670 | /* * | |
| 671 | * Create Co mmentHisto ryDTO | |
| 672 | * | |
| 673 | * @return c ommentHist oryDTO | |
| 674 | * / | |
| 675 | pu blic stati c CommentH istoryDTO getComment HistoryDTO () { | |
| 676 | ||
| 677 | Comm entHistory DTO commen tHistoryDT O = new Co mmentHisto ryDTO(); | |
| 678 | comm entHistory DTO.setCom mentId(1); | |
| 679 | comm entHistory DTO.setCom ments("Con troler tes t"); | |
| 680 | comm entHistory DTO.setCom mentType(1 ); | |
| 681 | commentHis toryDTO.se tCreatedBy (" DN S USER4"); | |
| 682 | comm entHistory DTO.setCre atedOn(new Date()); | |
| 683 | retu rn comment HistoryDTO ; | |
| 684 | } | |
| 685 | ||
| 686 | pu blic stati c UserCoun t getUserC ount() { | |
| 687 | ||
| 688 | User Count user Count = ne w UserCoun t(1, 2); | |
| 689 | ||
| 690 | retu rn userCou nt; | |
| 691 | } | |
| 692 | ||
| 693 | pr ivate stat ic Date ge tDate() { | |
| 694 | ||
| 695 | Cale ndar calen dar = Cale ndar.getIn stance(); | |
| 696 | // a dd one day to the da te/calenda r | |
| 697 | cale ndar.add(C alendar.DA Y_OF_YEAR, 1); | |
| 698 | // n ow get "to morrow" | |
| 699 | Date tomorrow = calendar .getTime() ; | |
| 700 | retu rn tomorro w; | |
| 701 | } | |
| 702 | } |
Araxis Merge (but not the data content of this report) is Copyright © 1993-2016 Araxis Ltd (www.araxis.com). All rights reserved.