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\osync | osync-admission-util-itest-spec.js | Mon Jul 10 17:46:22 2017 UTC |
| 2 | ehmp.zip\ehmp\ehmp\product\production\vx-sync\tests\integrationtests\utils\osync | osync-admission-util-itest-spec.js | Tue Oct 3 13:12:39 2017 UTC |
| Description | Between Files 1 and 2 |
|
|---|---|---|
| Text Blocks | Lines | |
| Unchanged | 2 | 264 |
| 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 _ = re quire('und erscore'); | |
| 6 | var moment = require ('moment') ; | |
| 7 | ||
| 8 | var logger = require (global.VX _DUMMIES + 'dummy-lo gger'); | |
| 9 | // NOTE: b e sure nex t lines ar e commente d out befo re pushing | |
| 10 | // var log Util = req uire(globa l.VX_UTILS + 'log'); | |
| 11 | // logger = logUtil. _createLog ger({ | |
| 12 | // nam e: 'test', | |
| 13 | // lev el: 'debug ', | |
| 14 | // chi ld: logUti l._createL ogger | |
| 15 | // }); | |
| 16 | ||
| 17 | var OsyncA dmissionUt il = requi re(global. VX_UTILS + 'osync/os ync-admiss ion-util') ; | |
| 18 | ||
| 19 | var getBea nstalkConf ig = requi re(global. VX_INTTEST S + 'frame work/handl er-test-fr amework'). getBeansta lkConfig; | |
| 20 | var update Tubenames = require( global.VX_ INTTESTS + 'framewor k/handler- test-frame work').upd ateTubenam es; | |
| 21 | var getTub enames = r equire(glo bal.VX_INT TESTS + 'f ramework/h andler-tes t-framewor k').getTub enames; | |
| 22 | var clearT ubes = req uire(globa l.VX_INTTE STS + 'fra mework/han dler-test- framework' ).clearTub es; | |
| 23 | var grabJo bs = requi re(global. VX_INTTEST S + 'frame work/job-g rabber'); | |
| 24 | //var wCon fig = requ ire(global .VX_ROOT + 'worker-c onfig'); | |
| 25 | var val = require(gl obal.VX_UT ILS + 'obj ect-utils' ).getPrope rty; | |
| 26 | var Publis herRouter = require( global.VX_ JOBFRAMEWO RK).Publis herRouter; | |
| 27 | ||
| 28 | var testCo nfig = req uire(globa l.VX_INTTE STS + 'tes t-config') ; | |
| 29 | var host = testConfi g.vxsyncIP ; | |
| 30 | var port = PORT ; | |
| 31 | ||
| 32 | var tubePr efix = 'os ync-admiss ion-util-i test'; | |
| 33 | var jobTyp e = 'admis sions'; | |
| 34 | var tubena mes; | |
| 35 | var publis herRouter; | |
| 36 | ||
| 37 | function c leanUpTube s() { | |
| 38 | lo gger.debug ('osync-ad mission-ut il-itest-s pec: Clean ing up...' ); | |
| 39 | if (publishe rRouter) { | |
| 40 | publ isherRoute r.close(); | |
| 41 | } | |
| 42 | ||
| 43 | va r cleared = 0; | |
| 44 | ||
| 45 | gr abJobs(log ger, host, port, tub enames, 0, function( ) { | |
| 46 | clea red++; | |
| 47 | logg er.debug(' osync-admi ssion-util -itest-spe c: **** gr abJobs cal lback was called.'); | |
| 48 | }) ; | |
| 49 | ||
| 50 | cl earTubes(l ogger, hos t, port, t ubenames, function() { | |
| 51 | clea red++; | |
| 52 | logg er.debug(' osync-admi ssion-util -itest-spe c: **** cl earTube ca llback was called.') ; | |
| 53 | }) ; | |
| 54 | ||
| 55 | wa itsFor(fun ction() { | |
| 56 | retu rn cleared === 2; | |
| 57 | }, 'clear jo bs timed o ut', 10000 ); | |
| 58 | ||
| 59 | ru ns(functio n() { | |
| 60 | logg er.debug(' osync-admi ssion-util -itest-spe c: **** te st complet e.'); | |
| 61 | }) ; | |
| 62 | } | |
| 63 | ||
| 64 | var refere nceInfo = { | |
| 65 | se ssionId: ' TEST', | |
| 66 | ut ilityType: 'osync-ad mission' | |
| 67 | }; | |
| 68 | ||
| 69 | describe(' osynnc-adm ission-uti l itest', function() { | |
| 70 | it ('verify j ob is crea ted', func tion(done) { | |
| 71 | var config = { }; | |
| 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 jobStatusU pdater = { | |
| 81 | create JobStatus: function( job, callb ack) { | |
| 82 | callback (); | |
| 83 | }, | |
| 84 | errorJ obStatus: function(j ob, error, callback) { | |
| 85 | callback (); | |
| 86 | } | |
| 87 | }; | |
| 88 | ||
| 89 | var environmen t = { | |
| 90 | publis herRouter: new Publi sherRouter (logger, c onfig, log ger, jobSt atusUpdate r) | |
| 91 | }; | |
| 92 | ||
| 93 | publ isherRoute r = enviro nment.publ isherRoute r; | |
| 94 | ||
| 95 | runs (function( ) { | |
| 96 | var si tes = ['AA AA', 'BBBB ']; | |
| 97 | var os yncAdmissi onUtil = n ew OsyncAd missionUti l(logger, config, en vironment) ; | |
| 98 | ||
| 99 | osyncA dmissionUt il.createA ndPublishA dmissionsJ ob(sites, referenceI nfo, funct ion(error) { | |
| 100 | expect(e rror).toBe Falsy(); | |
| 101 | ||
| 102 | if (erro r) { | |
| 103 | return don e(); | |
| 104 | } | |
| 105 | ||
| 106 | grabJobs (logger, h ost, port, tubenames , 1, funct ion(error, jobs) { | |
| 107 | expect(err or).toBeFa lsy(); | |
| 108 | ||
| 109 | var result JobTypes = _.chain(j obs).map(f unction(re sult) { | |
| 110 | re turn resul t.jobs; | |
| 111 | }).flatten ().pluck(' type').val ue(); | |
| 112 | ||
| 113 | expect(val (resultJob Types, 'le ngth')).to Equal(2); | |
| 114 | expect(res ultJobType s).toConta in(jobType ); | |
| 115 | ||
| 116 | var result JobReferen ceInfo = _ .map(val(j obs, ['0', 'jobs']), function( job) { | |
| 117 | re turn job.r eferenceIn fo; | |
| 118 | }); | |
| 119 | ||
| 120 | expect(res ultJobRefe renceInfo. length).to Equal(2); | |
| 121 | _.each(res ultJobRefe renceInfo, function( item) { | |
| 122 | ex pect(item) .toEqual(j asmine.obj ectContain ing(refere nceInfo)); | |
| 123 | }); | |
| 124 | ||
| 125 | done(); | |
| 126 | }); | |
| 127 | }); | |
| 128 | }); | |
| 129 | }) ; | |
| 130 | af terEach(fu nction() { | |
| 131 | clea nUpTubes() ; | |
| 132 | }) ; | |
| 133 | }); |
Araxis Merge (but not the data content of this report) is Copyright © 1993-2016 Araxis Ltd (www.araxis.com). All rights reserved.