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 | active-user-retriever-itest-spec.js | Mon Aug 28 20:41:42 2017 UTC |
| 2 | ehmp.zip\ehmp\ehmp\product\production\vx-sync\tests\integrationtests\utils\osync | active-user-retriever-itest-spec.js | Tue Oct 3 13:08:52 2017 UTC |
| Description | Between Files 1 and 2 |
|
|---|---|---|
| Text Blocks | Lines | |
| Unchanged | 2 | 248 |
| 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 _ = re quire('und erscore'); | |
| 6 | var moment = require ('moment') ; | |
| 7 | ||
| 8 | var logger = require (global.VX _DUMMIES + 'dummy-lo gger'); | |
| 9 | var wConfi g = requir e(global.V X_ROOT + ' worker-con fig'); | |
| 10 | var PjdsCl ient = req uire(globa l.VX_SUBSY STEMS + 'j ds/pjds-cl ient'); | |
| 11 | ||
| 12 | var retrie ver = requ ire(global .OSYNC_UTI LS + 'acti ve-user-re triever'); | |
| 13 | ||
| 14 | describe(' active-use r-retrieve r.js', fun ction() { | |
| 15 | var co nfig = {pj ds: _.defa ults(wConf ig.pjds, { | |
| 16 | pr otocol: 'h ttp', | |
| 17 | host: ' IP ', | |
| 18 | port: PORT | |
| 19 | })}; | |
| 20 | ||
| 21 | var pj ds = new P jdsClient( logger, lo gger, conf ig); | |
| 22 | ||
| 23 | var en vironment = { | |
| 24 | pj ds: pjds | |
| 25 | }; | |
| 26 | ||
| 27 | var te stDone; | |
| 28 | ||
| 29 | before Each(funct ion() { | |
| 30 | te stDone = f alse; | |
| 31 | va r setUpDon e = false; | |
| 32 | ||
| 33 | ru ns(functio n () { | |
| 34 | var user = {uid: ' urn:va:use r:9E7A:345 34543', si te: '9E7A' , id: '345 34543', la stSuccessf ulLogin: m oment().fo rmat()}; | |
| 35 | ||
| 36 | pjds.add ActiveUser (user, fun ction (err or, respon se) { | |
| 37 | if ( error) { | |
| 38 | expect(err or).toBeFa lsy(); | |
| 39 | } | |
| 40 | ||
| 41 | expe ct(respons e.statusCo de).toBe(2 01); | |
| 42 | setU pDone = tr ue; | |
| 43 | }); | |
| 44 | }) ; | |
| 45 | ||
| 46 | wa itsFor(fun ction () { return set UpDone;}, 'set up', 20000); | |
| 47 | }); | |
| 48 | ||
| 49 | afterE ach(functi on() { | |
| 50 | va r tearDown = false; | |
| 51 | ||
| 52 | ru ns(functio n () { | |
| 53 | pjds.rem oveActiveU ser('urn:v a:user:9E7 A:34534543 ', functio n (error, response) { | |
| 54 | expe ct(error). toBeFalsy( ); | |
| 55 | expe ct(respons e.statusCo de).toBe(2 00); | |
| 56 | tear Down = tru e; | |
| 57 | }); | |
| 58 | }) ; | |
| 59 | ||
| 60 | wa itsFor(fun ction () { return tea rDown;}, ' tear down' , 20000); | |
| 61 | }); | |
| 62 | ||
| 63 | it('ac tive user found and returned', function( ) { | |
| 64 | va r users; | |
| 65 | ||
| 66 | ru ns(functio n () { | |
| 67 | retrieve r.getAllAc tiveUsers( logger, co nfig, envi ronment, f unction(er ror, resul ts) { | |
| 68 | user s = result s; | |
| 69 | test Done = tru e; | |
| 70 | }); | |
| 71 | }) ; | |
| 72 | ||
| 73 | wa itsFor(fun ction () { return tes tDone;}, ' test done' , 20000); | |
| 74 | ||
| 75 | ru ns(functio n () { | |
| 76 | expect(u sers.lengt h).toBeTru thy(); | |
| 77 | expect(u sers).toCo ntain(jasm ine.object Containing ({uid: 'ur n:va:user: 9E7A:34534 543'})); | |
| 78 | }) ; | |
| 79 | }); | |
| 80 | ||
| 81 | it('ac tive user found but on blackli st and not returned' , function () { | |
| 82 | va r initBlac klist = fa lse; | |
| 83 | ||
| 84 | ru ns(functio n () { | |
| 85 | pjds.add ToOsyncBli st('345345 43', '9E7A ', 'user', function (error, re sponse) { | |
| 86 | if ( error) { | |
| 87 | expect(err or).toBeFa lsy(); | |
| 88 | } | |
| 89 | ||
| 90 | expe ct(respons e.statusCo de).toBe(2 01); | |
| 91 | init Blacklist = true; | |
| 92 | }); | |
| 93 | }) ; | |
| 94 | ||
| 95 | wa itsFor(fun ction () { return ini tBlacklist ;}, 'init black list ', 20000); | |
| 96 | ||
| 97 | va r users; | |
| 98 | ||
| 99 | ru ns(functio n () { | |
| 100 | retrieve r.getAllAc tiveUsers( logger, co nfig, envi ronment, f unction(er ror, resul ts) { | |
| 101 | user s = result s; | |
| 102 | test Done = tru e; | |
| 103 | }); | |
| 104 | }) ; | |
| 105 | ||
| 106 | wa itsFor(fun ction () { return tes tDone;}, ' test done' , 20000); | |
| 107 | ||
| 108 | ru ns(functio n () { | |
| 109 | expect(u sers || [] ).not.toCo ntain(jasm ine.object Containing ({uid: 'ur n:va:user: 9E7A:34534 543'})); | |
| 110 | }) ; | |
| 111 | va r clearBla cklist = f alse; | |
| 112 | ||
| 113 | ru ns(functio n () { | |
| 114 | pjds.rem oveFromOsy ncBlist('3 4534543', '9E7A', 'u ser', func tion (erro r, respons e) { | |
| 115 | if ( error) { | |
| 116 | expect(err or).toBeFa lsy(); | |
| 117 | } | |
| 118 | ||
| 119 | expe ct(respons e.statusCo de).toBe(2 00); | |
| 120 | clea rBlacklist = true; | |
| 121 | }); | |
| 122 | }) ; | |
| 123 | ||
| 124 | wa itsFor(fun ction () { return cle arBlacklis t;}, 'clea r black li st', 20000 ); | |
| 125 | }); | |
| 126 | }); |
Araxis Merge (but not the data content of this report) is Copyright © 1993-2016 Araxis Ltd (www.araxis.com). All rights reserved.