867. EPMO Open Source Coordination Office Redaction File Detail Report

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.

867.1 Files compared

# Location File Last Modified
1 ehmp.zip\ehmp\ehmp\product\production\vx-sync\tests\integrationtests\utils\osync osync-clinic-utils-itest-spec.js Mon Aug 28 20:41:42 2017 UTC
2 ehmp.zip\ehmp\ehmp\product\production\vx-sync\tests\integrationtests\utils\osync osync-clinic-utils-itest-spec.js Tue Oct 3 13:12:51 2017 UTC

867.2 Comparison summary

Description Between
Files 1 and 2
Text Blocks Lines
Unchanged 2 826
Changed 1 2
Inserted 0 0
Removed 0 0

867.3 Comparison options

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

867.4 Active regular expressions

No regular expressions were active.

867.5 Comparison detail

  1   'use stric t';
  2  
  3   require('. ./../../.. /env-setup ');
  4  
  5   var _ = re quire('und erscore');
  6   var val =  require(gl obal.VX_UT ILS + 'obj ect-utils' ).getPrope rty;
  7   var log =  require(gl obal.VX_DU MMIES + '/ dummy-logg er');
  8   // NOTE: b e sure nex t lines ar e commente d out befo re pushing
  9   // var log Util = req uire(globa l.VX_UTILS  + 'log');
  10   // log = l ogUtil._cr eateLogger ({
  11   //      na me: 'test' ,
  12   //      le vel: 'debu g',
  13   //      ch ild: logUt il._create Logger
  14   // });
  15  
  16   var JdsCli ent = requ ire(global .VX_SUBSYS TEMS + 'jd s/jds-clie nt');
  17   var PjdsCl ient = req uire(globa l.VX_SUBSY STEMS + 'j ds/pjds-cl ient');
  18   var OsyncC linicUtils  = require (global.VX _UTILS + ' osync/osyn c-clinic-u tils');
  19  
  20   var config  = JSON.pa rse(JSON.s tringify(r equire(glo bal.VX_ROO T + 'worke r-config') ));
  21  
  22   var getBea nstalkConf ig = requi re(global. VX_INTTEST S + 'frame work/handl er-test-fr amework'). getBeansta lkConfig;
  23   var update Tubenames  = require( global.VX_ INTTESTS +  'framewor k/handler- test-frame work').upd ateTubenam es;
  24   var getTub enames = r equire(glo bal.VX_INT TESTS + 'f ramework/h andler-tes t-framewor k').getTub enames;
  25   var clearT ubes = req uire(globa l.VX_INTTE STS + 'fra mework/han dler-test- framework' ).clearTub es;
  26   var grabJo bs = requi re(global. VX_INTTEST S + 'frame work/job-g rabber');
  27  
  28   var Beanst alkClient  = require( global.VX_ JOBFRAMEWO RK).Beanst alkClient;
  29   var testCo nfig = req uire(globa l.VX_INTTE STS + 'tes t-config') ;
  30   var host =  testConfi g.vxsyncIP ;
  31   var port =   PORT ;
  32  
  33   var Publis herRouter  = require( global.VX_ JOBFRAMEWO RK).Publis herRouter;
  34  
  35   function b uildEnviro nment(log,  config) {
  36           re turn {
  37                    jds:  new JdsCl ient(log,  log, confi g),
  38                    pjds : new Pjds Client(log , log, con fig),
  39                    jobS tatusUpdat er: {
  40                             create JobStatus:  function( job, callb ack) {
  41                                      callback ();
  42                             },
  43                             errorJ obStatus:  function(j ob, error,  callback)  {
  44                                      callback ();
  45                             }
  46                    }
  47           };
  48   }
  49  
  50   var beanst alkConfig  = getBeans talkConfig (config, h ost, port,  tubePrefi x + '-' +  jobType);
  51   updateTube names(bean stalkConfi g);
  52  
  53   tubenames  = getTuben ames(beans talkConfig , [jobType ]);
  54  
  55   config.bea nstalk = b eanstalkCo nfig;
  56  
  57   var site1  = 'ABAB';
  58   var clinic 1 = {
  59           na me: 'TEST1 ',
  60           ty pe: 'Z',
  61           si te: 'ABAB' ,
  62           oo s: false,
  63           st ampTime: ' 2016110715 1143',
  64           ui d: 'urn:va :location: ABAB:100'
  65   };
  66  
  67   var clinic 2 = {
  68           na me: 'TEST2 ',
  69           ty pe: 'Z',
  70           si te: 'ABAB' ,
  71           oo s: false,
  72           st ampTime: ' 2016110715 1143',
  73           ui d: 'urn:va :location: ABAB:121'
  74   };
  75  
  76   var site2  = 'BABA';
  77   var clinic 3 = {
  78           na me: 'TEST3 ',
  79           ty pe: 'Z',
  80           si te: 'BABA' ,
  81           oo s: false,
  82           st ampTime: ' 2016110715 1143',
  83           ui d: 'urn:va :location: BABA:10'
  84   };
  85  
  86   var numeri cSite = 12 34;
  87   var clinic 4 = {
  88           na me: 'TESTN UMERIC',
  89           ty pe: 'Z',
  90           si te: '1234' ,
  91           oo s: false,
  92           st ampTime: ' 2016110715 1143',
  93           ui d: 'urn:va :location: 1234:10'
  94   };
  95  
  96   var tubePr efix = 'os ync-clinic -utils-tes t';
  97   var jobTyp e = 'appoi ntments';
  98   var tubena mes;
  99  
  100   var refere nceInfo =  {
  101           se ssionId: ' TEST',
  102           ut ilityType:  'osync-cl inic'
  103   };
  104  
  105   describe(' osync-clin ic-utils i ntegration  test', fu nction() {
  106           be foreEach(f unction()  {
  107                    var  done = 0;
  108                    var  jds = new  JdsClient( log, log,  config);
  109                    var  environmen t = buildE nvironment (log, conf ig);
  110                    var  osyncClini cUtil = ne w OsyncCli nicUtils(l og, config , environm ent);
  111  
  112                    runs (function( ) {
  113                             _.each ([clinic1,  clinic2,  clinic3, c linic4], f unction(cl inic) {
  114                                      jds.stor eOperation alData(cli nic, funct ion(error,  response)  {
  115                                               expect(err or).toBeFa lsy();
  116                                               expect(res ponse).toB eTruthy();
  117                                               expect(val (response,  'statusCo de')).toEq ual(201);
  118                                               done++;
  119                                      });
  120                             });
  121  
  122                             osyncC linicUtil. osyncClini cRemove(si te1 + ','  + site2 +  ',' + nume ricSite, n ull, funct ion(error,  response)  {
  123                                      //Will r eturn an e rror if th e clinic d oes not ex ist
  124                                      done++;
  125                             });
  126                    });
  127  
  128                    wait sFor(funct ion() {
  129                             return  done ===  5;
  130                    },'s etup to co mplete');
  131           }) ;
  132  
  133           it ('osyncCli nicAdd, os yncClinicG et, osyncC linicRun,  osyncClini cRemove',  function()  {
  134                    var  environmen t = buildE nvironment (log, conf ig);
  135                    envi ronment.be anstalk =  new Beanst alkClient( log, host,  config.be anstalk.re poDefaults .port);
  136                    envi ronment.pu blisherRou ter = new  PublisherR outer(log,  config, l og, enviro nment.jobS tatusUpdat er);
  137                    var  osyncClini cUtil = ne w OsyncCli nicUtils(l og, config , environm ent);
  138  
  139                    var  osyncClini cAddDone =  0;
  140                    runs (function( ) {
  141                             //osyn cClinicAdd  - by uid  - override
  142                             //                                                               site cl inic uid           ty pe overrid e
  143                             osyncC linicUtil. osyncClini cAdd(null,  null, cli nic1.uid,  null, true , function (error, re sult) {
  144                                      expect(e rror).toBe Falsy();
  145                                      expect(r esult).toC ontain('UI D ' + clin ic1.uid +  ' added to  osynclini c store');
  146                                      osyncCli nicAddDone ++;
  147                             });
  148  
  149                             //osyn cClinicAdd  - by uid  - no overr ide
  150                             //                                                               site cl inic uid          typ e override
  151                             osyncC linicUtil. osyncClini cAdd(null,  null, cli nic2.uid,  'Z', false , function (error, re sult) {
  152                                      expect(e rror).toBe Falsy();
  153                                      expect(r esult).toC ontain('UI D ' + clin ic2.uid +  ' added to  osynclini c store');
  154                                      osyncCli nicAddDone ++;
  155                             });
  156  
  157                             //osyn cClinicAdd  - by site  and clini c
  158                             //                                                               site     clinic        uid    type overr ide
  159                             osyncC linicUtil. osyncClini cAdd(site2 , clinic3. name, null , 'Z', fal se, functi on(error,  result) {
  160                                      expect(e rror).toBe Falsy();
  161                                      expect(r esult).toC ontain('UI D ' + clin ic3.uid +  ' added to  osynclini c store');
  162                                      osyncCli nicAddDone ++;
  163                             });
  164  
  165                             //osyn cClinicAdd  - by site  and clini c (all-num eric site  hash)
  166                             //                                                               site     clinic        uid    type overr ide
  167                             osyncC linicUtil. osyncClini cAdd(numer icSite, cl inic4.name , null, 'Z ', false,  function(e rror, resu lt) {
  168                                      expect(e rror).toBe Falsy();
  169                                      expect(r esult).toC ontain('UI D ' + clin ic4.uid +  ' added to  osynclini c store');
  170                                      osyncCli nicAddDone ++;
  171                             });
  172                    });
  173                    wait sFor(funct ion() {
  174                             return  osyncClin icAddDone  === 4;
  175                    }, ' osyncClini cAddDone') ;
  176  
  177                    var  osyncClini cGetDone =  0;
  178                    runs (function( ) {
  179                             //osyn cClinicGet  - single  site
  180                             osyncC linicUtil. osyncClini cGet(site1 , function (error, re sponse, re sult) {
  181                                      expect(e rror).toBe Falsy();
  182                                      expect(r esponse).t oBeTruthy( );
  183                                      expect(r esult).toC ontain(cli nic1.uid);
  184                                      expect(r esult).toC ontain(cli nic2.uid);
  185                                      osyncCli nicGetDone ++;
  186                             });
  187  
  188                             //osyn cClinicGet  - multi s ite
  189                             osyncC linicUtil. osyncClini cGet(site1  + ',' + s ite2, func tion(error , response , result)  {
  190                                      expect(e rror).toBe Falsy();
  191                                      expect(r esponse).t oBeTruthy( );
  192                                      expect(r esult).toC ontain(cli nic1.uid);
  193                                      expect(r esult).toC ontain(cli nic2.uid);
  194                                      expect(r esult).toC ontain(cli nic3.uid);
  195                                      osyncCli nicGetDone ++;
  196                             });
  197  
  198                             //osyn cClinicGet  - numeric  site
  199                             osyncC linicUtil. osyncClini cGet(numer icSite, fu nction(err or, respon se, result ) {
  200                                      expect(e rror).toBe Falsy();
  201                                      expect(r esponse).t oBeTruthy( );
  202                                      expect(r esult).toC ontain(cli nic4.uid);
  203                                      osyncCli nicGetDone ++;
  204                             });
  205                    });
  206                    wait sFor(funct ion() {
  207                             return  osyncClin icGetDone  === 3;
  208                    }, ' osyncClini cGetDone') ;
  209  
  210                    var  osyncClini cRunByUidD one = fals e;
  211                    runs (function( ) {
  212                             //osyn cClinicRun  - by uid
  213                             //                                                          s ite  uid           re ferenceInf o
  214                             osyncC linicUtil. osyncClini cRun(null,  clinic3.u id, refere nceInfo, f unction(er ror, respo nse) {
  215                                      expect(e rror).toBe Falsy();
  216                                      expect(r esponse).t oContain(' Published' );
  217  
  218                                      if (erro r) {
  219                                               osyncClini cRunByUidD one = true ;
  220                                               return;
  221                                      }
  222  
  223                                      grabJobs (log, host , port, tu benames, 0 , function (error, jo bs) {
  224                                               expect(err or).toBeFa lsy();
  225  
  226                                               var result JobTypes =  _.chain(j obs).map(f unction(re sult) {
  227                                                       re turn resul t.jobs;
  228                                               }).flatten ().pluck(' type').val ue();
  229  
  230                                               expect(val (resultJob Types, 'le ngth')).to Equal(1);
  231                                               expect(res ultJobType s).toConta in(jobType );
  232  
  233                                               var result JobReferen ceInfo = _ .map(val(j obs, ['0', 'jobs']),  function(j ob){
  234                             return  job.refer enceInfo;
  235                         });
  236  
  237                         expect(res ultJobRefe renceInfo) .toContain (jasmine.o bjectConta ining(refe renceInfo) );
  238  
  239                                               osyncClini cRunByUidD one = true ;
  240                                               return;
  241                                      });
  242                             });
  243                    });
  244                    wait sFor(funct ion() {
  245                             return  osyncClin icRunByUid Done;
  246                    }, ' osyncClini cRunByUidD one');
  247  
  248                    var  osyncClini cRunBySite Done = fal se;
  249                    runs (function( ) {
  250                             //osyn cClinicRun  - by site
  251                             //                                                          s ite   uid    referenc eInfo
  252                             osyncC linicUtil. osyncClini cRun(site1 , null, re ferenceInf o, functio n(error, r esponse) {
  253                                      expect(e rror).toBe Falsy();
  254                                      expect(r esponse).t oContain(' published' );
  255  
  256                                      if (erro r) {
  257                                               osyncClini cRunBySite Done = tru e;
  258                                               return;
  259                                      }
  260  
  261                                      grabJobs (log, host , port, tu benames, 0 , function (error, jo bs) {
  262                                               expect(err or).toBeFa lsy();
  263  
  264                                               var result JobTypes =  _.chain(j obs).map(f unction(re sult) {
  265                                                       re turn resul t.jobs;
  266                                               }).flatten ().pluck(' type').val ue();
  267  
  268                                               expect(val (resultJob Types, 'le ngth')).to Equal(2);
  269                                               expect(res ultJobType s).toConta in(jobType );
  270  
  271                                               var result JobReferen ceInfo = _ .map(val(j obs, ['0', 'jobs']),  function(j ob){
  272                             return  job.refer enceInfo;
  273                         });
  274  
  275                         expect(res ultJobRefe renceInfo. length).to BeGreaterT han(1);
  276                         _.each(res ultJobRefe renceInfo,  function( item){
  277                             expect (item).toE qual(jasmi ne.objectC ontaining( referenceI nfo));
  278                         });
  279  
  280  
  281                                               osyncClini cRunBySite Done = tru e;
  282                                               return;
  283                                      });
  284                             });
  285                    });
  286                    wait sFor(funct ion() {
  287                             return  osyncClin icRunBySit eDone;
  288                    }, ' osyncClini cRunBySite Done');
  289  
  290                    var  osyncClini cRunByNume ricSiteDon e = false;
  291                    runs (function( ) {
  292                             //osyn cClinicRun  - by site
  293                             //                                                          s ite          uid   re ferenceInf o
  294                             osyncC linicUtil. osyncClini cRun(numer icSite, nu ll, refere nceInfo, f unction(er ror, respo nse) {
  295                                      expect(e rror).toBe Falsy();
  296                                      expect(r esponse).t oContain(' published' );
  297  
  298                                      if (erro r) {
  299                                               osyncClini cRunByNume ricSiteDon e = true;
  300                                               return;
  301                                      }
  302  
  303                                      grabJobs (log, host , port, tu benames, 0 , function (error, jo bs) {
  304                                               expect(err or).toBeFa lsy();
  305  
  306                                               var result JobTypes =  _.chain(j obs).map(f unction(re sult) {
  307                                                       re turn resul t.jobs;
  308                                               }).flatten ().pluck(' type').val ue();
  309  
  310                                               expect(val (resultJob Types, 'le ngth')).to Equal(1);
  311                                               expect(res ultJobType s).toConta in(jobType );
  312  
  313                                               osyncClini cRunByNume ricSiteDon e = true;
  314                                               return;
  315                                      });
  316                             });
  317                    });
  318                    wait sFor(funct ion() {
  319                             return  osyncClin icRunByNum ericSiteDo ne;
  320                    }, ' osyncClini cRunByNume ricSiteDon e');
  321  
  322                    var  osyncClini cRemoveDon e = 0;
  323                    runs (function( ) {
  324                             //osyn cClinicRem ove - by u id
  325                             osyncC linicUtil. osyncClini cRemove(nu ll, clinic 3.uid, fun ction(erro r, respons e) {
  326                                      expect(e rror).toBe Falsy();
  327                                      expect(r esponse).t oBeTruthy( );
  328                                      osyncCli nicRemoveD one++;
  329                             });
  330                             //osyn cClinicRem ove - by s ite
  331                             osyncC linicUtil. osyncClini cRemove(si te1, null,  function( error, res ponse) {
  332                                      expect(e rror).toBe Falsy();
  333                                      expect(r esponse).t oBeTruthy( );
  334                                      osyncCli nicRemoveD one++;
  335                             });
  336                             //osyn cClinicRem ove - by s ite - nume ric
  337                             osyncC linicUtil. osyncClini cRemove(nu mericSite,  null, fun ction(erro r, respons e) {
  338                                      expect(e rror).toBe Falsy();
  339                                      expect(r esponse).t oBeTruthy( );
  340                                      osyncCli nicRemoveD one++;
  341                             });
  342                    });
  343                    wait sFor(funct ion() {
  344                             return  osyncClin icRemoveDo ne === 3;
  345                    }, ' osyncClini cRemoveDon e');
  346  
  347                    var  verifyClin icRemoved  = 0;
  348                    runs (function( ) {
  349                             //Veri fy clinic  was remove d
  350                             osyncC linicUtil. osyncClini cGet(site2 , function (error, re sponse, re sult) {
  351                                      expect(e rror).toBe Falsy();
  352                                      expect(r esponse).t oBeTruthy( );
  353                                      expect(r esult).not .toContain (clinic3.u id);
  354                                      verifyCl inicRemove d++;
  355                             });
  356                             //Veri fy clinics  were remo ved
  357                             osyncC linicUtil. osyncClini cGet(site1 , function (error, re sponse, re sult) {
  358                                      expect(e rror).toBe Falsy();
  359                                      expect(r esponse).t oBeTruthy( );
  360                                      expect(r esult).not .toContain (clinic1.u id);
  361                                      expect(r esult).not .toContain (clinic2.u id);
  362                                      verifyCl inicRemove d++;
  363                             });
  364                             //Veri fy numeric  site clin ic was rem oved
  365                             osyncC linicUtil. osyncClini cGet(numer icSite, fu nction(err or, respon se, result ) {
  366                                      expect(e rror).toBe Falsy();
  367                                      expect(r esponse).t oBeTruthy( );
  368                                      expect(r esult).not .toContain (clinic4.u id);
  369                                      verifyCl inicRemove d++;
  370                             });
  371                    });
  372                    wait sFor(funct ion() {
  373                             return  verifyCli nicRemoved  === 3;
  374                    }, ' verifyClin icRemoved' );
  375                    runs (function( ){
  376                             enviro nment.publ isherRoute r.close();
  377                    });
  378           }) ;
  379  
  380           af terEach(fu nction(){
  381                    //Cl ean up aft er testing
  382                    log. debug('pat ient-recor d-retireme nt-util-it est-spec:  Cleaning u p...');
  383  
  384                    var  jds = new  JdsClient( log, log,  config);
  385                    var  cleared =  0;
  386  
  387                    grab Jobs(log,  host, port , tubename s, 0, func tion() {
  388                             cleare d++;
  389                             log.de bug('patie nt-record- retirement -util-ites t-spec: ** ** grabJob s callback  was calle d.');
  390                    });
  391  
  392                    clea rTubes(log , host, po rt, tubena mes, funct ion() {
  393                             cleare d++;
  394                             log.de bug('patie nt-record- retirement -util-ites t-spec: ** ** clearTu be callbac k was call ed.');
  395                    });
  396  
  397                    _.ea ch([clinic 1.uid, cli nic2.uid,  clinic3.ui d, clinic4 .uid], fun ction(uid)  {
  398                             jds.de leteOperat ionalDataB yUid(uid,  function(e rror, resp onse) {
  399                                      expect(e rror).toBe Falsy();
  400                                      expect(r esponse).t oBeTruthy( );
  401                                      expect(v al(respons e, 'status Code')).to Equal(200) ;
  402                                      cleared+ +;
  403                             });
  404                    });
  405  
  406                    wait sFor(funct ion() {
  407                             return  cleared = == 6;
  408                    }, ' clean up t imed out',  10000);
  409  
  410                    runs (function( ) {
  411                             log.de bug('patie nt-record- retirement -util-ites t-spec: ** ** test co mplete.');
  412                    });
  413           }) ;
  414   });