Produced by Araxis Merge on 10/4/2017 8:04:34 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 | rdk.zip\rdk\product\production\rdk\src\resources\activitymanagement\tasks | task-operations-itest-spec.js | Mon Aug 21 12:51:00 2017 UTC |
| 2 | rdk.zip\rdk\product\production\rdk\src\resources\activitymanagement\tasks | task-operations-itest-spec.js | Tue Oct 3 18:10:39 2017 UTC |
| Description | Between Files 1 and 2 |
|
|---|---|---|
| Text Blocks | Lines | |
| Unchanged | 12 | 378 |
| Changed | 11 | 26 |
| 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 | var tasksR esource = require('. /task-oper ations-res ource'); | |
| 4 | var _ = re quire('lod ash'); | |
| 5 | ||
| 6 | var fakeRe quest = { | |
| 7 | app: { | |
| 8 | co nfig: { | |
| 9 | oracledb : { | |
| 10 | acti vityDataba se: { | |
| 11 | 'user': ' REDACTED ', | |
| 12 | 'password' : ' REDACTED ', | |
| 13 | 'connectSt ring': ' IP /xe' | |
| 14 | } | |
| 15 | }, | |
| 16 | jdsServe r: { | |
| 17 | 'baseUrl': 'http:// IP ', | |
| 18 | 'url LengthLimi t': 120 | |
| 19 | } | |
| 20 | } | |
| 21 | }, | |
| 22 | sessio n: { | |
| 23 | user: { // REDACT | |
| 24 | duz: { | |
| 25 | ' R E D A CTED ': '100000 00270' | |
| 26 | }, | |
| 27 | site: ' R E D A CTED ' | |
| 28 | } | |
| 29 | }, | |
| 30 | logger : { | |
| 31 | de bug: funct ion(msg, v al) { | |
| 32 | console. log('DEBUG :'); | |
| 33 | console. log(msg, v al); | |
| 34 | }, | |
| 35 | er ror: funct ion(msg, v al) { | |
| 36 | console. log('ERROR :'); | |
| 37 | console. log(msg, v al); | |
| 38 | }, | |
| 39 | in fo: functi on(msg, va l) { | |
| 40 | console. log('INFO: '); | |
| 41 | console. log(msg, v al); | |
| 42 | }, | |
| 43 | tr ace: funct ion(msg, v al) { | |
| 44 | console. log('TRACE :'); | |
| 45 | console. log(msg, v al); | |
| 46 | }, | |
| 47 | wa rn: functi on(msg, va l) { | |
| 48 | console. log('WARN: '); | |
| 49 | console. log(msg, v al); | |
| 50 | }, | |
| 51 | fa tal: funct ion(msg, v al) { | |
| 52 | console. log('FATAL :'); | |
| 53 | console. log(msg, v al); | |
| 54 | } | |
| 55 | }, | |
| 56 | body: {} | |
| 57 | }; | |
| 58 | ||
| 59 | describe(' tasks reso urce integ ration tes t', functi on() { | |
| 60 | before (function( ) { | |
| 61 | // set up ove rall datab ase | |
| 62 | co nsole.log( 'setting u p database '); | |
| 63 | }); | |
| 64 | ||
| 65 | it('ca lls jpid', function( done) { | |
| 66 | va r cb = fun ction(err, res, resu lt) { | |
| 67 | expect(e rr).to.be( null); | |
| 68 | expect(r esult.hasO wnProperty ('patientI dentifiers ')).to.be( true); | |
| 69 | expect(r esult.pati entIdentif iers.lengt h).to.be.g t(1); | |
| 70 | done(err ); | |
| 71 | }; | |
| 72 | ||
| 73 | var pid = ' R E D A CTED ;3'; | |
| 74 | ||
| 75 | ta sksResourc e.callJpid (fakeReque st, pid, c b); | |
| 76 | }); | |
| 77 | ||
| 78 | //TODO move to u nit test? | |
| 79 | it('sk ips jpid w hen null', function( done) { | |
| 80 | va r cb = fun ction(err, res, resu lt) { | |
| 81 | expect(e rr).not.to .be(null); | |
| 82 | done(); | |
| 83 | }; | |
| 84 | ||
| 85 | ta sksResourc e.callJpid (fakeReque st, null, cb); | |
| 86 | }); | |
| 87 | ||
| 88 | it('ch ecks for i cn', funct ion(done) { | |
| 89 | va r spy = si non.spy(ta sksResourc e, 'callJp id'); | |
| 90 | ||
| 91 | var testPi d = ' R E D A CTED ;3'; | |
| 92 | ||
| 93 | va r cb2 = fu nction(err , result) { | |
| 94 | expect(e rr).to.be( null); | |
| 95 | expect(s py.called) .to.be(tru e); | |
| 96 | done(err ); | |
| 97 | }; | |
| 98 | ||
| 99 | ta sksResourc e.getIcn(f akeRequest , testPid, [], cb2); | |
| 100 | }); | |
| 101 | ||
| 102 | //TODO move to u nit test? | |
| 103 | it('us es cached patient id entifiers when passe d', functi on(done) { | |
| 104 | va r spy = si non.spy(ta sksResourc e, 'callJp id'); | |
| 105 | va r testIden tifiers = [ | |
| 106 | ' R E D A CTED ;3', | |
| 107 | 'C877;3' , | |
| 108 | 'DOD;000 0000003', | |
| 109 | 'HDR;101 08V420871' , | |
| 110 | 'JPID;07 201c12-a76 0-41e7-b07 b-99cbc2cb 4132', | |
| 111 | 'VLER;10 108V420871 ' | |
| 112 | ]; | |
| 113 | va r testIcn = '10108V4 20871'; | |
| 114 | te stIdentifi ers.push(t estIcn); | |
| 115 | ||
| 116 | var testPi d = ' R E D A CTED ;3'; | |
| 117 | ||
| 118 | va r cb3 = fu nction(err , result) { | |
| 119 | expect(e rr).to.be( null); | |
| 120 | expect(s py.called) .to.be(fal se); | |
| 121 | expect(r esult).to. be.equal(t estIcn); | |
| 122 | done(err ); | |
| 123 | }; | |
| 124 | ||
| 125 | ta sksResourc e.getIcn(f akeRequest , testPid, testIdent ifiers, cb 3); | |
| 126 | }); | |
| 127 | ||
| 128 | // it( 'runs', fu nction() { | |
| 129 | // var teamS tub = sino n.stub(tas ksResource , 'getTeam s', functi on(req, st affIEN, pa tientID, n ext) { | |
| 130 | // conso le.log('te am stub ca lled'); | |
| 131 | // retur n next(nul l, true); | |
| 132 | // }); | |
| 133 | ||
| 134 | // var icnSt ub = sinon .stub(task sResource, 'getIcn', function( req, pid, next) { | |
| 135 | // conso le.log('ic n stub cal led'); | |
| 136 | // retur n next(nul l, '1'); | |
| 137 | // }); | |
| 138 | ||
| 139 | // var names Stub = sin on.stub(ta sksResourc e, 'getNam esFromIcns ', functio n(icnToNam eMap, req, cb) { | |
| 140 | // conso le.log('na mes stub c alled'); | |
| 141 | // retur n cb([]); | |
| 142 | // }); | |
| 143 | ||
| 144 | ||
| 145 | ||
| 146 | // tasksReso urce.build TasksRespo nse([], [] , fakeRequ est, { | |
| 147 | // subCo ntext: 'te amroles', | |
| 148 | // facility: ' R E D A CTED ', | |
| 149 | // statu s: 'Create d,Ready,Re served,InP rogress', | |
| 150 | // start Date: '201 406230000' , | |
| 151 | // endDa te: '20161 2232359' | |
| 152 | // }, functi on(result) { | |
| 153 | // conso le.log(res ult); | |
| 154 | // }); | |
| 155 | // }); | |
| 156 | ||
| 157 | it('ru ns on buil dTaskQuery ', functio n(done) { | |
| 158 | va r fakeResp onse = { | |
| 159 | rdkSend: function( response) { | |
| 160 | cons ole.log('r dk send st ub called' ); | |
| 161 | done (); | |
| 162 | }, | |
| 163 | status: function(s tatus) { | |
| 164 | this .localStat us = statu s; | |
| 165 | }, | |
| 166 | localSta tus: '' | |
| 167 | }; | |
| 168 | ||
| 169 | // var route sStub = si non.stub(t asksResour ce, 'query TasksRoute s', functi on(req, re s, tasks, parameters ) { | |
| 170 | // conso le.log('ta sk routes stub calle d'); | |
| 171 | // conso le.log(uti l.inspect( tasks, { | |
| 172 | // s howHidden: true, | |
| 173 | // d epth: null , | |
| 174 | // c olors: tru e | |
| 175 | // })); | |
| 176 | // retur n done(); | |
| 177 | // }); | |
| 178 | ||
| 179 | va r paramete rs = { | |
| 180 | subConte xt: 'teamr oles', | |
| 181 | facility: ' R E D A CTED ', | |
| 182 | status: 'Created,R eady,Reser ved,InProg ress' | |
| 183 | }; | |
| 184 | ||
| 185 | va r localReq uest = _.c loneDeep(f akeRequest ); | |
| 186 | lo calRequest .body.cont ext = 'use r'; | |
| 187 | ||
| 188 | ta sksResourc e.buildTas kQuery(loc alRequest, fakeRespo nse, param eters); | |
| 189 | ||
| 190 | // console.l og(util.in spect(fake Response.r dkSend.arg s, { | |
| 191 | // showH idden: tru e, | |
| 192 | // depth : null, | |
| 193 | // color s: true | |
| 194 | // })); | |
| 195 | // expect(fak eResponse. rdkSend.ca lled).to.b e.truthy() ; | |
| 196 | }); | |
| 197 | ||
| 198 | after( function() { | |
| 199 | // tear down database | |
| 200 | co nsole.log( 'cleaning up databas e'); | |
| 201 | }); | |
| 202 | }); |
Araxis Merge (but not the data content of this report) is Copyright © 1993-2016 Araxis Ltd (www.araxis.com). All rights reserved.