@@ -91,39 +91,39 @@ public void testSetCredentials() {
91
91
92
92
@ Test
93
93
public void testProxyAuth () throws Exception {
94
- PasswordAuthentication initialAuth = Authenticator .requestPasswordAuthentication (InetAddress .getByName ("127.0.0.1 " ),
94
+ PasswordAuthentication initialAuth = Authenticator .requestPasswordAuthentication (InetAddress .getByName ("localhost " ),
95
95
123 , "http" , "" , "" );
96
- IVCS vcs = new GitVCS (localVCSWorkspace .getVCSRepositoryWorkspace ("127.0.0.1 " ));
97
- vcs .setProxy ("127.0.0.1 " , 123 , "username" , "pwd" );
96
+ IVCS vcs = new GitVCS (localVCSWorkspace .getVCSRepositoryWorkspace ("localhost " ));
97
+ vcs .setProxy ("localhost " , 123 , "username" , "pwd" );
98
98
99
99
PasswordAuthentication resultAuth = Authenticator .requestPasswordAuthentication (
100
- InetAddress .getByName ("127.0.0.1 " ), 123 , "http" , "" , "" );
100
+ InetAddress .getByName ("localhost " ), 123 , "http" , "" , "" );
101
101
assertEquals (resultAuth .getUserName (), "username" );
102
102
assertEquals (new String (resultAuth .getPassword ()), "pwd" );
103
103
104
104
resultAuth = Authenticator .requestPasswordAuthentication (
105
- InetAddress .getByName ("localhost" ), 123 , "http" , "" , "" );
105
+ InetAddress .getByName ("localhost" ), 124 , "http" , "" , "" );
106
106
assertEquals (resultAuth , initialAuth );
107
107
}
108
108
109
109
@ Test
110
110
public void testProxySelector () throws URISyntaxException {
111
- vcs .setProxy ("127.0.0.1 " , 123 , "username" , "pwd" );
111
+ vcs .setProxy ("localhost " , 123 , "username" , "pwd" );
112
112
ProxySelector actualPS = ProxySelector .getDefault ();
113
113
List <Proxy > proxies = actualPS .select (new URI (vcs .getRepoUrl ()));
114
114
assertTrue (proxies .size () == 1 );
115
115
Proxy actualP = proxies .get (0 );
116
116
assertTrue (actualP .address () instanceof InetSocketAddress );
117
117
InetSocketAddress isa = (InetSocketAddress ) actualP .address ();
118
- assertEquals (isa .getHostName (), "127.0.0.1 " );
118
+ assertEquals (isa .getHostName (), "localhost " );
119
119
assertEquals (isa .getPort (), 123 );
120
120
}
121
121
122
122
@ Test
123
123
public void testParentProxySelectorUsage () throws URISyntaxException {
124
124
ProxySelector mockedPS = Mockito .mock (ProxySelector .class );
125
125
ProxySelector .setDefault (mockedPS );
126
- vcs .setProxy ("127.0.0.1 " , 123 , "username" , "pwd" );
126
+ vcs .setProxy ("localhost " , 123 , "username" , "pwd" );
127
127
ProxySelector actualPS = ProxySelector .getDefault ();
128
128
URI uri = new URI ("http://unknown" );
129
129
actualPS .select (uri );
@@ -133,7 +133,7 @@ public void testParentProxySelectorUsage() throws URISyntaxException {
133
133
@ Test
134
134
public void testNullProxySelector () throws URISyntaxException {
135
135
ProxySelector .setDefault (null );
136
- vcs .setProxy ("127.0.0.1 " , 123 , "username" , "pwd" );
136
+ vcs .setProxy ("localhost " , 123 , "username" , "pwd" );
137
137
ProxySelector actualPS = ProxySelector .getDefault ();
138
138
List <Proxy > proxies = actualPS .select (new URI ("http://unknown" ));
139
139
assertTrue (proxies .size () == 1 );
@@ -144,7 +144,7 @@ public void testNullProxySelector() throws URISyntaxException {
144
144
public void testParentSelectorCallOnConnectFailed () throws URISyntaxException {
145
145
ProxySelector mockedPS = Mockito .mock (ProxySelector .class );
146
146
ProxySelector .setDefault (mockedPS );
147
- vcs .setProxy ("127.0.0.1 " , 123 , "username" , "pwd" );
147
+ vcs .setProxy ("localhost " , 123 , "username" , "pwd" );
148
148
ProxySelector actualPS = ProxySelector .getDefault ();
149
149
URI testURI = new URI ("http://proxy.net" );
150
150
SocketAddress testSA = InetSocketAddress .createUnresolved ("http://proxy.net" , 123 );
@@ -155,7 +155,7 @@ public void testParentSelectorCallOnConnectFailed() throws URISyntaxException {
155
155
@ Test
156
156
public void testNoParentSelectorOnConnectFailed () throws URISyntaxException {
157
157
ProxySelector .setDefault (null );
158
- vcs .setProxy ("127.0.0.1 " , 123 , "username" , "pwd" );
158
+ vcs .setProxy ("localhost " , 123 , "username" , "pwd" );
159
159
ProxySelector actualPS = Mockito .spy (ProxySelector .getDefault ());
160
160
URI testURI = new URI ("http://proxy.net" );
161
161
SocketAddress testSA = InetSocketAddress .createUnresolved ("http://proxy.net" , 123 );
0 commit comments