Source:
public void testProxyConnection_Not_Found_Response ( ) throws java.lang.Throwable { org.apache.harmony.luni.tests.internal.net.www.protocol.https.HttpsURLConnectionTest.setUpStoreProperties ( ) ; java.net.ServerSocket ss = new java.net.ServerSocket ( 0 ) ; org.apache.harmony.luni.tests.internal.net.www.protocol.https.HttpsURLConnectionTest.TestHostnameVerifier hnv = new org.apache.harmony.luni.tests.internal.net.www.protocol.https.HttpsURLConnectionTest.TestHostnameVerifier ( ) ; javax.net.ssl.HttpsURLConnection.setDefaultHostnameVerifier ( hnv ) ; java.net.URL url = new java.net.URL ( ( "https://localhost:" + ( ss.getLocalPort ( ) ) ) ) ; javax.net.ssl.HttpsURLConnection connection = ( ( javax.net.ssl.HttpsURLConnection ) ( url.openConnection ( new java.net.Proxy ( java.net.Proxy.Type.HTTP , new java.net.InetSocketAddress ( "localhost" , ss.getLocalPort ( ) ) ) ) ) ) ; connection.setSSLSocketFactory ( org.apache.harmony.luni.tests.internal.net.www.protocol.https.HttpsURLConnectionTest.getContext ( ) . getSocketFactory ( ) ) ; try { org.apache.harmony.luni.tests.internal.net.www.protocol.https.HttpsURLConnectionTest.doInteraction ( connection , ss , org.apache.harmony.luni.tests.internal.net.www.protocol.https.HttpsURLConnectionTest.NOT_FOUND_CODE ) ; fail ( "Expected exception was not thrown." ) ; } catch ( java.io.FileNotFoundException e ) { if ( org.apache.harmony.luni.tests.internal.net.www.protocol.https.HttpsURLConnectionTest.DO_LOG ) { java.lang.System.out.println ( ( "Expected exception was thrown: " + ( e.getMessage ( ) ) ) ) ; } } }

Target:
public void testConsequentProxyConnection ( ) throws java.lang.Throwable { org.apache.harmony.luni.tests.internal.net.www.protocol.https.HttpsURLConnectionTest.setUpStoreProperties ( ) ; javax.net.ssl.HttpsURLConnection.setDefaultHostnameVerifier ( new org.apache.harmony.luni.tests.internal.net.www.protocol.https.HttpsURLConnectionTest.TestHostnameVerifier ( ) ) ; org.apache.harmony.luni.tests.internal.net.www.protocol.https.HttpsURLConnectionTest.SingleRequestDispatcher getDispatcher1 = new org.apache.harmony.luni.tests.internal.net.www.protocol.https.HttpsURLConnectionTest.SingleRequestDispatcher ( org.apache.harmony.luni.tests.internal.net.www.protocol.https.HttpsURLConnectionTest.GET_METHOD , org.apache.harmony.luni.tests.internal.net.www.protocol.https.HttpsURLConnectionTest.OK_CODE ) ; com.google.mockwebserver.MockWebServer proxyAndWebServer1 = org.apache.harmony.luni.tests.internal.net.www.protocol.https.HttpsURLConnectionTest.createProxiedServer ( getDispatcher1 ) ; java.net.URL proxyUrl1 = proxyAndWebServer1.getUrl ( "/" ) ; java.net.URL url = new java.net.URL ( "https://requested.host:55555/requested.data" ) ; java.net.InetSocketAddress proxyAddress = new java.net.InetSocketAddress ( "localhost" , proxyUrl1.getPort ( ) ) ; javax.net.ssl.HttpsURLConnection connection = ( ( javax.net.ssl.HttpsURLConnection ) ( url.openConnection ( new java.net.Proxy ( java.net.Proxy.Type.HTTP , proxyAddress ) ) ) ) ; connection.setSSLSocketFactory ( org.apache.harmony.luni.tests.internal.net.www.protocol.https.HttpsURLConnectionTest.getContext ( ) . getSocketFactory ( ) ) ; org.apache.harmony.luni.tests.internal.net.www.protocol.https.HttpsURLConnectionTest.executeClientRequest ( connection , false ) ; org.apache.harmony.luni.tests.internal.net.www.protocol.https.HttpsURLConnectionTest.checkConnectionStateParameters ( connection , getDispatcher1.getLastRequest ( ) ) ; proxyAndWebServer1.shutdown ( ) ; org.apache.harmony.luni.tests.internal.net.www.protocol.https.HttpsURLConnectionTest.SingleRequestDispatcher getDispatcher2 = new org.apache.harmony.luni.tests.internal.net.www.protocol.https.HttpsURLConnectionTest.SingleRequestDispatcher ( org.apache.harmony.luni.tests.internal.net.www.protocol.https.HttpsURLConnectionTest.GET_METHOD , org.apache.harmony.luni.tests.internal.net.www.protocol.https.HttpsURLConnectionTest.OK_CODE ) ; com.google.mockwebserver.MockWebServer proxyAndWebServer2 = org.apache.harmony.luni.tests.internal.net.www.protocol.https.HttpsURLConnectionTest.createProxiedServer ( getDispatcher2 ) ; java.net.URL proxyUrl2 = proxyAndWebServer2.getUrl ( "/" ) ; java.net.InetSocketAddress proxyAddress2 = new java.net.InetSocketAddress ( "localhost" , proxyUrl2.getPort ( ) ) ; javax.net.ssl.HttpsURLConnection connection2 = ( ( javax.net.ssl.HttpsURLConnection ) ( url.openConnection ( new java.net.Proxy ( java.net.Proxy.Type.HTTP , proxyAddress2 ) ) ) ) ; connection2.setSSLSocketFactory ( org.apache.harmony.luni.tests.internal.net.www.protocol.https.HttpsURLConnectionTest.getContext ( ) . getSocketFactory ( ) ) ; org.apache.harmony.luni.tests.internal.net.www.protocol.https.HttpsURLConnectionTest.executeClientRequest ( connection2 , false ) ; org.apache.harmony.luni.tests.internal.net.www.protocol.https.HttpsURLConnectionTest.checkConnectionStateParameters ( connection2 , getDispatcher2.getLastRequest ( ) ) ; proxyAndWebServer2.shutdown ( ) ; }