@@ -91,39 +91,39 @@ public void testSetCredentials() {
9191
9292 @ Test
9393 public void testProxyAuth () throws Exception {
94- PasswordAuthentication initialAuth = Authenticator .requestPasswordAuthentication (InetAddress .getByName ("127.0.0.1 " ),
94+ PasswordAuthentication initialAuth = Authenticator .requestPasswordAuthentication (InetAddress .getByName ("localhost " ),
9595 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" );
9898
9999 PasswordAuthentication resultAuth = Authenticator .requestPasswordAuthentication (
100- InetAddress .getByName ("127.0.0.1 " ), 123 , "http" , "" , "" );
100+ InetAddress .getByName ("localhost " ), 123 , "http" , "" , "" );
101101 assertEquals (resultAuth .getUserName (), "username" );
102102 assertEquals (new String (resultAuth .getPassword ()), "pwd" );
103103
104104 resultAuth = Authenticator .requestPasswordAuthentication (
105- InetAddress .getByName ("localhost" ), 123 , "http" , "" , "" );
105+ InetAddress .getByName ("localhost" ), 124 , "http" , "" , "" );
106106 assertEquals (resultAuth , initialAuth );
107107 }
108108
109109 @ Test
110110 public void testProxySelector () throws URISyntaxException {
111- vcs .setProxy ("127.0.0.1 " , 123 , "username" , "pwd" );
111+ vcs .setProxy ("localhost " , 123 , "username" , "pwd" );
112112 ProxySelector actualPS = ProxySelector .getDefault ();
113113 List <Proxy > proxies = actualPS .select (new URI (vcs .getRepoUrl ()));
114114 assertTrue (proxies .size () == 1 );
115115 Proxy actualP = proxies .get (0 );
116116 assertTrue (actualP .address () instanceof InetSocketAddress );
117117 InetSocketAddress isa = (InetSocketAddress ) actualP .address ();
118- assertEquals (isa .getHostName (), "127.0.0.1 " );
118+ assertEquals (isa .getHostName (), "localhost " );
119119 assertEquals (isa .getPort (), 123 );
120120 }
121121
122122 @ Test
123123 public void testParentProxySelectorUsage () throws URISyntaxException {
124124 ProxySelector mockedPS = Mockito .mock (ProxySelector .class );
125125 ProxySelector .setDefault (mockedPS );
126- vcs .setProxy ("127.0.0.1 " , 123 , "username" , "pwd" );
126+ vcs .setProxy ("localhost " , 123 , "username" , "pwd" );
127127 ProxySelector actualPS = ProxySelector .getDefault ();
128128 URI uri = new URI ("http://unknown" );
129129 actualPS .select (uri );
@@ -133,7 +133,7 @@ public void testParentProxySelectorUsage() throws URISyntaxException {
133133 @ Test
134134 public void testNullProxySelector () throws URISyntaxException {
135135 ProxySelector .setDefault (null );
136- vcs .setProxy ("127.0.0.1 " , 123 , "username" , "pwd" );
136+ vcs .setProxy ("localhost " , 123 , "username" , "pwd" );
137137 ProxySelector actualPS = ProxySelector .getDefault ();
138138 List <Proxy > proxies = actualPS .select (new URI ("http://unknown" ));
139139 assertTrue (proxies .size () == 1 );
@@ -144,7 +144,7 @@ public void testNullProxySelector() throws URISyntaxException {
144144 public void testParentSelectorCallOnConnectFailed () throws URISyntaxException {
145145 ProxySelector mockedPS = Mockito .mock (ProxySelector .class );
146146 ProxySelector .setDefault (mockedPS );
147- vcs .setProxy ("127.0.0.1 " , 123 , "username" , "pwd" );
147+ vcs .setProxy ("localhost " , 123 , "username" , "pwd" );
148148 ProxySelector actualPS = ProxySelector .getDefault ();
149149 URI testURI = new URI ("http://proxy.net" );
150150 SocketAddress testSA = InetSocketAddress .createUnresolved ("http://proxy.net" , 123 );
@@ -155,7 +155,7 @@ public void testParentSelectorCallOnConnectFailed() throws URISyntaxException {
155155 @ Test
156156 public void testNoParentSelectorOnConnectFailed () throws URISyntaxException {
157157 ProxySelector .setDefault (null );
158- vcs .setProxy ("127.0.0.1 " , 123 , "username" , "pwd" );
158+ vcs .setProxy ("localhost " , 123 , "username" , "pwd" );
159159 ProxySelector actualPS = Mockito .spy (ProxySelector .getDefault ());
160160 URI testURI = new URI ("http://proxy.net" );
161161 SocketAddress testSA = InetSocketAddress .createUnresolved ("http://proxy.net" , 123 );
0 commit comments