Produced by Araxis Merge on 10/3/2017 11:16:03 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\unittests\handlers\error-request | jds-error-writer-spec.js | Mon Jul 10 17:46:22 2017 UTC |
| 2 | ehmp.zip\ehmp\ehmp\product\production\vx-sync\tests\unittests\handlers\error-request | jds-error-writer-spec.js | Tue Oct 3 13:16:39 2017 UTC |
| Description | Between Files 1 and 2 |
|
|---|---|---|
| Text Blocks | Lines | |
| Unchanged | 2 | 314 |
| Changed | 1 | 4 |
| 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 jdsErr orWriter = require(g lobal.VX_H ANDLERS + 'error-req uest/jds-e rror-write r'); | |
| 6 | var log = require(gl obal.VX_DU MMIES + 'd ummy-logge r'); | |
| 7 | var JdsCli entDummy = require(g lobal.VX_D UMMIES + ' jds-client -dummy'); | |
| 8 | ||
| 9 | ||
| 10 | //-------- ---------- ---------- ---------- ---------- ---------- ---- | |
| 11 | // Uncomme nt the fol lowing to see the lo gging out on the scr een. | |
| 12 | //-------- ---------- ---------- ---------- ---------- ---------- ---- | |
| 13 | // var log Util = req uire(globa l.VX_UTILS + 'log'); | |
| 14 | // logUtil .initializ e([{ | |
| 15 | // nam e: 'root', | |
| 16 | // str eam: proce ss.stdout, | |
| 17 | // lev el: 'debug ' | |
| 18 | // }]); | |
| 19 | // log = l ogUtil.get ('test', ' debug'); | |
| 20 | //-------- ---------- ---------- ---------- ---- | |
| 21 | // End of logging st uff to com ment out.. .. | |
| 22 | //-------- ---------- ---------- ---------- ---- | |
| 23 | // log = r equire('bu nyan').cre ateLogger( { | |
| 24 | // na me: 'jds-e rror-write r-spec', | |
| 25 | // le vel: 'debu g' | |
| 26 | // }); | |
| 27 | ||
| 28 | var hmpSer ver = 'The HmpServer' ; | |
| 29 | ||
| 30 | var config = { | |
| 31 | enviro nmentName: 'vxsync_e nvironment ', | |
| 32 | jds: { | |
| 33 | pr otocol: 'h ttp', | |
| 34 | host: ' IP ', | |
| 35 | port: PORT | |
| 36 | }, | |
| 37 | 'hmp.s erver.id': hmpServer , | |
| 38 | 'hmp.v ersion': ' 0.7-S65', | |
| 39 | 'hmp.b atch.size' : '1000', | |
| 40 | 'hmp.e xtract.sch ema': '3.0 01', | |
| 41 | 'hdr': { | |
| 42 | 'o perationMo de': 'REQ/ RES' | |
| 43 | } | |
| 44 | }; | |
| 45 | ||
| 46 | //-------- ---------- ---------- ---------- ---------- ---------- ---------- - | |
| 47 | // Create an instanc e of the e nvironment variable. | |
| 48 | // | |
| 49 | // theConf ig: The co nfig file to use for this envi ronment. | |
| 50 | // returns : The envi ronment va riable. | |
| 51 | //-------- ---------- ---------- ---------- ---------- ---------- ---------- - | |
| 52 | function c reateEnvir onment(the Config) { | |
| 53 | var en vironment = { | |
| 54 | jd s: new Jds ClientDumm y(log, the Config), | |
| 55 | me trics: log | |
| 56 | }; | |
| 57 | ||
| 58 | spyOn( environmen t.jds, 'ad dErrorReco rd').andCa llThrough( ); | |
| 59 | ||
| 60 | return environme nt; | |
| 61 | } | |
| 62 | ||
| 63 | //-------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- - | |
| 64 | // Create an error r ecord cont aining a j ob with th e given da ta. | |
| 65 | // | |
| 66 | // jobJpid : The JPID for the j ob. | |
| 67 | // jobType : The type of job. | |
| 68 | // patient Identifier Type: The type of pa tient iden tifier. | |
| 69 | // patient Identifier Value: The patient i dentifier. | |
| 70 | // returns : The erro r containi ng a job. | |
| 71 | //-------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- | |
| 72 | function c reateError Job(jobJpi d, jobType , patientI dentifierT ype, patie ntIdentifi erValue) { | |
| 73 | var er rorRecord = { | |
| 74 | jo b: { | |
| 75 | jpid: jo bJpid, | |
| 76 | type: jo bType, | |
| 77 | patientI dentifier: { | |
| 78 | type : patientI dentifierT ype, | |
| 79 | valu e: patient Identifier Value | |
| 80 | } | |
| 81 | } | |
| 82 | }; | |
| 83 | ||
| 84 | return errorReco rd; | |
| 85 | } | |
| 86 | ||
| 87 | //-------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- - | |
| 88 | // Create a poller e rror recor d containi ng a job w ith the gi ven data. | |
| 89 | // | |
| 90 | // patient Identifier Type: The type of pa tient iden tifier. | |
| 91 | // patient Identifier Value: The patient i dentifier. | |
| 92 | // returns : The erro r containi ng a job. | |
| 93 | //-------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- | |
| 94 | function c reatePolle rError(pat ientIdenti fierType, patientIde ntifierVal ue) { | |
| 95 | var er rorRecord = { | |
| 96 | pa tientIdent ifier: { | |
| 97 | type: pa tientIdent ifierType, | |
| 98 | value: p atientIden tifierValu e | |
| 99 | } | |
| 100 | }; | |
| 101 | ||
| 102 | return errorReco rd; | |
| 103 | } | |
| 104 | ||
| 105 | describe(' jds-error- writer-spe c.js', fun ction() { | |
| 106 | it('Te st writing error "JO B" to JDS' , function () { | |
| 107 | va r environm ent = crea teEnvironm ent(config ); | |
| 108 | ||
| 109 | va r writeErr orRecord = jdsErrorW riter.crea teErrorRec ordWriter( config, en vironment, log); | |
| 110 | ||
| 111 | va r errorRec ord = crea teErrorJob ('1234-123 4-1234-123 4', 'enter prise-sync -request', 'pid', '9 E7A;3'); | |
| 112 | ||
| 113 | va r finished = true; | |
| 114 | ru ns (functi on() { | |
| 115 | writeErr orRecord(e rrorRecord , function () { | |
| 116 | expe ct(environ ment.jds.a ddErrorRec ord).toHav eBeenCalle dWith(jasm ine.object Containing ({ | |
| 117 | jobJpid: ' 1234-1234- 1234-1234' , | |
| 118 | jobType: ' enterprise -sync-requ est', | |
| 119 | patientIde ntifierTyp e: 'pid', | |
| 120 | patientIde ntifierVal ue: '9E7A; 3', | |
| 121 | vxsyncEnvi ronmentNam e: 'vxsync _environme nt', | |
| 122 | job: error Record.job | |
| 123 | }), jasmine.an y(Function )); | |
| 124 | ||
| 125 | fini shed = tru e; | |
| 126 | }); | |
| 127 | }) ; | |
| 128 | ||
| 129 | wa itsFor(fun ction() { | |
| 130 | return f inished; | |
| 131 | }) ; | |
| 132 | }); | |
| 133 | it('Te st writing error "PO LLER" to J DS', funct ion() { | |
| 134 | va r environm ent = crea teEnvironm ent(config ); | |
| 135 | ||
| 136 | va r writeErr orRecord = jdsErrorW riter.crea teErrorRec ordWriter( config, en vironment, log); | |
| 137 | ||
| 138 | va r errorRec ord = crea tePollerEr ror('pid', '9E7A;3') ; | |
| 139 | ||
| 140 | va r finished = true; | |
| 141 | ru ns (functi on() { | |
| 142 | writeErr orRecord(e rrorRecord , function () { | |
| 143 | expe ct(environ ment.jds.a ddErrorRec ord).toHav eBeenCalle dWith(jasm ine.object Containing ({ | |
| 144 | patientIde ntifierTyp e: 'pid', | |
| 145 | patientIde ntifierVal ue: '9E7A; 3', | |
| 146 | vxsyncEnvi ronmentNam e: 'vxsync _environme nt', | |
| 147 | patientIde ntifier: e rrorRecord .patientId entifier | |
| 148 | }), jasmine.an y(Function )); | |
| 149 | ||
| 150 | fini shed = tru e; | |
| 151 | }); | |
| 152 | }) ; | |
| 153 | ||
| 154 | wa itsFor(fun ction() { | |
| 155 | return f inished; | |
| 156 | }) ; | |
| 157 | ||
| 158 | }); | |
| 159 | }); |
Araxis Merge (but not the data content of this report) is Copyright © 1993-2016 Araxis Ltd (www.araxis.com). All rights reserved.