test/jdk/java/net/URLConnection/Responses.java
changeset 58365 73950479184b
parent 58009 0daf32316b47
child 58679 9c3209ff7550
equal deleted inserted replaced
58364:2c87d191056c 58365:73950479184b
    27  * @summary Check that HttpURLConnection.getResponseCode returns -1 for
    27  * @summary Check that HttpURLConnection.getResponseCode returns -1 for
    28  *          malformed status-lines in the http response.
    28  *          malformed status-lines in the http response.
    29  */
    29  */
    30 import java.net.*;
    30 import java.net.*;
    31 import java.io.*;
    31 import java.io.*;
       
    32 import static java.net.Proxy.NO_PROXY;
    32 
    33 
    33 public class Responses {
    34 public class Responses {
    34 
    35 
    35     /*
    36     /*
    36      * Test cases :-
    37      * Test cases :-
   147 
   148 
   148             System.out.println("******************");
   149             System.out.println("******************");
   149             System.out.println("Test with response: >" + tests[i][0] + "<");
   150             System.out.println("Test with response: >" + tests[i][0] + "<");
   150 
   151 
   151             URL url = new URL("http://" + authority + "/" + i);
   152             URL url = new URL("http://" + authority + "/" + i);
   152             HttpURLConnection http = (HttpURLConnection)url.openConnection();
   153             HttpURLConnection http = (HttpURLConnection)url.openConnection(NO_PROXY);
   153 
   154 
   154             try {
   155             try {
   155 
   156 
   156                 // test getResponseCode
   157                 // test getResponseCode
   157                 //
   158                 //