/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/**
* @test
* @bug 4769350
* @build HttpCallback HttpServer ClosedChannelList HttpTransaction AbstractCallback
* @summary proxy authentication username and password caching only works in serial case
* Run in othervm since the test sets system properties that are read by the
* networking stack and cached when the HTTP handler is invoked, and previous
* tests may already have invoked the HTTP handler.
*/
public class B4769350 {
static boolean error = false;
int c;
//System.out.write (c);
}
}
boolean allowerror;
super("Thread-" + path);
this.allowerror = allowerror;
}
public void run () {
try {
} catch (URISyntaxException e) {
error = true;
} catch (IOException e) {
if (!allowerror) {
e.printStackTrace();
error = true;
}
}
}
}
req.orderlyClose();
}
}
req.orderlyClose();
}
try {
} else {
}
} catch (IOException e) {
e.printStackTrace();
}
}
/* T1 tests the client by sending 4 requests to 2 different realms
* in parallel. The client should recognise two pairs of dependent requests
* and execute the first of each pair in parallel. When they both succeed
* the second requests should be executed without calling the authenticator.
* The test succeeds if the authenticator was only called twice.
*/
switch (count) {
case 0:
break;
case 1:
break;
default:
}
}
switch (count) {
case 0:
break;
case 1:
break;
default:
}
}
switch (count) {
case 0:
break;
case 1:
break;
default:
}
}
switch (count) {
case 0:
break;
case 1:
break;
default:
}
}
/* T2 tests to check that if initial authentication fails, the second will
* succeed, and the authenticator is called twice
*/
/* This will be called several times */
if (count == 1) {
}
}
switch (count) {
case 0:
break;
case 1:
break;
default:
}
}
/* T3 tests proxy and server authentication. three threads request same
* resource at same time. Authenticator should be called once for server
* and once for proxy
*/
switch (count) {
case 0:
break;
case 1:
break;
case 2:
break;
default:
}
}
switch (count) {
case 0:
break;
case 1:
break;
default:
}
}
};
if (f != 2) {
}
if (error) {
except ("error occurred");
}
auth.resetCount();
if (f != redirects+1) {
}
if (error) {
except ("error occurred");
}
}
if (f != 2) {
}
if (error) {
except ("error occurred");
}
}
try {
if (proxy) {
doProxyTests ("www.foo.com");
} else {
}
} catch (Exception e) {
}
throw e;
}
}
try {
} catch (InterruptedException e) {}
}
throw new RuntimeException (s);
}
MyAuthenticator () {
super ();
}
//System.out.println ("Authenticator called: " + getRequestingPrompt());
//try {
//Thread.sleep (1000);
//} catch (InterruptedException e) {}
count ++;
return pw;
}
public void resetCount () {
count = 0;
}
public int getCount () {
return (count);
}
}
}