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\record-update | vista-site-data-resync-util-itest-spec.js | Mon Jul 10 17:46:22 2017 UTC |
| 2 | ehmp.zip\ehmp\ehmp\product\production\vx-sync\tests\integrationtests\record-update | vista-site-data-resync-util-itest-spec.js | Tue Oct 3 12:55:32 2017 UTC |
| Description | Between Files 1 and 2 |
|
|---|---|---|
| Text Blocks | Lines | |
| Unchanged | 2 | 280 |
| 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('. ./../../en v-setup'); | |
| 4 | ||
| 5 | var VistaR esyncUtil = require( global.VX_ ROOT + 're cord-updat e/utils/vi sta-site-d ata-resync -util'); | |
| 6 | var log = require(gl obal.VX_DU MMIES + '/ dummy-logg er'); | |
| 7 | ||
| 8 | // Be sure next line s are comm ented out before pus hing | |
| 9 | // var log Util = req uire(globa l.VX_UTILS + 'log'); | |
| 10 | // log = l ogUtil._cr eateLogger ({ | |
| 11 | // na me: 'vista -site-data -resync-ut il-itest', | |
| 12 | // le vel: 'debu g' | |
| 13 | // }); | |
| 14 | ||
| 15 | var VistaC lient = re quire(glob al.VX_SUBS YSTEMS + ' vista/vist a-client') ; | |
| 16 | var JdsCli ent = requ ire(global .VX_SUBSYS TEMS + 'jd s/jds-clie nt'); | |
| 17 | var _ = re quire('und erscore'); | |
| 18 | ||
| 19 | var val = require(gl obal.VX_UT ILS + 'obj ect-utils' ).getPrope rty; | |
| 20 | var syncAn dWaitForPa tient = re quire(glob al.VX_INTT ESTS + 'fr amework/ha ndler-test -framework ').syncAnd WaitForPat ient; | |
| 21 | var getBea nstalkConf ig = requi re(global. VX_INTTEST S + 'frame work/handl er-test-fr amework'). getBeansta lkConfig; | |
| 22 | var update Tubenames = require( global.VX_ INTTESTS + 'framewor k/handler- test-frame work').upd ateTubenam es; | |
| 23 | var getTub enames = r equire(glo bal.VX_INT TESTS + 'f ramework/h andler-tes t-framewor k').getTub enames; | |
| 24 | var clearT ubes = req uire(globa l.VX_INTTE STS + 'fra mework/han dler-test- framework' ).clearTub es; | |
| 25 | var grabJo bs = requi re(global. VX_INTTEST S + 'frame work/job-g rabber'); | |
| 26 | var moment = require ('moment') ; | |
| 27 | ||
| 28 | var testCo nfig = req uire(globa l.VX_INTTE STS + 'tes t-config') ; | |
| 29 | var host = testConfi g.vxsyncIP ; | |
| 30 | //Use the main vxsyn c beanstal k for test ing, since the recor d-update e nvironment is run se parately | |
| 31 | var port = PORT ; | |
| 32 | ||
| 33 | var wConfi g = requir e(global.V X_ROOT + ' worker-con fig'); | |
| 34 | var config = { | |
| 35 | sy ncRequestA pi: _.defa ults({ | |
| 36 | host : host | |
| 37 | }, wConfig.s yncRequest Api), | |
| 38 | vi staSites: { | |
| 39 | '9E7 A': _.clon e(wConfig. vistaSites ['9E7A']) | |
| 40 | }, | |
| 41 | jd s: _.clone (wConfig.j ds) | |
| 42 | }; | |
| 43 | ||
| 44 | var tubePr efix = 'vi sta-site-d ata-resync -util-test '; | |
| 45 | var jobTyp e = 'recor d-update'; | |
| 46 | var tubena mes; | |
| 47 | ||
| 48 | /* | |
| 49 | ** * Note *** | |
| 50 | Th is test re quires a p atient to be synced before it can test t he utility . | |
| 51 | Th e patient used here is 9E7A;24 . | |
| 52 | Th is patient will rema in synced after the test runs. | |
| 53 | */ | |
| 54 | ||
| 55 | describe(' VistaResyn cUtil inte gration te st', funct ion() { | |
| 56 | it ('Verify u tility run s without error', fu nction() { | |
| 57 | var pid = '9E7 A;24'; | |
| 58 | ||
| 59 | var pids = [pi d]; | |
| 60 | var sites = [' 9E7A']; | |
| 61 | var updateTime = moment( ).format(' YYYYMMDDHH mmss'); | |
| 62 | var domains = ['vital']; | |
| 63 | var referenceI nfo = { | |
| 64 | sessio nId: 'Test ', | |
| 65 | utilit yType: 'Vi sta Site D ata Resync Util Inte gration Te st' | |
| 66 | }; | |
| 67 | ||
| 68 | var vistaClien t = new Vi staClient( log, log, config, nu ll); | |
| 69 | var jds = new JdsClient( log, log, config); | |
| 70 | ||
| 71 | sync AndWaitFor Patient(lo g, config, pid); | |
| 72 | ||
| 73 | var beanstalkC onfig = ge tBeanstalk Config(con fig, host, port, tub ePrefix + '-' + jobT ype); | |
| 74 | upda teTubename s(beanstal kConfig); | |
| 75 | ||
| 76 | tube names = ge tTubenames (beanstalk Config, [j obType]); | |
| 77 | ||
| 78 | conf ig.beansta lk = beans talkConfig ; | |
| 79 | ||
| 80 | var handlerDon e = false; | |
| 81 | runs (function( ) { | |
| 82 | log.de bug('vista -site-data -resync-ut il-itest-s pec: now t esting han dler'); | |
| 83 | var vi staResyncU til = new VistaResyn cUtil(log, vistaClie nt, jds, c onfig, _.f irst(tuben ames)); | |
| 84 | ||
| 85 | vistaR esyncUtil. runUtility (sites, pi ds, update Time, doma ins, refer enceInfo, function(e rror) { | |
| 86 | expect(e rror).toBe Falsy(); | |
| 87 | ||
| 88 | if (erro r) { | |
| 89 | handlerDon e = true; | |
| 90 | return; | |
| 91 | } | |
| 92 | ||
| 93 | grabJobs (log, host , port, tu benames, 2 , function (error, jo bs) { | |
| 94 | expect(err or).toBeFa lsy(); | |
| 95 | expect(job s).toBeTru thy(); | |
| 96 | ||
| 97 | var result JobTypes = _.chain(j obs).map(f unction(re sult) { | |
| 98 | re turn resul t.jobs; | |
| 99 | }).flatten ().pluck(' type').val ue(); | |
| 100 | ||
| 101 | expect(val (resultJob Types, 'le ngth')).to BeGreaterT han(0); | |
| 102 | expect(res ultJobType s).toConta in(jobType ); | |
| 103 | ||
| 104 | //Check ev ery job fo r referenc eInfo | |
| 105 | _.each(val (jobs, ['0 ', 'jobs'] ), functio n(job) { | |
| 106 | ex pect(job.r eferenceIn fo).toEqua l(jasmine. objectCont aining({ | |
| 107 | sess ionId: ref erenceInfo .sessionId , | |
| 108 | util ityType: r eferenceIn fo.utility Type, | |
| 109 | requ estId: jas mine.any(S tring) | |
| 110 | }) ); | |
| 111 | }); | |
| 112 | ||
| 113 | handlerDon e = true; | |
| 114 | }); | |
| 115 | }); | |
| 116 | }); | |
| 117 | ||
| 118 | wait sFor(funct ion() { | |
| 119 | return handlerDo ne; | |
| 120 | }, ' waiting fo r handler' , 10000); | |
| 121 | }) ; | |
| 122 | ||
| 123 | af terEach(fu nction() { | |
| 124 | log. debug('vis ta-site-da ta-resync- util-itest -spec: Cle aning up.. .'); | |
| 125 | ||
| 126 | var cleared = false; | |
| 127 | ||
| 128 | clea rTubes(log , host, po rt, tubena mes, funct ion() { | |
| 129 | cleare d = true; | |
| 130 | log.de bug('vista -site-data -resync-ut il-itest-s pec: **** clearTube callback w as called. '); | |
| 131 | }); | |
| 132 | ||
| 133 | wait sFor(funct ion() { | |
| 134 | return cleared; | |
| 135 | }, ' clear jobs timed out ', 10000); | |
| 136 | ||
| 137 | runs (function( ) { | |
| 138 | log.de bug('vista -site-data -resync-ut il-itest-s pec: **** test compl ete.'); | |
| 139 | }); | |
| 140 | }) ; | |
| 141 | }); |
Araxis Merge (but not the data content of this report) is Copyright © 1993-2016 Araxis Ltd (www.araxis.com). All rights reserved.