-
Notifications
You must be signed in to change notification settings - Fork 85
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1750 from pharo-vcs/feature/honouring-proxy-setti…
…ngs-p11 Honouring Proxy Settings in P11
- Loading branch information
Showing
6 changed files
with
202 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
Class { | ||
#name : #IceProxySettingsTest, | ||
#superclass : #TestCase, | ||
#instVars : [ | ||
'oldNetworkSettingsHost', | ||
'oldNetworkSettingsPort' | ||
], | ||
#category : #'Iceberg-Tests-Core-Remotes' | ||
} | ||
|
||
{ #category : #asserting } | ||
IceProxySettingsTest >> assertProxyURLExternalStringHasValue: aString [ | ||
|
||
| value | | ||
value := Iceberg proxyURLExternalString. | ||
|
||
self assert: value isExternalAddress. | ||
self deny: value isNull. | ||
|
||
self assert: value utf8StringFromCString equals: aString | ||
] | ||
|
||
{ #category : #running } | ||
IceProxySettingsTest >> setUp [ | ||
|
||
super setUp. | ||
|
||
oldNetworkSettingsHost := NetworkSystemSettings httpProxyServer. | ||
oldNetworkSettingsPort := NetworkSystemSettings httpProxyPort. | ||
] | ||
|
||
{ #category : #running } | ||
IceProxySettingsTest >> tearDown [ | ||
|
||
NetworkSystemSettings httpProxyServer: oldNetworkSettingsHost. | ||
NetworkSystemSettings httpProxyPort: oldNetworkSettingsPort. | ||
|
||
super tearDown | ||
] | ||
|
||
{ #category : #tests } | ||
IceProxySettingsTest >> testConfigureProxyOptWithCorrectProxyUrl [ | ||
|
||
| proxyOpt | | ||
|
||
NetworkSystemSettings httpProxyServer: 'myproxy.company.com'. | ||
NetworkSystemSettings httpProxyPort: 8080. | ||
|
||
proxyOpt := LGitProxyOptions defaults. | ||
Iceberg configureLGitProxyOpt: proxyOpt. | ||
|
||
self assert: proxyOpt prim_url value equals: Iceberg proxyURLExternalString value. | ||
self assert: proxyOpt prim_url utf8StringFromCString equals: 'https://myproxy.company.com:8080'. | ||
] | ||
|
||
{ #category : #tests } | ||
IceProxySettingsTest >> testEmptyHostReturnsNullPointer [ | ||
|
||
NetworkSystemSettings httpProxyServer: ''. | ||
|
||
self assert: Iceberg proxyURLExternalString isNull. | ||
] | ||
|
||
{ #category : #tests } | ||
IceProxySettingsTest >> testHostAndDefaultPortHasCorrectAddress [ | ||
|
||
NetworkSystemSettings httpProxyServer: 'myproxy.company.com'. | ||
|
||
self assertProxyURLExternalStringHasValue: 'https://myproxy.company.com:80'. | ||
] | ||
|
||
{ #category : #tests } | ||
IceProxySettingsTest >> testHostAndPortHasCorrectAddress [ | ||
|
||
NetworkSystemSettings httpProxyServer: 'myproxy.company.com'. | ||
NetworkSystemSettings httpProxyPort: 8080. | ||
|
||
self assertProxyURLExternalStringHasValue: 'https://myproxy.company.com:8080'. | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters