test/jdk/java/net/URLConnection/Redirect307Test.java
changeset 58365 73950479184b
parent 54841 43439afaab4a
equal deleted inserted replaced
58364:2c87d191056c 58365:73950479184b
    27  * @library /test/lib
    27  * @library /test/lib
    28  * @summary  HttpURLConnection does not support 307 redirects
    28  * @summary  HttpURLConnection does not support 307 redirects
    29  */
    29  */
    30 import java.io.*;
    30 import java.io.*;
    31 import java.net.*;
    31 import java.net.*;
    32 
       
    33 import jdk.test.lib.net.URIBuilder;
    32 import jdk.test.lib.net.URIBuilder;
       
    33 import static java.net.Proxy.NO_PROXY;
    34 
    34 
    35 class RedirServer extends Thread {
    35 class RedirServer extends Thread {
    36 
    36 
    37     static final int TIMEOUT = 10 * 1000;
    37     static final int TIMEOUT = 10 * 1000;
    38 
    38 
   111         URL url = URIBuilder.newBuilder()
   111         URL url = URIBuilder.newBuilder()
   112                 .scheme("http")
   112                 .scheme("http")
   113                 .loopback()
   113                 .loopback()
   114                 .port(port)
   114                 .port(port)
   115                 .toURL();
   115                 .toURL();
   116         URLConnection conURL =  url.openConnection();
   116         URLConnection conURL =  url.openConnection(NO_PROXY);
   117         conURL.setDoInput(true);
   117         conURL.setDoInput(true);
   118         conURL.setAllowUserInteraction(false);
   118         conURL.setAllowUserInteraction(false);
   119         conURL.setUseCaches(false);
   119         conURL.setUseCaches(false);
   120 
   120 
   121         try (InputStream in = conURL.getInputStream()) {
   121         try (InputStream in = conURL.getInputStream()) {