3261N/A * Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved. 1252N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 1252N/A * This code is free software; you can redistribute it and/or modify it 1252N/A * under the terms of the GNU General Public License version 2 only, as 1252N/A * published by the Free Software Foundation. 1252N/A * This code is distributed in the hope that it will be useful, but WITHOUT 1252N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 1252N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 1252N/A * version 2 for more details (a copy is included in the LICENSE file that 1252N/A * You should have received a copy of the GNU General Public License version 1252N/A * 2 along with this work; if not, write to the Free Software Foundation, 1252N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 2362N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 2362N/A * or visit www.oracle.com if you need additional information or have any 1252N/A * @summary HttpURLConnection shoul support 'Expect: 100-contimue' headers for PUT 1252N/A // Exit even if server is still running 1252N/A * This is a hardcoded test. The server side expects 3 requests with a 1252N/A * Expect: 100-continue header. It will reject the 1st one and accept 1252N/A * the second one. Thus allowing us to test both scenarios. 1252N/A * The 3rd case is the simulation of a server that just plains ignore 1252N/A * the Expect: 100-Continue header. So the POST should proceed after 1252N/A // 1st Connection. Should be rejected. I.E. get a ProtocolException 1252N/A // 2nd connection. Should be accepted by server. 1252N/A // 3rd connection. Simulate a server that doesn't implement 100-continue 1252N/A // Fist connection: don't accetpt the request 1252N/A // Second connection: accept the request (send 100-continue) 1252N/A // 3rd connection: just ignore the 'Expect:' header 2981N/A /* Force the server to not respond for more that the expect 100-Continue 2981N/A * timeout set by the HTTP handler (5000 millis). This ensures the 2981N/A * timeout is correctly resets the default read timeout, infinity.