Produced by Araxis Merge on 10/3/2017 11:16:02 AM Central Daylight 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 | ehmp.zip\ehmp\ehmp\product\production\vx-sync\tests\integrationtests\utils\patient-record-retirement | patient-record-retirement-util-itest-spec.js | Mon Aug 28 20:41:42 2017 UTC |
| 2 | ehmp.zip\ehmp\ehmp\product\production\vx-sync\tests\integrationtests\utils\patient-record-retirement | patient-record-retirement-util-itest-spec.js | Tue Oct 3 13:13:53 2017 UTC |
| Description | Between Files 1 and 2 |
|
|---|---|---|
| Text Blocks | Lines | |
| Unchanged | 2 | 358 |
| 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 | 'use stric t'; | |
| 2 | ||
| 3 | require('. ./../../.. /env-setup '); | |
| 4 | ||
| 5 | var Record Retirement Util = req uire(globa l.VX_UTILS + 'patien t-record-r etirement/ patient-re cord-retir ement-util '); | |
| 6 | var log = require(gl obal.VX_DU MMIES + '/ dummy-logg er'); | |
| 7 | ||
| 8 | // NOTE: b e sure nex t lines ar e commente d out befo re pushing | |
| 9 | // var log Util = req uire(globa l.VX_UTILS + 'log'); | |
| 10 | // log = l ogUtil._cr eateLogger ({ | |
| 11 | // na me: 'test' , | |
| 12 | // le vel: 'debu g', | |
| 13 | // ch ild: logUt il._create Logger | |
| 14 | // }); | |
| 15 | ||
| 16 | var _ = re quire('und erscore'); | |
| 17 | ||
| 18 | var testCo nfig = req uire(globa l.VX_INTTE STS + 'tes t-config') ; | |
| 19 | var host = testConfi g.vxsyncIP ; | |
| 20 | var port = PORT ; | |
| 21 | ||
| 22 | var JdsCli ent = requ ire(global .VX_SUBSYS TEMS + 'jd s/jds-clie nt'); | |
| 23 | var Beanst alkClient = require( global.VX_ JOBFRAMEWO RK).Beanst alkClient; | |
| 24 | var solrSm artClient = require( 'solr-smar t-client') ; | |
| 25 | var VistaC lient = re quire(glob al.VX_SUBS YSTEMS + ' vista/vist a-client') ; | |
| 26 | var HdrCli ent = requ ire(global .VX_SUBSYS TEMS + 'hd r/hdr-clie nt'); | |
| 27 | var VxSync ForeverAge nt = requi re('http') .Agent; | |
| 28 | ||
| 29 | var val = require(gl obal.VX_UT ILS + 'obj ect-utils' ).getPrope rty; | |
| 30 | ||
| 31 | var syncAn dWaitForPa tient = re quire(glob al.VX_INTT ESTS + 'fr amework/ha ndler-test -framework ').syncAnd WaitForPat ient; | |
| 32 | var getBea nstalkConf ig = requi re(global. VX_INTTEST S + 'frame work/handl er-test-fr amework'). getBeansta lkConfig; | |
| 33 | var update Tubenames = require( global.VX_ INTTESTS + 'framewor k/handler- test-frame work').upd ateTubenam es; | |
| 34 | var getTub enames = r equire(glo bal.VX_INT TESTS + 'f ramework/h andler-tes t-framewor k').getTub enames; | |
| 35 | var clearT ubes = req uire(globa l.VX_INTTE STS + 'fra mework/han dler-test- framework' ).clearTub es; | |
| 36 | var grabJo bs = requi re(global. VX_INTTEST S + 'frame work/job-g rabber'); | |
| 37 | ||
| 38 | var Publis herRouter = require( global.VX_ JOBFRAMEWO RK).Publis herRouter; | |
| 39 | ||
| 40 | //Make dee p copy of config so that we ca n modify i t without affecting other test s | |
| 41 | var config = JSON.pa rse(JSON.s tringify(r equire(glo bal.VX_ROO T + 'worke r-config') )); | |
| 42 | ||
| 43 | config.rec ordRetirem ent = { | |
| 44 | 'r ules': { | |
| 45 | 'lar gePatientR ecord': { | |
| 46 | 'patie ntTotalSiz eLimit': 1 00000000, | |
| 47 | 'avgSi zePerEvent ': 100 | |
| 48 | } | |
| 49 | }, | |
| 50 | 'l astAccesse d': -1 | |
| 51 | }; | |
| 52 | ||
| 53 | config.syn cRequestAp i.host = h ost; | |
| 54 | ||
| 55 | var tubePr efix = 're tirement-u til-test'; | |
| 56 | var jobTyp e = 'patie nt-record- retirement '; | |
| 57 | var tubena mes; | |
| 58 | var publis herRouter; | |
| 59 | /* | |
| 60 | ** * Note *** | |
| 61 | Th is test re quires a p atient to be synced before it can test t he utility . | |
| 62 | Th e patient used here is 9E7A;21 . | |
| 63 | Th is patient will rema in synced after the test runs. | |
| 64 | */ | |
| 65 | ||
| 66 | describe(' patient-re cord-retir ement-util ', functio n() { | |
| 67 | it ('runUtili ty', funct ion() { | |
| 68 | var referenceI nfo = { | |
| 69 | sessio nId: 'TEST ', | |
| 70 | utilit yType: 'Pa tient Reco rd Retirem ent Util I ntegration Test' | |
| 71 | }; | |
| 72 | ||
| 73 | var pid = '9E7 A;21'; | |
| 74 | ||
| 75 | var environmen t = { | |
| 76 | vistaC lient: new VistaClie nt(log, lo g, config, null), | |
| 77 | jds: n ew JdsClie nt(log, lo g, config) , | |
| 78 | solr: solrSmartC lient.init Client(con fig.solrCl ient.core, config.so lrClient.z ooKeeperCo nnection, log, new V xSyncForev erAgent({k eepAlive: true, maxS ockets: co nfig.handl erMaxSocke ts || 5})) , | |
| 79 | hdrCli ent: new H drClient(l og, log, c onfig), | |
| 80 | beanst alk: new B eanstalkCl ient(log, host, conf ig.beansta lk.repoDef aults.port ), | |
| 81 | jobSta tusUpdater : { | |
| 82 | createJo bStatus: f unction(jo b, callbac k) { | |
| 83 | callback() ; | |
| 84 | }, | |
| 85 | errorJob Status: fu nction(job , error, c allback) { | |
| 86 | callback() ; | |
| 87 | } | |
| 88 | }, | |
| 89 | ||
| 90 | }; | |
| 91 | ||
| 92 | sync AndWaitFor Patient(lo g, config, pid); | |
| 93 | ||
| 94 | var recordReti rementUtil ; | |
| 95 | ||
| 96 | var beanstalkC onfig = ge tBeanstalk Config(con fig, host, port, tub ePrefix + '-' + jobT ype); | |
| 97 | upda teTubename s(beanstal kConfig); | |
| 98 | ||
| 99 | tube names = ge tTubenames (beanstalk Config, [j obType]); | |
| 100 | ||
| 101 | conf ig.beansta lk = beans talkConfig ; | |
| 102 | ||
| 103 | envi ronment.pu blisherRou ter = new PublisherR outer(log, config, l og, enviro nment.jobS tatusUpdat er); | |
| 104 | publ isherRoute r = enviro nment.publ isherRoute r; | |
| 105 | // N ow we can test the h andler | |
| 106 | //-- ---------- ---------- ------- | |
| 107 | var handlerDon e = false; | |
| 108 | runs (function( ) { | |
| 109 | log.de bug('patie nt-record- retirement -util-ites t-spec: no w testing handler'); | |
| 110 | record Retirement Util = new RecordRet irementUti l(log, con fig, envir onment); | |
| 111 | ||
| 112 | record Retirement Util.runUt ility(refe renceInfo, function( error, res ult) { | |
| 113 | expect(e rror).toBe Falsy(); | |
| 114 | expect(r esult).toB eTruthy(); | |
| 115 | expect(r esult).toE qual('succ ess'); | |
| 116 | ||
| 117 | if (erro r) { | |
| 118 | handlerDon e = true; | |
| 119 | return; | |
| 120 | } | |
| 121 | ||
| 122 | grabJobs (log, host , port, tu benames, 2 , function (error, jo bs) { | |
| 123 | expect(err or).toBeFa lsy(); | |
| 124 | expect(res ult).toBeT ruthy(); | |
| 125 | // calledR esult = re sult; | |
| 126 | ||
| 127 | var result JobTypes = _.chain(j obs).map(f unction(re sult) { | |
| 128 | re turn resul t.jobs; | |
| 129 | }).flatten ().pluck(' type').val ue(); | |
| 130 | ||
| 131 | expect(val (resultJob Types, 'le ngth')).to BeGreaterT han(0); | |
| 132 | expect(res ultJobType s).toConta in(jobType ); | |
| 133 | ||
| 134 | //Check ev ery job fo r referenc eInfo | |
| 135 | _.each(val (jobs, ['0 ','jobs']) , function (job){ | |
| 136 | expect (job.refer enceInfo). toEqual(ja smine.obje ctContaini ng({ | |
| 137 | sessionI d: referen ceInfo.ses sionId, | |
| 138 | utilityT ype: refer enceInfo.u tilityType , | |
| 139 | requestI d: jasmine .any(Strin g) | |
| 140 | })); | |
| 141 | }); | |
| 142 | ||
| 143 | handlerDon e = true; | |
| 144 | }); | |
| 145 | }); | |
| 146 | }); | |
| 147 | ||
| 148 | wait sFor(funct ion() { | |
| 149 | return handlerDo ne; | |
| 150 | }, ' waiting fo r handler' , 10000); | |
| 151 | ||
| 152 | }) ; | |
| 153 | ||
| 154 | af terEach(fu nction() { | |
| 155 | log. debug('pat ient-recor d-retireme nt-util-it est-spec: Cleaning u p...'); | |
| 156 | if ( publisherR outer) { | |
| 157 | publis herRouter. close(); | |
| 158 | } | |
| 159 | ||
| 160 | var cleared = false; | |
| 161 | ||
| 162 | grab Jobs(log, host, port , tubename s, 0, func tion() { | |
| 163 | cleare d = true; | |
| 164 | log.de bug('patie nt-record- retirement -util-ites t-spec: ** ** grabJob s callback was calle d.'); | |
| 165 | }); | |
| 166 | ||
| 167 | clea rTubes(log , host, po rt, tubena mes, funct ion() { | |
| 168 | cleare d = true; | |
| 169 | log.de bug('patie nt-record- retirement -util-ites t-spec: ** ** clearTu be callbac k was call ed.'); | |
| 170 | }); | |
| 171 | ||
| 172 | wait sFor(funct ion() { | |
| 173 | return cleared; | |
| 174 | }, ' clear jobs timed out ', 10000); | |
| 175 | ||
| 176 | runs (function( ) { | |
| 177 | log.de bug('patie nt-record- retirement -util-ites t-spec: ** ** test co mplete.'); | |
| 178 | }); | |
| 179 | }) ; | |
| 180 | }); |
Araxis Merge (but not the data content of this report) is Copyright © 1993-2016 Araxis Ltd (www.araxis.com). All rights reserved.