/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/**
* @test
* @bug 5026745 6631048
* @summary Cannot flush output stream when writing to an HttpUrlConnection
*/
"1234567890abcdefkjsdlkjflkjsldkfjlsdkjflkj"+
"1434567890abcdefkjsdlkjflkjsldkfjlsdkjflkj";
"1234567890";
try {
break;
}
break;
}
if (count == 1) {
}
break;
break;
}
break;
}
break;
break;
break;
break;
}
break;
break;
}
break;
}
break;
boolean error = false;
for (int i=10; i< 200 * 1024; i++) {
if (c != (byte)i) {
error = true;
}
}
} else if (error) {
} else {
}
break;
error = false;
for (int i=10; i< 30 * 1024; i++) {
if (c != (byte)i) {
error = true;
}
}
} else if (error) {
} else {
}
break;
error = false;
for (int i=10; i< 30 * 1024; i++) {
if (c != (byte)i) {
error = true;
}
}
if (error) {
} else {
}
break;
}
count ++;
} catch (IOException e) {
e.printStackTrace();
}
}
}
try {
int c;
int l = 0;
l += c;
}
} catch (Exception e) {
e.printStackTrace();
}
return null;
}
try {
byte[] ba = new byte [8096];
int off = 0, c;
off += c;
}
} catch (Exception e) {
e.printStackTrace();
}
return null;
}
try {
} catch (Exception e) {
e.printStackTrace();
}
}
int c;
byte buf[] = new byte [1024];
int off = 0;
int len = 1024;
off += c;
len -= c;
}
throw new IOException("strings not same");
}
}
/* basic chunked test (runs twice) */
urlc.setDoOutput(true);
}
/* basic fixed length test */
urlc.setDoOutput(true);
}
/* write too few bytes */
urlc.setDoOutput(true);
try {
throw new Exception ("should have thrown IOException");
} catch (IOException e) {}
}
/* write too many bytes */
urlc.setDoOutput(true);
try {
throw new Exception ("should have thrown IOException");
} catch (IOException e) {}
}
/* check for HttpRetryException on redirection */
urlc.setDoOutput(true);
try {
throw new Exception ("should have gotten HttpRetryException");
} catch (HttpRetryException e) {
if (e.responseCode() != 307) {
}
}
}
}
/* next two tests send zero length posts */
urlc.setDoOutput(true);
if (ret != 200) {
}
}
urlc.setDoOutput(true);
if (ret != 200) {
}
}
/* calling setChunkedStreamingMode with -1 should entail using
the default chunk size */
urlc.setDoOutput(true);
}
urlc.setDoOutput(true);
for (int i=0; i< 200 * 1024; i++) {
buf[i] = (byte) i;
}
/* write a small bit first, and then the large buffer */
if (ret != 200) {
}
}
urlc.setDoOutput(true);
for (int i=0; i< 30 * 1024; i++) {
buf[i] = (byte) i;
}
/* write a small bit first, and then the large buffer */
//os.write (buf, 10, buf.length - 10); /* skip 10 bytes to test offset */
if (ret != 200) {
}
}
urlc.setDoOutput(true);
for (int i=0; i< 30 * 1024; i++) {
buf[i] = (byte) i;
}
if (ret != 200) {
}
}
try {
httpserver.start();
} finally {
if (httpserver != null)
}
}
}