Produced by Araxis Merge on 10/3/2017 11:16:05 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\tests\acceptance-tests\features\steps\helper | HTTPartyWithBasicAuth.rb | Tue Jan 10 16:20:50 2017 UTC |
| 2 | ehmp.zip\ehmp\ehmp\product\tests\acceptance-tests\features\steps\helper | HTTPartyWithBasicAuth.rb | Mon Oct 2 20:08:40 2017 UTC |
| Description | Between Files 1 and 2 |
|
|---|---|---|
| Text Blocks | Lines | |
| Unchanged | 3 | 172 |
| Changed | 2 | 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 | require "h ttparty" | |
| 2 | ||
| 3 | path = Fil e.expand_p ath '..', __FILE__ | |
| 4 | $LOAD_PATH .unshift p ath unless $LOAD_PAT H.include? (path) | |
| 5 | require "D efaultHmpL ogin.rb" | |
| 6 | require "T estSupport .rb" | |
| 7 | require "D omAccess.r b" | |
| 8 | require "P atientPick erDomEleme nts.rb" | |
| 9 | ||
| 10 | class HTTP artyWithBa sicAuth | |
| 11 | include HTTParty | |
| 12 | @@auth = { :username => " PW ", :passwo rd => " REDACTED " } | |
| 13 | @@time_s tart = Tim e.new | |
| 14 | @@time_d one = Time .new | |
| 15 | ||
| 16 | @@defaul t_time_out = 300 | |
| 17 | def self .time_elap sed_last_c all | |
| 18 | return @@time_do ne - @@tim e_start | |
| 19 | end | |
| 20 | ||
| 21 | def self .check_hos t(path) | |
| 22 | if pat h.include? "C877;" | |
| 23 | @@auth = { :username => " DNS ", :passwo rd => " REDACTED " } | |
| 24 | end | |
| 25 | end | |
| 26 | ||
| 27 | def self .post_with _authoriza tion(path, time_out = @@defaul t_time_out ) | |
| 28 | # "Aut horization ", "Basic QjM2Mjs1MD A6cHUxMjM0 O3B1MTIzNC Eh" | |
| 29 | # dire ctory = po st(path, { :verify = > false, : headers => @@header, :basic_a uth => @@a uth }) | |
| 30 | check_ host(path) | |
| 31 | @@time _start = T ime.new | |
| 32 | direct ory = post (path, { : verify => false, :ba sic_auth = > @@auth, :timeout = > time_out }) | |
| 33 | @@time _done = Ti me.new | |
| 34 | return directory | |
| 35 | end | |
| 36 | ||
| 37 | def self .post_with _authoriza tion_for_u ser(path, user, pass , time_out = @@defau lt_time_ou t) | |
| 38 | @@time _start = T ime.new | |
| 39 | auth = { :userna me => user , :passwor d => pass } | |
| 40 | direct ory = post (path, { : verify => false, :ba sic_auth = > auth, :t imeout => time_out } ) | |
| 41 | @@time _done = Ti me.new | |
| 42 | return directory | |
| 43 | end | |
| 44 | ||
| 45 | def self .get_with_ authorizat ion(path, time_out = @@default _time_out) | |
| 46 | # @re sponse = H TTParty.ge t(@dataHre f, { :veri fy => fals e, :header s => { 'Ac cept' => ' applicatio n/json' }, :basic_au th => auth }) | |
| 47 | ||
| 48 | # dire ctory = ge t(path, { :verify => false, :h eaders => @@header, :basic_au th => @@au th}) | |
| 49 | check_ host(path) | |
| 50 | @@time _start = T ime.new | |
| 51 | direct ory = get( path, { :v erify => f alse, :bas ic_auth => @@auth, : timeout => time_out }) | |
| 52 | @@time _done = Ti me.new | |
| 53 | return directory | |
| 54 | end | |
| 55 | ||
| 56 | def self .get_with_ authorizat ion_for_us er(path, u ser, pass, time_out = @@defaul t_time_out ) | |
| 57 | @@time _start = T ime.new | |
| 58 | auth = { :userna me => user , :passwor d => pass } | |
| 59 | direct ory = get( path, { :v erify => f alse, :bas ic_auth => auth, :ti meout => t ime_out }) | |
| 60 | @@time _done = Ti me.new | |
| 61 | return directory | |
| 62 | end | |
| 63 | ||
| 64 | def self .put_with_ authorizat ion(path, time_out = @@default _time_out) | |
| 65 | check_ host(path) | |
| 66 | @@time _start = T ime.new | |
| 67 | direct ory = put( path, { :v erify => f alse, :bas ic_auth => @@auth, : timeout => time_out }) | |
| 68 | @@time _done = Ti me.new | |
| 69 | return directory | |
| 70 | end | |
| 71 | ||
| 72 | def self .delete_wi th_authori zation(pat h, time_ou t = @@defa ult_time_o ut) | |
| 73 | check_ host(path) | |
| 74 | @@time _start = T ime.new | |
| 75 | direct ory = dele te(path, { :verify = > false, : basic_auth => @@auth , :timeou t => time_ out }) | |
| 76 | @@time _done = Ti me.new | |
| 77 | return directory | |
| 78 | end | |
| 79 | ||
| 80 | def self .post_writ e_back(pat h, param, time_out = @@default _time_out) | |
| 81 | # chec k_host(pat h) | |
| 82 | @@time _start = T ime.new | |
| 83 | direct ory = post (path, { : verify => false, :bo dy => para m , :heade rs => { 'C ontent-Typ e' => 'app lication/j son' }, :t imeout => time_out } ) | |
| 84 | @@time _done = Ti me.new | |
| 85 | return directory | |
| 86 | end | |
| 87 | ||
| 88 | end |
Araxis Merge (but not the data content of this report) is Copyright © 1993-2016 Araxis Ltd (www.araxis.com). All rights reserved.