Produced by Araxis Merge on 10/4/2017 9:15:14 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 | vista-js.zip\vista-js\src | test.js | Tue Sep 27 13:46:04 2016 UTC |
| 2 | vista-js.zip\vista-js\src | test.js | Wed Oct 4 13:40:42 2017 UTC |
| Description | Between Files 1 and 2 |
|
|---|---|---|
| Text Blocks | Lines | |
| Unchanged | 7 | 398 |
| Changed | 6 | 30 |
| 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 | var util = require(' util'); | |
| 4 | var _ = re quire('und erscore'); | |
| 5 | var RpcCli ent = requ ire('./Rpc Client').R pcClient; | |
| 6 | ||
| 7 | var inspec t = _.part ial(util.i nspect, _, { | |
| 8 | de pth: null | |
| 9 | }); | |
| 10 | var logger = require ('bunyan') .createLog ger({ | |
| 11 | na me: 'rpc', | |
| 12 | le vel: 'debu g' | |
| 13 | }); | |
| 14 | ||
| 15 | ||
| 16 | // functio n isLogger (obj) { | |
| 17 | // var funcList = ['trace' , 'debug', 'info', ' warn', 'er ror', 'fat al']; | |
| 18 | // ret urn _.ever y(funcList , function (funcName) { | |
| 19 | // return _. isFunction (obj[funcN ame]); | |
| 20 | // }); | |
| 21 | // } | |
| 22 | ||
| 23 | ||
| 24 | // console .log(isLog ger(logger )); | |
| 25 | ||
| 26 | // console .log(isLog ger({ trac e: _.noop, debug: '_ .noop', in fo: _.noop , warn: _. noop, erro r: _.noop, fatal: _. noop })); | |
| 27 | ||
| 28 | // console .log(isLog ger({})); | |
| 29 | ||
| 30 | var config = { | |
| 31 | // host: '10 1.2.2.102' , | |
| 32 | ho st: ' IP ', | |
| 33 | po rt: PORT , | |
| 34 | ac cessCode: ' USER ', | |
| 35 | ve rifyCode: ' PW ', | |
| 36 | co ntext: 'HM P UI CONTE XT', | |
| 37 | lo calIP: '12 7.0.0.1', | |
| 38 | lo calAddress : 'localho st', | |
| 39 | co nnectTimeo ut: 3000, | |
| 40 | se ndTimeout: 10000, | |
| 41 | no Metrics: f alse | |
| 42 | }; | |
| 43 | ||
| 44 | // functio n makeVisi ble(string , openChar , closeCha r) { | |
| 45 | // str ing = stri ng || ''; | |
| 46 | // ope nChar = op enChar || '['; | |
| 47 | // clo seChar = c loseChar | | ']'; | |
| 48 | ||
| 49 | // ret urn _.redu ce(string, function( memo, ch) { | |
| 50 | // var code = ch.charC odeAt(); | |
| 51 | // return me mo + (code < 32 ? (o penChar + code + clo seChar) : ch); | |
| 52 | // }, ''); | |
| 53 | // } | |
| 54 | ||
| 55 | ||
| 56 | // var str = '\u0000 \u0000loca lhost.loca ldomain\u0 00D\u000AR OU\u000D\u 000AVISTA\ u000D\u000 A/dev/null :16898\u00 0D\u000A5\ u000D\u000 A0\u000D\u 000AVISTA. LOCAL.US\u 000D\u000A 0\u000D\u0 00A\u0004' ; | |
| 57 | // var cha nged = '[0 ][0]localh ost.locald omain[13][ 10]ROU[13] [10]VISTA[ 13][10]/de v/null:168 98[13][10] 5[13][10]0 [13][10]VI STA.LOCAL. US[13][10] 0[13][10][ 4]'; | |
| 58 | ||
| 59 | // var sen d = '[XWB] 10304\u000 ATCPConnec t500140009 127.0.0.1f f00010f001 40009local hostff\u00 04'; | |
| 60 | // var reg ex = new R egExp('^\\ [XWB\\]103 04\u000ATC PConnect50 0140009127 \\.0\\.0\\ .1ff00010f 00140009lo calhostff\ u0004$'); | |
| 61 | ||
| 62 | ||
| 63 | // console .log(regex .test(send )); | |
| 64 | ||
| 65 | // console .log('**** ****** cal ling authe nticate'); | |
| 66 | // config. PORT
|
|
| 67 | // RpcClie nt.authent icate(logg er, config , function (error, re sult) { | |
| 68 | // co nsole.log( '********' ); | |
| 69 | // co nsole.log( error); | |
| 70 | // co nsole.log( result); | |
| 71 | // co nsole.log( '********' ); | |
| 72 | // }); | |
| 73 | ||
| 74 | ||
| 75 | // var con fig = { | |
| 76 | // // host: '10 1.2.2.102' , | |
| 77 | // host: ' IP ', | |
| 78 | // port: PORT , | |
| 79 | // accessCode : ' USER ', | |
| 80 | // verifyCode : ' PW ', | |
| 81 | // co ntext: 'VP R SYNCHRON IZATION CO NTEXT', | |
| 82 | // lo calIP: '12 7.0.0.1', | |
| 83 | // lo calAddress : 'localho st', | |
| 84 | // co nnectTimeo ut: 3000, | |
| 85 | // se ndTimeout: 10000 | |
| 86 | // }; | |
| 87 | ||
| 88 | ||
| 89 | // config. PORT
|
|
| 90 | // console .log('**** ****** cal ling rpc') ; | |
| 91 | // RpcClie nt.callRpc (logger, c onfig, 'OR WU USERINF O', functi on(error, result) { | |
| 92 | // if (error) { | |
| 93 | // cons ole.log('* ******* ER ROR'); | |
| 94 | // cons ole.log('% j', error) ; | |
| 95 | // retu rn; | |
| 96 | // } | |
| 97 | ||
| 98 | // tr y { | |
| 99 | // resu lt = JSON. parse(resu lt); | |
| 100 | // } catch (err ) { | |
| 101 | // // d o nothing | |
| 102 | // } | |
| 103 | // co nsole.log( '******** RESULT'); | |
| 104 | // co nsole.log( '%j', resu lt); | |
| 105 | // }); | |
| 106 | ||
| 107 | // console .log('**** ****** cal ling rpc') ; | |
| 108 | // RpcClie nt.callRpc (logger, c onfig, 'VP RDJFS API' , { | |
| 109 | // '" server"': 'hmp-devel opment-box ', | |
| 110 | // '" command"': 'startOpe rationalDa taExtract' | |
| 111 | // }, func tion(error , result) { | |
| 112 | // co nsole.log( '********' ); | |
| 113 | // if (error) { | |
| 114 | // cons ole.log(er ror); | |
| 115 | // } | |
| 116 | ||
| 117 | // tr y { | |
| 118 | // resu lt = JSON. parse(resu lt); | |
| 119 | // } catch (err ) { | |
| 120 | // // d o nothing | |
| 121 | // } | |
| 122 | // co nsole.log( inspect(re sult)); | |
| 123 | // co nsole.log( '********' ); | |
| 124 | // }); | |
| 125 | ||
| 126 | // config. PORT
|
|
| 127 | ||
| 128 | // console .log('**** ****** exp licit auth '); | |
| 129 | // var cli ent = RpcC lient.crea te(logger, config); | |
| 130 | // client. connect(fu nction(err or, result ) { | |
| 131 | // if (error) { | |
| 132 | // cons ole.log('U nable to c onnect to Vista'); | |
| 133 | // cons ole.log(er ror); | |
| 134 | // retu rn; | |
| 135 | // } | |
| 136 | ||
| 137 | // co nsole.log( result); | |
| 138 | // co nsole.log( 'connected '); | |
| 139 | ||
| 140 | // cl ient.close (function( error, res ult) { | |
| 141 | // cons ole.log('* ********* explicit a uth'); | |
| 142 | // if ( error) { | |
| 143 | // consol e.log('clo se() was n ot clean') ; | |
| 144 | // consol e.log(erro r); | |
| 145 | // return ; | |
| 146 | // } | |
| 147 | ||
| 148 | // try { | |
| 149 | // result = JSON.pa rse(result ); | |
| 150 | // } ca tch (err) { | |
| 151 | // // do nothing | |
| 152 | // } | |
| 153 | // cons ole.log('% j', result ); | |
| 154 | // cons ole.log('* ********* explicit a uth'); | |
| 155 | // }) ; | |
| 156 | // }); | |
| 157 | ||
| 158 | // config = { | |
| 159 | // // host: '10 1.2.2.102' , | |
| 160 | // host: ' IP ', | |
| 161 | // port: 9 PORT , | |
| 162 | // accessCode : ' USER ', | |
| 163 | // verifyCode : ' PW ', | |
| 164 | // co ntext: 'VP R UI CONTE XT', | |
| 165 | // lo calIP: '12 7.0.0.1', | |
| 166 | // lo calAddress : 'localho st', | |
| 167 | // co nnectTimeo ut: 3000, | |
| 168 | // se ndTimeout: 10000 | |
| 169 | // }; | |
| 170 | ||
| 171 | ||
| 172 | console.lo g('******* *** start' ); | |
| 173 | var client = RpcClie nt.create( logger, co nfig); | |
| 174 | client.con nect(funct ion(error, result) { | |
| 175 | if (error) { | |
| 176 | cons ole.log('U nable to c onnect to Vista'); | |
| 177 | cons ole.log(er ror); | |
| 178 | retu rn; | |
| 179 | } | |
| 180 | ||
| 181 | co nsole.log( result); | |
| 182 | co nsole.log( 'connected '); | |
| 183 | ||
| 184 | cl ient.execu te('ORWU U SERINFO', function(e rror, resu lt) { | |
| 185 | if ( error) { | |
| 186 | consol e.log('Una ble to exe cute comma nd on Vist a'); | |
| 187 | consol e.log(erro r); | |
| 188 | return ; | |
| 189 | } | |
| 190 | ||
| 191 | cons ole.log('r esult: %s' , result); | |
| 192 | ||
| 193 | clie nt.close(f unction(er ror, resul t) { | |
| 194 | consol e.log('*** ******* cl ose'); | |
| 195 | if (er ror) { | |
| 196 | console. log('close () was not clean'); | |
| 197 | console. log(error) ; | |
| 198 | return; | |
| 199 | } | |
| 200 | ||
| 201 | try { | |
| 202 | result = JSON.pars e(result); | |
| 203 | } catc h (err) { | |
| 204 | // do no thing | |
| 205 | } | |
| 206 | consol e.log('%j' , result); | |
| 207 | consol e.log('*** ******* en d'); | |
| 208 | }); | |
| 209 | }) ; | |
| 210 | }); | |
| 211 | ||
| 212 | ||
| 213 | // 'ORWU U SERINFO' | |
| 214 | // 'ORWDAL 32 DEF' |
Araxis Merge (but not the data content of this report) is Copyright © 1993-2016 Araxis Ltd (www.araxis.com). All rights reserved.