< prev index next >

jdk/test/sun/net/www/protocol/https/HttpsURLConnection/B6216082.java

Print this page
rev 17203 : 8180644: move jdk.testlibrary.NetworkConfiguration to the top level test library
Reviewed-by: duke


  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  */
  23 
  24 //
  25 // SunJSSE does not support dynamic system properties, no way to re-use
  26 // system properties in samevm/agentvm mode.
  27 //
  28 
  29 /*
  30  * @test
  31  * @bug 6216082
  32  * @summary  Redirect problem with HttpsURLConnection using a proxy
  33  * @modules java.base/sun.net.www
  34  * @library .. /lib/testlibrary
  35  * @build HttpCallback TestHttpsServer ClosedChannelList
  36  *        HttpTransaction TunnelProxy jdk.testlibrary.NetworkConfiguration
  37  * @key intermittent
  38  * @run main/othervm B6216082
  39  */
  40 
  41 import java.io.*;
  42 import java.net.*;
  43 import javax.net.ssl.*;
  44 import java.util.*;
  45 
  46 import jdk.testlibrary.NetworkConfiguration;
  47 
  48 public class B6216082 {
  49     static SimpleHttpTransaction httpTrans;
  50     static TestHttpsServer server;
  51     static TunnelProxy proxy;
  52 
  53     // it seems there's no proxy ever if a url points to 'localhost',
  54     // even if proxy related properties are set. so we need to bind
  55     // our simple http proxy and http server to a non-loopback address
  56     static InetAddress firstNonLoAddress = null;
  57 
  58     public static void main(String[] args) throws Exception {
  59         HostnameVerifier reservedHV =
  60             HttpsURLConnection.getDefaultHostnameVerifier();
  61         try {
  62             // XXX workaround for CNFE
  63             Class.forName("java.nio.channels.ClosedByInterruptException");
  64             if (!setupEnv()) {
  65                 return;
  66             }




  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  */
  23 
  24 //
  25 // SunJSSE does not support dynamic system properties, no way to re-use
  26 // system properties in samevm/agentvm mode.
  27 //
  28 
  29 /*
  30  * @test
  31  * @bug 6216082
  32  * @summary  Redirect problem with HttpsURLConnection using a proxy
  33  * @modules java.base/sun.net.www
  34  * @library .. /test/lib
  35  * @build HttpCallback TestHttpsServer ClosedChannelList
  36  *        HttpTransaction TunnelProxy
  37  * @key intermittent
  38  * @run main/othervm B6216082
  39  */
  40 
  41 import java.io.*;
  42 import java.net.*;
  43 import javax.net.ssl.*;
  44 import java.util.*;
  45 
  46 import jdk.test.lib.NetworkConfiguration;
  47 
  48 public class B6216082 {
  49     static SimpleHttpTransaction httpTrans;
  50     static TestHttpsServer server;
  51     static TunnelProxy proxy;
  52 
  53     // it seems there's no proxy ever if a url points to 'localhost',
  54     // even if proxy related properties are set. so we need to bind
  55     // our simple http proxy and http server to a non-loopback address
  56     static InetAddress firstNonLoAddress = null;
  57 
  58     public static void main(String[] args) throws Exception {
  59         HostnameVerifier reservedHV =
  60             HttpsURLConnection.getDefaultHostnameVerifier();
  61         try {
  62             // XXX workaround for CNFE
  63             Class.forName("java.nio.channels.ClosedByInterruptException");
  64             if (!setupEnv()) {
  65                 return;
  66             }


< prev index next >